Class: MSPhysics::Slider
- Defined in:
- RubyExtension/MSPhysics/joint_slider.rb
Overview
Constant Summary collapse
- DEFAULT_MIN =
-10.0
- DEFAULT_MAX =
10.0
- 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 slider controller, the magnitude of the linear friction.
-
#controller=(value) ⇒ Object
Set slider controller, the magnitude of the linear friction.
-
#cur_acceleration ⇒ Numeric
Get current acceleration in meters per second per second.
-
#cur_position ⇒ Numeric
Get current position in meters.
-
#cur_velocity ⇒ Numeric
Get current velocity in meters per second.
-
#friction ⇒ Numeric
Get movement friction.
-
#friction=(value) ⇒ Object
Set movement friction.
-
#initialize(world, parent, pin_tra, group = nil) ⇒ Slider
constructor
Create a slider 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.
-
#max=(value) ⇒ Object
Set maximum position in meters.
-
#min ⇒ Numeric
Get minimum position in meters.
-
#min=(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) ⇒ Slider
Create a slider joint.
19 20 21 22 23 24 25 26 27 |
# File 'RubyExtension/MSPhysics/joint_slider.rb', line 19 def initialize(world, parent, pin_tra, group = nil) super(world, parent, pin_tra, group) MSPhysics::Newton::Slider.create(@address) MSPhysics::Newton::Slider.set_min(@address, DEFAULT_MIN) MSPhysics::Newton::Slider.set_max(@address, DEFAULT_MAX) MSPhysics::Newton::Slider.enable_limits(@address, DEFAULT_LIMITS_ENABLED) MSPhysics::Newton::Slider.set_friction(@address, DEFAULT_FRICTION) MSPhysics::Newton::Slider.set_controller(@address, DEFAULT_CONTROLLER) end |
Instance Method Details
#controller ⇒ Numeric
Get slider controller, the magnitude of the linear friction.
96 97 98 |
# File 'RubyExtension/MSPhysics/joint_slider.rb', line 96 def controller MSPhysics::Newton::Slider.get_controller(@address) end |
#controller=(value) ⇒ Object
Set slider controller, the magnitude of the linear friction.
102 103 104 |
# File 'RubyExtension/MSPhysics/joint_slider.rb', line 102 def controller=(value) MSPhysics::Newton::Slider.set_controller(@address, value) end |
#cur_acceleration ⇒ Numeric
Get current acceleration in meters per second per second.
43 44 45 |
# File 'RubyExtension/MSPhysics/joint_slider.rb', line 43 def cur_acceleration MSPhysics::Newton::Slider.get_cur_acceleration(@address) end |
#cur_position ⇒ Numeric
Get current position in meters.
31 32 33 |
# File 'RubyExtension/MSPhysics/joint_slider.rb', line 31 def cur_position MSPhysics::Newton::Slider.get_cur_position(@address) end |
#cur_velocity ⇒ Numeric
Get current velocity in meters per second.
37 38 39 |
# File 'RubyExtension/MSPhysics/joint_slider.rb', line 37 def cur_velocity MSPhysics::Newton::Slider.get_cur_velocity(@address) end |
#friction ⇒ Numeric
Get movement friction.
84 85 86 |
# File 'RubyExtension/MSPhysics/joint_slider.rb', line 84 def friction MSPhysics::Newton::Slider.get_friction(@address) end |
#friction=(value) ⇒ Object
Set movement friction.
90 91 92 |
# File 'RubyExtension/MSPhysics/joint_slider.rb', line 90 def friction=(value) MSPhysics::Newton::Slider.set_friction(@address, value) end |
#limits_enabled=(state) ⇒ Object
Enable/disable min and max position limits.
78 79 80 |
# File 'RubyExtension/MSPhysics/joint_slider.rb', line 78 def limits_enabled=(state) MSPhysics::Newton::Slider.enable_limits(@address, state) end |
#limits_enabled? ⇒ Boolean
Determine whether min and max position limits are enabled.
72 73 74 |
# File 'RubyExtension/MSPhysics/joint_slider.rb', line 72 def limits_enabled? MSPhysics::Newton::Slider.limits_enabled?(@address) end |
#max ⇒ Numeric
Get maximum position in meters.
61 62 63 |
# File 'RubyExtension/MSPhysics/joint_slider.rb', line 61 def max MSPhysics::Newton::Slider.get_max(@address) end |
#max=(value) ⇒ Object
Set maximum position in meters.
66 67 68 |
# File 'RubyExtension/MSPhysics/joint_slider.rb', line 66 def max=(value) MSPhysics::Newton::Slider.set_max(@address, value) end |
#min ⇒ Numeric
Get minimum position in meters.
49 50 51 |
# File 'RubyExtension/MSPhysics/joint_slider.rb', line 49 def min MSPhysics::Newton::Slider.get_min(@address) end |
#min=(value) ⇒ Object
Set minimum position in meters.
55 56 57 |
# File 'RubyExtension/MSPhysics/joint_slider.rb', line 55 def min=(value) MSPhysics::Newton::Slider.set_min(@address, value) end |