Class: MSPhysics::PointToPoint
- Defined in:
- RubyExtension/MSPhysics/joint_point_to_point.rb
Overview
Constant Summary collapse
- DEFAULT_ACCEL =
40.0
- DEFAULT_DAMP =
0.1
- DEFAULT_STRENGTH =
0.80
- DEFAULT_MODE =
0
- DEFAULT_START_DISTANCE =
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 of the starting distance.
-
#controller=(value) ⇒ Object
Set magnitude of the starting distance.
-
#cur_distance ⇒ Numeric
Get current distance in meters with respect to the starting position.
-
#damp ⇒ Numeric
Get spring oscillation drag coefficient.
-
#damp=(value) ⇒ Object
Set spring oscillation drag coefficient.
-
#initialize(world, parent, pin_tra, group = nil) ⇒ PointToPoint
constructor
Create a PointToPoint joint.
-
#mode ⇒ Integer
Get mode.
-
#mode=(value) ⇒ Object
Set mode.
-
#start_distance ⇒ Numeric
Get starting distance in meters.
-
#start_distance=(value) ⇒ Object
Set starting distance in meters.
-
#strength ⇒ Numeric
Get spring strength coefficient.
-
#strength=(value) ⇒ Object
Set spring 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, #get_tension1, #get_tension2, #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) ⇒ PointToPoint
Create a PointToPoint joint.
20 21 22 23 24 25 26 27 28 29 |
# File 'RubyExtension/MSPhysics/joint_point_to_point.rb', line 20 def initialize(world, parent, pin_tra, group = nil) super(world, parent, pin_tra, group) MSPhysics::Newton::PointToPoint.create(@address) MSPhysics::Newton::PointToPoint.set_accel(@address, DEFAULT_ACCEL) MSPhysics::Newton::PointToPoint.set_damp(@address, DEFAULT_DAMP) MSPhysics::Newton::PointToPoint.set_strength(@address, DEFAULT_STRENGTH) MSPhysics::Newton::PointToPoint.set_mode(@address, DEFAULT_MODE) MSPhysics::Newton::PointToPoint.set_start_distance(@address, DEFAULT_START_DISTANCE) MSPhysics::Newton::PointToPoint.set_controller(@address, DEFAULT_CONTROLLER) end |
Instance Method Details
#accel ⇒ Numeric
Get spring oscillation acceleration factor.
33 34 35 |
# File 'RubyExtension/MSPhysics/joint_point_to_point.rb', line 33 def accel MSPhysics::Newton::PointToPoint.get_accel(@address) end |
#accel=(value) ⇒ Object
Set spring oscillation acceleration factor.
40 41 42 |
# File 'RubyExtension/MSPhysics/joint_point_to_point.rb', line 40 def accel=(value) MSPhysics::Newton::PointToPoint.set_accel(@address, value) end |
#controller ⇒ Numeric
The actual, desired distance is, start_distance * controller
.
Get magnitude of the starting distance.
104 105 106 |
# File 'RubyExtension/MSPhysics/joint_point_to_point.rb', line 104 def controller MSPhysics::Newton::PointToPoint.get_controller(@address) end |
#controller=(value) ⇒ Object
The actual, desired distance is, start_distance * controller
.
Set magnitude of the starting distance.
112 113 114 |
# File 'RubyExtension/MSPhysics/joint_point_to_point.rb', line 112 def controller=(value) MSPhysics::Newton::PointToPoint.set_controller(@address, value) end |
#cur_distance ⇒ Numeric
Get current distance in meters with respect to the starting position.
118 119 120 |
# File 'RubyExtension/MSPhysics/joint_point_to_point.rb', line 118 def cur_distance MSPhysics::Newton::PointToPoint.get_cur_distance(@address) end |
#damp ⇒ Numeric
Get spring oscillation drag coefficient.
46 47 48 |
# File 'RubyExtension/MSPhysics/joint_point_to_point.rb', line 46 def damp MSPhysics::Newton::PointToPoint.get_damp(@address) end |
#damp=(value) ⇒ Object
Set spring oscillation drag coefficient.
52 53 54 |
# File 'RubyExtension/MSPhysics/joint_point_to_point.rb', line 52 def damp=(value) MSPhysics::Newton::PointToPoint.set_damp(@address, value) end |
#mode ⇒ Integer
Get mode.
72 73 74 |
# File 'RubyExtension/MSPhysics/joint_point_to_point.rb', line 72 def mode MSPhysics::Newton::PointToPoint.get_mode(@address) end |
#mode=(value) ⇒ Object
Set mode.
80 81 82 |
# File 'RubyExtension/MSPhysics/joint_point_to_point.rb', line 80 def mode=(value) MSPhysics::Newton::PointToPoint.set_mode(@address, value) end |
#start_distance ⇒ Numeric
The actual, desired distance is, start_distance * controller
.
Get starting distance in meters.
88 89 90 |
# File 'RubyExtension/MSPhysics/joint_point_to_point.rb', line 88 def start_distance MSPhysics::Newton::PointToPoint.get_start_distance(@address) end |
#start_distance=(value) ⇒ Object
The actual, desired distance is, start_distance * controller
.
Set starting distance in meters.
96 97 98 |
# File 'RubyExtension/MSPhysics/joint_point_to_point.rb', line 96 def start_distance=(value) MSPhysics::Newton::PointToPoint.set_start_distance(@address, value) end |
#strength ⇒ Numeric
Get spring strength coefficient.
58 59 60 |
# File 'RubyExtension/MSPhysics/joint_point_to_point.rb', line 58 def strength MSPhysics::Newton::PointToPoint.get_strength(@address) end |
#strength=(value) ⇒ Object
Set spring strength coefficient.
64 65 66 |
# File 'RubyExtension/MSPhysics/joint_point_to_point.rb', line 64 def strength=(value) MSPhysics::Newton::PointToPoint.set_strength(@address, value) end |