Class: MSPhysics::Corkscrew
- Defined in:
- RubyExtension/MSPhysics/joint_corkscrew.rb
Overview
Constant Summary collapse
- DEFAULT_MIN_POSITION =
-10.0
- DEFAULT_MAX_POSITION =
10.0
- DEFAULT_MIN_ANGLE =
-180.0.degrees
- DEFAULT_MAX_ANGLE =
180.0.degrees
- DEFAULT_LINEAR_LIMITS_ENABLED =
false
- DEFAULT_ANGULAR_LIMITS_ENABLED =
false
- DEFAULT_LINEAR_FRICTION =
0.0
- DEFAULT_ANGULAR_FRICTION =
0.0
Constants inherited from Joint
Joint::DEFAULT_BODIES_COLLIDABLE, Joint::DEFAULT_BREAKING_FORCE, Joint::DEFAULT_SOLVER_MODEL, Joint::DEFAULT_STIFFNESS
Instance Method Summary collapse
-
#angular_friction ⇒ Numeric
Get rotational friction.
-
#angular_friction=(value) ⇒ Object
Set rotational friction.
-
#angular_limits_enabled=(state) ⇒ Object
Enable/disable min & max angle limits.
-
#angular_limits_enabled? ⇒ Boolean
Determine whether min & max angle limits are enabled.
-
#cur_acceleration ⇒ Numeric
Get current linear acceleration in meters per second per second.
-
#cur_alpha ⇒ Numeric
Get current angular acceleration in radians per second per second.
-
#cur_angle ⇒ Numeric
Get current angle in radians.
-
#cur_omega ⇒ Numeric
Get current omega in radians per second.
-
#cur_position ⇒ Numeric
Get current position in meters.
-
#cur_velocity ⇒ Numeric
Get current velocity in meters per second.
-
#initialize(world, parent, pin_tra, group = nil) ⇒ Corkscrew
constructor
Create a corkscrew joint.
-
#linear_friction ⇒ Numeric
Get movement friction.
-
#linear_friction=(value) ⇒ Object
Set movement friction.
-
#linear_limits_enabled=(state) ⇒ Object
Enable/disable min and max position limits.
-
#linear_limits_enabled? ⇒ Boolean
Determine whether min and max position limits are enabled.
-
#max_angle ⇒ Numeric
Get maximum angle in radians.
-
#max_angle=(value) ⇒ Object
Set maximum angle in radians.
-
#max_position ⇒ Numeric
Get maximum position in meters.
-
#max_position=(value) ⇒ Object
Set maximum position in meters.
-
#min_angle ⇒ Numeric
Get minimum angle in radians.
-
#min_angle=(value) ⇒ Object
Set minimum angle in radians.
-
#min_position ⇒ Numeric
Get minimum position in meters.
-
#min_position=(value) ⇒ Object
Set minimum position in meters.
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) ⇒ Corkscrew
Create a corkscrew joint.
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 22 def initialize(world, parent, pin_tra, group = nil) super(world, parent, pin_tra, group) MSPhysics::Newton::Corkscrew.create(@address) MSPhysics::Newton::Corkscrew.set_min_position(@address, DEFAULT_MIN_POSITION) MSPhysics::Newton::Corkscrew.set_max_position(@address, DEFAULT_MAX_POSITION) MSPhysics::Newton::Corkscrew.enable_linear_limits(@address, DEFAULT_LINEAR_LIMITS_ENABLED) MSPhysics::Newton::Corkscrew.set_linear_friction(@address, DEFAULT_LINEAR_FRICTION) MSPhysics::Newton::Corkscrew.set_min_angle(@address, DEFAULT_MIN_ANGLE) MSPhysics::Newton::Corkscrew.set_max_angle(@address, DEFAULT_MAX_ANGLE) MSPhysics::Newton::Corkscrew.enable_angular_limits(@address, DEFAULT_ANGULAR_LIMITS_ENABLED) MSPhysics::Newton::Corkscrew.set_angular_friction(@address, DEFAULT_ANGULAR_FRICTION) end |
Instance Method Details
#angular_friction ⇒ Numeric
Get rotational friction.
156 157 158 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 156 def angular_friction MSPhysics::Newton::Corkscrew.get_angular_friction(@address) end |
#angular_friction=(value) ⇒ Object
Set rotational friction.
162 163 164 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 162 def angular_friction=(value) MSPhysics::Newton::Corkscrew.set_angular_friction(@address, value) end |
#angular_limits_enabled=(state) ⇒ Object
Enable/disable min & max angle limits.
150 151 152 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 150 def angular_limits_enabled=(state) MSPhysics::Newton::Corkscrew.enable_angular_limits(@address, state) end |
#angular_limits_enabled? ⇒ Boolean
Determine whether min & max angle limits are enabled.
144 145 146 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 144 def angular_limits_enabled? MSPhysics::Newton::Corkscrew.angular_limits_enabled?(@address) end |
#cur_acceleration ⇒ Numeric
Get current linear acceleration in meters per second per second.
49 50 51 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 49 def cur_acceleration MSPhysics::Newton::Corkscrew.get_cur_acceleration(@address) end |
#cur_alpha ⇒ Numeric
Get current angular acceleration in radians per second per second.
114 115 116 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 114 def cur_alpha MSPhysics::Newton::Corkscrew.get_cur_alpha(@address) end |
#cur_angle ⇒ Numeric
Get current angle in radians.
102 103 104 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 102 def cur_angle MSPhysics::Newton::Corkscrew.get_cur_angle(@address) end |
#cur_omega ⇒ Numeric
Get current omega in radians per second.
108 109 110 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 108 def cur_omega MSPhysics::Newton::Corkscrew.get_cur_omega(@address) end |
#cur_position ⇒ Numeric
Get current position in meters.
37 38 39 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 37 def cur_position MSPhysics::Newton::Corkscrew.get_cur_position(@address) end |
#cur_velocity ⇒ Numeric
Get current velocity in meters per second.
43 44 45 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 43 def cur_velocity MSPhysics::Newton::Corkscrew.get_cur_velocity(@address) end |
#linear_friction ⇒ Numeric
Get movement friction.
90 91 92 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 90 def linear_friction MSPhysics::Newton::Corkscrew.get_linear_friction(@address) end |
#linear_friction=(value) ⇒ Object
Set movement friction.
96 97 98 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 96 def linear_friction=(value) MSPhysics::Newton::Corkscrew.set_linear_friction(@address, value) end |
#linear_limits_enabled=(state) ⇒ Object
Enable/disable min and max position limits.
84 85 86 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 84 def linear_limits_enabled=(state) MSPhysics::Newton::Corkscrew.enable_linear_limits(@address, state) end |
#linear_limits_enabled? ⇒ Boolean
Determine whether min and max position limits are enabled.
78 79 80 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 78 def linear_limits_enabled? MSPhysics::Newton::Corkscrew.linear_limits_enabled?(@address) end |
#max_angle ⇒ Numeric
Get maximum angle in radians.
132 133 134 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 132 def max_angle MSPhysics::Newton::Corkscrew.get_max_angle(@address) end |
#max_angle=(value) ⇒ Object
Set maximum angle in radians.
138 139 140 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 138 def max_angle=(value) MSPhysics::Newton::Corkscrew.set_max_angle(@address, value) end |
#max_position ⇒ Numeric
Get maximum position in meters.
67 68 69 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 67 def max_position MSPhysics::Newton::Corkscrew.get_max_position(@address) end |
#max_position=(value) ⇒ Object
Set maximum position in meters.
72 73 74 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 72 def max_position=(value) MSPhysics::Newton::Corkscrew.set_max_position(@address, value) end |
#min_angle ⇒ Numeric
Get minimum angle in radians.
120 121 122 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 120 def min_angle MSPhysics::Newton::Corkscrew.get_min_angle(@address) end |
#min_angle=(value) ⇒ Object
Set minimum angle in radians.
126 127 128 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 126 def min_angle=(value) MSPhysics::Newton::Corkscrew.set_min_angle(@address, value) end |
#min_position ⇒ Numeric
Get minimum position in meters.
55 56 57 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 55 def min_position MSPhysics::Newton::Corkscrew.get_min_position(@address) end |
#min_position=(value) ⇒ Object
Set minimum position in meters.
61 62 63 |
# File 'RubyExtension/MSPhysics/joint_corkscrew.rb', line 61 def min_position=(value) MSPhysics::Newton::Corkscrew.set_min_position(@address, value) end |