Class: MSPhysics::Spring
- Defined in:
- RubyExtension/MSPhysics/joint_spring.rb
Overview
Constant Summary
- DEFAULT_MIN =
-10.0
- DEFAULT_MAX =
10.0- DEFAULT_LIMITS_ENABLED =
false- DEFAULT_ROTATION_ENABLED =
false- DEFAULT_MODE =
0- DEFAULT_ACCEL =
40.0- DEFAULT_DAMP =
0.1- DEFAULT_STRENGTH =
0.8- DEFAULT_SPRING_CONSTANT =
40.0- DEFAULT_SPRING_DRAG =
1.0- DEFAULT_START_POSITION =
0.0- DEFAULT_CONTROLLER =
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
-
#accel ⇒ Numeric
Get spring oscillation acceleration factor.
-
#accel=(value) ⇒ Object
Set spring oscillation acceleration factor.
-
#controller ⇒ Numeric
Get magnitude and direction of the starting position.
-
#controller=(value) ⇒ Object
Set magnitude and direction of the starting position.
-
#cur_acceleration ⇒ Numeric
Get current acceleration in meters per second per second.
-
#cur_position ⇒ Numeric
Get current position in meters with respect to the starting position.
-
#cur_velocity ⇒ Numeric
Get current velocity in meters per second.
-
#damp ⇒ Numeric
Get spring oscillation damping coefficient.
-
#damp=(value) ⇒ Object
Set spring oscillation damping coefficient.
-
#initialize(world, parent, pin_tra, group = nil) ⇒ Spring
constructor
Create a spring joint.
-
#limits_enabled=(state) ⇒ Object
Enable/disable min and max position limits.
-
#limits_enabled? ⇒ Boolean
Determine whether min and max position limits are enabled.
-
#max ⇒ Numeric
Get maximum position in meters with respect to the starting position.
-
#max=(value) ⇒ Object
Set maximum position in meters with respect to the starting position.
-
#min ⇒ Numeric
Get minimum position in meters with respect to the starting position.
-
#min=(value) ⇒ Object
Set minimum position in meters with respect to the starting position.
-
#mode ⇒ Fixnum
Get mode.
-
#mode=(value) ⇒ Object
Set mode.
-
#rotation_enabled=(state) ⇒ Object
Enable/disable rotation along Z-axis of joint.
-
#rotation_enabled? ⇒ Boolean
Determine whether rotation along Z-axis of joint is enabled.
-
#spring_constant ⇒ Numeric
Get Hooke's spring constant.
-
#spring_constant=(value) ⇒ Object
Set Hooke's spring constant.
-
#spring_drag ⇒ Numeric
Get Hooke's spring drag.
-
#spring_drag=(value) ⇒ Object
Set Hooke's spring drag.
-
#start_position ⇒ Numeric
Get starting position along joint Z-axis in meters.
-
#start_position=(position) ⇒ Object
Set starting position along joint Z-axis in meters.
-
#strength ⇒ Numeric
Get spring oscillation strength coefficient.
-
#strength=(value) ⇒ Object
Set spring oscillation strength coefficient.
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
Constructor Details
#initialize(world, parent, pin_tra, group = nil) ⇒ Spring
Create a spring joint.
Instance Method Details
#accel ⇒ Numeric
This option associates with the normal spring mode.
Get spring oscillation acceleration factor.
#accel=(value) ⇒ Object
This option associates with the normal spring mode.
Set spring oscillation acceleration factor.
#controller ⇒ Numeric
The actual, desired starting position is, start_position *
controller.
Get magnitude and direction of the starting position.
#controller=(value) ⇒ Object
The actual, desired starting position is, start_position *
controller.
Set magnitude and direction of the starting position.
#cur_acceleration ⇒ Numeric
Get current acceleration in meters per second per second.
#cur_position ⇒ Numeric
Get current position in meters with respect to the starting position.
#cur_velocity ⇒ Numeric
Get current velocity in meters per second.
#damp ⇒ Numeric
This option associates with the normal spring mode.
Get spring oscillation damping coefficient.
#damp=(value) ⇒ Object
This option associates with the normal spring mode.
Set spring oscillation damping coefficient.
#limits_enabled=(state) ⇒ Object
Enable/disable min and max position limits.
#limits_enabled? ⇒ Boolean
Determine whether min and max position limits are enabled.
#max ⇒ Numeric
Get maximum position in meters with respect to the starting position.
#max=(value) ⇒ Object
Set maximum position in meters with respect to the starting position.
#min ⇒ Numeric
Get minimum position in meters with respect to the starting position.
#min=(value) ⇒ Object
Set minimum position in meters with respect to the starting position.
#mode ⇒ Fixnum
Get mode.
#mode=(value) ⇒ Object
Set mode.
#rotation_enabled=(state) ⇒ Object
Enable/disable rotation along Z-axis of joint.
#rotation_enabled? ⇒ Boolean
Determine whether rotation along Z-axis of joint is enabled.
#spring_constant ⇒ Numeric
This option associates with the Hooke's spring mode.
Get Hooke's spring constant.
#spring_constant=(value) ⇒ Object
This option associates with the Hooke's spring mode.
Set Hooke's spring constant.
#spring_drag ⇒ Numeric
This option associates with the Hooke's spring mode.
Get Hooke's spring drag.
#spring_drag=(value) ⇒ Object
This option associates with the Hooke's spring mode.
Set Hooke's spring drag.
#start_position ⇒ Numeric
The actual, desired starting position is, start_position *
controller.
Get starting position along joint Z-axis in meters.
#start_position=(position) ⇒ Object
The actual, desired starting position is, start_position *
controller.
Set starting position along joint Z-axis in meters.
#strength ⇒ Numeric
This option associates with the normal spring mode.
Get spring oscillation strength coefficient.
#strength=(value) ⇒ Object
This option associates with the normal spring mode.
Set spring oscillation strength coefficient.