Class: MSPhysics::Motor

Inherits:
Joint show all
Defined in:
RubyExtension/MSPhysics/joint_motor.rb

Overview

Since:

  • 1.0.0

Constant Summary

DEFAULT_ACCEL =

Since:

  • 1.0.0

1.0
DEFAULT_DAMP =

Since:

  • 1.0.0

0.5
DEFAULT_FREE_ROTATE_ENABLED =

Since:

  • 1.0.0

false
DEFAULT_CONTROLLER =

Since:

  • 1.0.0

1.0

Constants inherited from Joint

Joint::DEFAULT_BODIES_COLLIDABLE, Joint::DEFAULT_BREAKING_FORCE, Joint::DEFAULT_SOLVER_MODEL, Joint::DEFAULT_STIFFNESS

Instance Method Summary collapse

Methods inherited from Joint

#address, all_joints, #bodies_collidable=, #bodies_collidable?, #breaking_force, #breaking_force=, #child, #connect, #connected?, #destroy, #disconnect, #dof, #get_pin_matrix, #get_pin_matrix2, #group, joint_by_address, #name, #name=, #parent, #set_pin_matrix, #solver_model, #solver_model=, #stiffness, #stiffness=, #type, #valid?, validate, #world

Methods inherited from Entity

#inspect, #to_s

Constructor Details

#initialize(world, parent, pin_tra, group = nil) ⇒ Motor

Create a motor joint.

Parameters:

  • world (MSPhysics::World)
  • parent (MSPhysics::Body, nil)
  • pin_tra (Geom::Transformation, Array<Numeric>)

    Pin transformation in global space. Matrix origin is interpreted as the pin position. Matrix Z-axis is interpreted as the pin direction.

  • group (Sketchup::Group, Sketchup::ComponentInstance, nil) (defaults to: nil)

Since:

  • 1.0.0

Instance Method Details

#accelNumeric

Note:

The actual acceleration is accel * controller.

Note:

The maximum angular rate in radians per second is accel * controller / damp.

Get rotational acceleration in radians per second per second.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#accel=(value) ⇒ Object

Note:

The actual acceleration is accel * controller.

Note:

The maximum angular rate in radians per second is accel * controller / damp.

Set rotational acceleration in radians per second per second.

Parameters:

  • value (Numeric)

Since:

  • 1.0.0

#controllerNumeric

Note:

The actual acceleration is accel * controller.

Note:

The maximum angular rate in radians per second is accel * controller / damp.

Get motor controller, magnitude and direction of the desired acceleration.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#controller=(value) ⇒ Object

Note:

The actual acceleration is accel * controller.

Note:

The maximum angular rate in radians per second is accel * controller / damp.

Set motor controller, magnitude and direction of the desired acceleration.

Parameters:

  • value (Numeric)

Since:

  • 1.0.0

#cur_alphaNumeric

Get current angular acceleration in radians per second per second.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#cur_angleNumeric

Get current angle in radians.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#cur_omegaNumeric

Get current angular velocity in radians per second.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#dampNumeric

Note:

Higher damper makes rotation stronger.

Note:

The maximum angular rate in radians per second is accel * controller / damp.

Get rotational damper.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#damp=(value) ⇒ Object

Note:

Higher damper makes rotation stronger.

Note:

The maximum angular rate in radians per second is accel * controller / damp.

Set rotational damper.

Parameters:

  • value (Numeric)

    A value greater than or equal to zero.

Since:

  • 1.0.0

#free_rotate_enabled=(state) ⇒ Object

Enable/disable free rotate. Free rotate allows the motor to spin freely when accel is zero.

Parameters:

  • state (Boolean)

Since:

  • 1.0.0

#free_rotate_enabled?Boolean

Determine whether free rotate is enabled. Free rotate allows the motor to spin freely when accel is zero.

Returns:

  • (Boolean)

Since:

  • 1.0.0