Class: MSPhysics::UpVector
- Defined in:
- RubyExtension/MSPhysics/joint_up_vector.rb
Overview
Constant Summary collapse
- DEFAULT_ACCEL =
40.0
- DEFAULT_DAMP =
10.0
- DEFAULT_STRENGTH =
0.98
- DEFAULT_PIN_DIR =
Z_AXIS
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 angular acceleration.
-
#accel=(value) ⇒ Object
Set angular acceleration.
-
#damp ⇒ Numeric
Get angular damper.
-
#damp=(value) ⇒ Object
Set angular damper.
-
#get_pin_dir ⇒ Geom::Vector3d
Get desired pin direction with respect to joint orientation.
-
#initialize(world, parent, pin_tra, group = nil) ⇒ UpVector
constructor
Create an UpVector joint.
-
#set_pin_dir(pin_dir) ⇒ nil
Set desired pin direction with respect to joint orientation.
-
#strength ⇒ Numeric
Get strength of the acceleration and damper.
-
#strength=(value) ⇒ Object
Set strength of the acceleration and damper.
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) ⇒ UpVector
Create an UpVector joint.
18 19 20 21 22 23 24 25 |
# File 'RubyExtension/MSPhysics/joint_up_vector.rb', line 18 def initialize(world, parent, pin_tra, group = nil) super(world, parent, pin_tra, group) MSPhysics::Newton::UpVector.create(@address) MSPhysics::Newton::UpVector.set_accel(@address, DEFAULT_ACCEL) MSPhysics::Newton::UpVector.set_damp(@address, DEFAULT_DAMP) MSPhysics::Newton::UpVector.set_strength(@address, DEFAULT_STRENGTH) MSPhysics::Newton::UpVector.set_pin_dir(@address, DEFAULT_PIN_DIR) end |
Instance Method Details
#accel ⇒ Numeric
Higher acceleration makes rotation faster.
Get angular acceleration.
30 31 32 |
# File 'RubyExtension/MSPhysics/joint_up_vector.rb', line 30 def accel MSPhysics::Newton::UpVector.get_accel(@address) end |
#accel=(value) ⇒ Object
Higher acceleration makes rotation faster.
Set angular acceleration.
37 38 39 |
# File 'RubyExtension/MSPhysics/joint_up_vector.rb', line 37 def accel=(value) MSPhysics::Newton::UpVector.set_accel(@address, value) end |
#damp ⇒ Numeric
Higher damper makes rotation stronger.
Get angular damper.
44 45 46 |
# File 'RubyExtension/MSPhysics/joint_up_vector.rb', line 44 def damp MSPhysics::Newton::UpVector.get_damp(@address) end |
#damp=(value) ⇒ Object
Higher damper makes rotation stronger.
Set angular damper.
51 52 53 |
# File 'RubyExtension/MSPhysics/joint_up_vector.rb', line 51 def damp=(value) MSPhysics::Newton::UpVector.set_damp(@address, value) end |
#get_pin_dir ⇒ Geom::Vector3d
Get desired pin direction with respect to joint orientation.
69 70 71 |
# File 'RubyExtension/MSPhysics/joint_up_vector.rb', line 69 def get_pin_dir MSPhysics::Newton::UpVector.get_pin_dir(@address) end |
#set_pin_dir(pin_dir) ⇒ nil
Set desired pin direction with respect to joint orientation.
76 77 78 |
# File 'RubyExtension/MSPhysics/joint_up_vector.rb', line 76 def set_pin_dir(pin_dir) MSPhysics::Newton::UpVector.set_pin_dir(@address, pin_dir) end |
#strength ⇒ Numeric
Get strength of the acceleration and damper.
57 58 59 |
# File 'RubyExtension/MSPhysics/joint_up_vector.rb', line 57 def strength MSPhysics::Newton::UpVector.get_strength(@address) end |
#strength=(value) ⇒ Object
Set strength of the acceleration and damper.
63 64 65 |
# File 'RubyExtension/MSPhysics/joint_up_vector.rb', line 63 def strength=(value) MSPhysics::Newton::UpVector.set_strength(@address, value) end |