Class: MSPhysics::Universal
- Defined in:
- RubyExtension/MSPhysics/joint_universal.rb
Overview
Constant Summary collapse
- DEFAULT_MIN =
-180.0.degrees
- DEFAULT_MAX =
180.0.degrees
- DEFAULT_LIMITS_ENABLED =
false
- DEFAULT_FRICTION =
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
-
#controller ⇒ Numeric
Get magnitude of the angular friction.
-
#controller=(value) ⇒ Object
Set magnitude of the angular friction.
-
#cur_alpha1 ⇒ Numeric
Get current angular acceleration in radians per second per second along joint Z-axis.
-
#cur_alpha2 ⇒ Numeric
Get current angular acceleration in radians per second per second along joint X-axis.
-
#cur_angle1 ⇒ Numeric
Get current angle in radians along joint Z-axis.
-
#cur_angle2 ⇒ Numeric
Get current angle in radians along joint X-axis.
-
#cur_omega1 ⇒ Numeric
Get current angular velocity in radians per second along joint Z-axis.
-
#cur_omega2 ⇒ Numeric
Get current angular velocity in radians per second along joint X-axis.
-
#friction ⇒ Numeric
Get angular friction.
-
#friction=(value) ⇒ Object
Set angular friction.
-
#initialize(world, parent, pin_tra, group = nil) ⇒ Universal
constructor
Create a universal joint.
-
#limits1_enabled=(state) ⇒ Object
Enable/disable min & max angle limits along joint Z-axis.
-
#limits1_enabled? ⇒ Boolean
Determine whether min & max angle limits along joint Z-axis are enabled.
-
#limits2_enabled=(state) ⇒ Object
Enable/disable min & max angle limits along joint X-axis.
-
#limits2_enabled? ⇒ Boolean
Determine whether min & max angle limits along joint X-axis are enabled.
-
#max1 ⇒ Numeric
Get maximum angle in radians along joint Z-axis.
-
#max1=(value) ⇒ Object
Set maximum angle in radians along joint Z-axis.
-
#max2 ⇒ Numeric
Get maximum angle in radians along joint X-axis.
-
#max2=(value) ⇒ Object
Set maximum angle in radians along joint X-axis.
-
#min1 ⇒ Numeric
Get minimum angle in radians along joint Z-axis.
-
#min1=(value) ⇒ Object
Set minimum angle in radians along joint Z-axis.
-
#min2 ⇒ Numeric
Get minimum angle in radians along joint X-axis.
-
#min2=(value) ⇒ Object
Set minimum angle in radians along joint X-axis.
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) ⇒ Universal
Create a universal joint.
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 19 def initialize(world, parent, pin_tra, group = nil) super(world, parent, pin_tra, group) MSPhysics::Newton::Universal.create(@address) MSPhysics::Newton::Universal.set_min1(@address, DEFAULT_MIN) MSPhysics::Newton::Universal.set_max1(@address, DEFAULT_MAX) MSPhysics::Newton::Universal.enable_limits1(@address, DEFAULT_LIMITS_ENABLED) MSPhysics::Newton::Universal.set_min2(@address, DEFAULT_MIN) MSPhysics::Newton::Universal.set_max2(@address, DEFAULT_MAX) MSPhysics::Newton::Universal.enable_limits2(@address, DEFAULT_LIMITS_ENABLED) MSPhysics::Newton::Universal.set_friction(@address, DEFAULT_FRICTION) MSPhysics::Newton::Universal.set_controller(@address, DEFAULT_CONTROLLER) end |
Instance Method Details
#controller ⇒ Numeric
Default controller value is 1.0.
The actual friction is friction * controller
.
Get magnitude of the angular friction.
160 161 162 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 160 def controller MSPhysics::Newton::Universal.get_controller(@address) end |
#controller=(value) ⇒ Object
Default controller value is 1.0.
The actual friction is friction * controller
.
Set magnitude of the angular friction.
168 169 170 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 168 def controller=(value) MSPhysics::Newton::Universal.set_controller(@address, value) end |
#cur_alpha1 ⇒ Numeric
Get current angular acceleration in radians per second per second along joint Z-axis.
47 48 49 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 47 def cur_alpha1 MSPhysics::Newton::Universal.get_cur_alpha1(@address) end |
#cur_alpha2 ⇒ Numeric
Get current angular acceleration in radians per second per second along joint X-axis.
102 103 104 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 102 def cur_alpha2 MSPhysics::Newton::Universal.get_cur_alpha2(@address) end |
#cur_angle1 ⇒ Numeric
Get current angle in radians along joint Z-axis.
34 35 36 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 34 def cur_angle1 MSPhysics::Newton::Universal.get_cur_angle1(@address) end |
#cur_angle2 ⇒ Numeric
Get current angle in radians along joint X-axis.
89 90 91 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 89 def cur_angle2 MSPhysics::Newton::Universal.get_cur_angle2(@address) end |
#cur_omega1 ⇒ Numeric
Get current angular velocity in radians per second along joint Z-axis.
40 41 42 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 40 def cur_omega1 MSPhysics::Newton::Universal.get_cur_omega1(@address) end |
#cur_omega2 ⇒ Numeric
Get current angular velocity in radians per second along joint X-axis.
95 96 97 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 95 def cur_omega2 MSPhysics::Newton::Universal.get_cur_omega2(@address) end |
#friction ⇒ Numeric
The actual friction is friction * controller
.
Get angular friction.
145 146 147 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 145 def friction MSPhysics::Newton::Universal.get_friction(@address) end |
#friction=(value) ⇒ Object
The actual friction is friction * controller
.
Set angular friction.
152 153 154 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 152 def friction=(value) MSPhysics::Newton::Universal.set_friction(@address, value) end |
#limits1_enabled=(state) ⇒ Object
Enable/disable min & max angle limits along joint Z-axis.
83 84 85 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 83 def limits1_enabled=(state) MSPhysics::Newton::Universal.enable_limits1(@address, state) end |
#limits1_enabled? ⇒ Boolean
Determine whether min & max angle limits along joint Z-axis are enabled.
77 78 79 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 77 def limits1_enabled? MSPhysics::Newton::Universal.limits1_enabled?(@address) end |
#limits2_enabled=(state) ⇒ Object
Enable/disable min & max angle limits along joint X-axis.
138 139 140 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 138 def limits2_enabled=(state) MSPhysics::Newton::Universal.enable_limits2(@address, state) end |
#limits2_enabled? ⇒ Boolean
Determine whether min & max angle limits along joint X-axis are enabled.
132 133 134 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 132 def limits2_enabled? MSPhysics::Newton::Universal.limits2_enabled?(@address) end |
#max1 ⇒ Numeric
Get maximum angle in radians along joint Z-axis.
65 66 67 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 65 def max1 MSPhysics::Newton::Universal.get_max1(@address) end |
#max1=(value) ⇒ Object
Set maximum angle in radians along joint Z-axis.
71 72 73 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 71 def max1=(value) MSPhysics::Newton::Universal.set_max1(@address, value) end |
#max2 ⇒ Numeric
Get maximum angle in radians along joint X-axis.
120 121 122 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 120 def max2 MSPhysics::Newton::Universal.get_max2(@address) end |
#max2=(value) ⇒ Object
Set maximum angle in radians along joint X-axis.
126 127 128 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 126 def max2=(value) MSPhysics::Newton::Universal.set_max2(@address, value) end |
#min1 ⇒ Numeric
Get minimum angle in radians along joint Z-axis.
53 54 55 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 53 def min1 MSPhysics::Newton::Universal.get_min1(@address) end |
#min1=(value) ⇒ Object
Set minimum angle in radians along joint Z-axis.
59 60 61 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 59 def min1=(value) MSPhysics::Newton::Universal.set_min1(@address, value) end |
#min2 ⇒ Numeric
Get minimum angle in radians along joint X-axis.
108 109 110 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 108 def min2 MSPhysics::Newton::Universal.get_min2(@address) end |
#min2=(value) ⇒ Object
Set minimum angle in radians along joint X-axis.
114 115 116 |
# File 'RubyExtension/MSPhysics/joint_universal.rb', line 114 def min2=(value) MSPhysics::Newton::Universal.set_min2(@address, value) end |