Class: MSPhysics::CurvySlider
- Defined in:
- RubyExtension/MSPhysics/joint_curvy_slider.rb
Overview
Constant Summary collapse
- DEFAULT_LINEAR_FRICTION =
0.0
- DEFAULT_ANGULAR_FRICTION =
0.0
- DEFAULT_ALIGNMENT_POWER =
0.0
- DEFAULT_CONTROLLER =
1.0
- DEFAULT_LOOP_ENABLED =
false
- DEFAULT_ALIGNMENT_ENABLED =
true
- DEFAULT_ROTATION_ENABLED =
true
Constants inherited from Joint
Joint::DEFAULT_BODIES_COLLIDABLE, Joint::DEFAULT_BREAKING_FORCE, Joint::DEFAULT_SOLVER_MODEL, Joint::DEFAULT_STIFFNESS
Instance Method Summary collapse
-
#add_point(position) ⇒ Integer
Append point to the curve.
-
#alignment_enabled=(state) ⇒ Object
Enable/disable alignment to curve.
-
#alignment_enabled? ⇒ Boolean
Determine whether the connected body is supposed to align with the direction of curve.
-
#alignment_power ⇒ Numeric
Get alignment power.
-
#alignment_power=(value) ⇒ Object
Set alignment power.
-
#angular_friction ⇒ Numeric
Get rotational friction.
-
#angular_friction=(value) ⇒ Object
Set rotational friction.
-
#clear ⇒ Integer
Remove all points that make up the curve.
-
#controller ⇒ Numeric
Get magnitude of the linear and angular friction.
-
#controller=(value) ⇒ Object
Set magnitude of the linear and angular friction.
-
#cur_acceleration ⇒ Numeric
Get current acceleration along the curve in meters per second per second.
-
#cur_normal_matrix ⇒ Geom::Transformation?
Get current normal matrix on the curve.
-
#cur_point ⇒ Geom::Point3d?
Get current point on the curve.
-
#cur_position ⇒ Numeric
Get current position along the curve in meters.
-
#cur_vector ⇒ Geom::Vector3d?
Get current vector on the curve.
-
#cur_velocity ⇒ Numeric
Get current velocity along the curve in meters per second.
-
#get_point_position(index) ⇒ Geom::Point3d?
Get point position by index.
-
#initialize(world, parent, pin_tra, group = nil) ⇒ CurvySlider
constructor
Create a CurvySlider joint.
-
#length ⇒ Numeric
Get curve length in meters.
-
#linear_friction ⇒ Numeric
Get movement friction.
-
#linear_friction=(value) ⇒ Object
Set movement friction.
-
#loop_enabled=(state) ⇒ Object
Enable/disable curve looping.
-
#loop_enabled? ⇒ Boolean
Determine whether curve looping is enabled.
-
#normal_matrices ⇒ Array<Geom::Transformation>
Get all normal matrices of the curve.
-
#normal_matrix_at_point(point) ⇒ Array<(Geom::Transformation, Numeric)>?
Get normal matrix corresponding to a particular point on or beside the curve.
-
#normal_matrix_at_position(distance) ⇒ Geom::Transformation?
Get normal matrix corresponding to a particular distance on the curve.
-
#points ⇒ Array<Geom::Point3d>
Get all points the curve is associated of.
-
#points_size ⇒ Integer
Get the number of points that make up the curve.
-
#remove_point(index) ⇒ Boolean
Remove point from curve at index.
-
#rotation_enabled=(state) ⇒ Object
Enable/disable rotation along the current point on curve.
-
#rotation_enabled? ⇒ Boolean
Determine whether the rotation along the current point on curve is enabled.
-
#set_point_position(index, position) ⇒ Boolean
Set point position by index.
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) ⇒ CurvySlider
Create a CurvySlider joint.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 21 def initialize(world, parent, pin_tra, group = nil) super(world, parent, pin_tra, group) MSPhysics::Newton::CurvySlider.create(@address) MSPhysics::Newton::CurvySlider.set_linear_friction(@address, DEFAULT_LINEAR_FRICTION) MSPhysics::Newton::CurvySlider.set_angular_friction(@address, DEFAULT_ANGULAR_FRICTION) MSPhysics::Newton::CurvySlider.set_alignment_power(@address, DEFAULT_ALIGNMENT_POWER) MSPhysics::Newton::CurvySlider.set_controller(@address, DEFAULT_CONTROLLER) MSPhysics::Newton::CurvySlider.enable_loop(@address, DEFAULT_LOOP_ENABLED) MSPhysics::Newton::CurvySlider.enable_alignment(@address, DEFAULT_ALIGNMENT_ENABLED) MSPhysics::Newton::CurvySlider.enable_rotation(@address, DEFAULT_ROTATION_ENABLED) end |
Instance Method Details
#add_point(position) ⇒ Integer
Append point to the curve.
36 37 38 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 36 def add_point(position) MSPhysics::Newton::CurvySlider.add_point(@address, position) end |
#alignment_enabled=(state) ⇒ Object
Enable/disable alignment to curve.
183 184 185 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 183 def alignment_enabled=(state) MSPhysics::Newton::CurvySlider.enable_alignment(@address, state) end |
#alignment_enabled? ⇒ Boolean
Determine whether the connected body is supposed to align with the direction of curve.
177 178 179 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 177 def alignment_enabled? MSPhysics::Newton::CurvySlider.alignment_enabled?(@address) end |
#alignment_power ⇒ Numeric
Has an effect only if alignment is enabled.
Get alignment power.
190 191 192 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 190 def alignment_power MSPhysics::Newton::CurvySlider.get_alignment_power(@address) end |
#alignment_power=(value) ⇒ Object
Has an effect only if alignment is enabled.
Set alignment power.
198 199 200 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 198 def alignment_power=(value) MSPhysics::Newton::CurvySlider.set_alignment_power(@address, value) end |
#angular_friction ⇒ Numeric
Get rotational friction.
140 141 142 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 140 def angular_friction MSPhysics::Newton::CurvySlider.get_angular_friction(@address) end |
#angular_friction=(value) ⇒ Object
Set rotational friction.
146 147 148 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 146 def angular_friction=(value) MSPhysics::Newton::CurvySlider.set_angular_friction(@address, value) end |
#clear ⇒ Integer
Remove all points that make up the curve.
61 62 63 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 61 def clear MSPhysics::Newton::CurvySlider.clear_points(@address) end |
#controller ⇒ Numeric
Get magnitude of the linear and angular friction.
152 153 154 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 152 def controller MSPhysics::Newton::CurvySlider.get_controller(@address) end |
#controller=(value) ⇒ Object
Set magnitude of the linear and angular friction.
158 159 160 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 158 def controller=(value) MSPhysics::Newton::CurvySlider.set_controller(@address, value) end |
#cur_acceleration ⇒ Numeric
Get current acceleration along the curve in meters per second per second.
101 102 103 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 101 def cur_acceleration MSPhysics::Newton::CurvySlider.get_cur_acceleration(@address) end |
#cur_normal_matrix ⇒ Geom::Transformation?
Get current normal matrix on the curve.
122 123 124 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 122 def cur_normal_matrix MSPhysics::Newton::CurvySlider.get_cur_normal_matrix(@address) end |
#cur_point ⇒ Geom::Point3d?
Get current point on the curve.
108 109 110 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 108 def cur_point MSPhysics::Newton::CurvySlider.get_cur_point(@address) end |
#cur_position ⇒ Numeric
Get current position along the curve in meters.
89 90 91 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 89 def cur_position MSPhysics::Newton::CurvySlider.get_cur_position(@address) end |
#cur_vector ⇒ Geom::Vector3d?
Get current vector on the curve.
115 116 117 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 115 def cur_vector MSPhysics::Newton::CurvySlider.get_cur_vector(@address) end |
#cur_velocity ⇒ Numeric
Get current velocity along the curve in meters per second.
95 96 97 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 95 def cur_velocity MSPhysics::Newton::CurvySlider.get_cur_velocity(@address) end |
#get_point_position(index) ⇒ Geom::Point3d?
Get point position by index.
75 76 77 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 75 def get_point_position(index) MSPhysics::Newton::CurvySlider.get_point_position(@address, index) end |
#length ⇒ Numeric
Get curve length in meters.
67 68 69 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 67 def length MSPhysics::Newton::CurvySlider.get_length(@address) end |
#linear_friction ⇒ Numeric
Get movement friction.
128 129 130 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 128 def linear_friction MSPhysics::Newton::CurvySlider.get_linear_friction(@address) end |
#linear_friction=(value) ⇒ Object
Set movement friction.
134 135 136 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 134 def linear_friction=(value) MSPhysics::Newton::CurvySlider.set_linear_friction(@address, value) end |
#loop_enabled=(state) ⇒ Object
Enable/disable curve looping.
170 171 172 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 170 def loop_enabled=(state) MSPhysics::Newton::CurvySlider.enable_loop(@address, state) end |
#loop_enabled? ⇒ Boolean
Determine whether curve looping is enabled.
164 165 166 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 164 def loop_enabled? MSPhysics::Newton::CurvySlider.loop_enabled?(@address) end |
#normal_matrices ⇒ Array<Geom::Transformation>
Get all normal matrices of the curve.
235 236 237 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 235 def normal_matrices MSPhysics::Newton::CurvySlider.get_normal_matrices(@address) end |
#normal_matrix_at_point(point) ⇒ Array<(Geom::Transformation, Numeric)>?
Get normal matrix corresponding to a particular point on or beside the curve.
229 230 231 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 229 def normal_matrix_at_point(point) MSPhysics::Newton::CurvySlider.get_normal_martix_at_point(@address, point) end |
#normal_matrix_at_position(distance) ⇒ Geom::Transformation?
Get normal matrix corresponding to a particular distance on the curve.
219 220 221 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 219 def normal_matrix_at_position(distance) MSPhysics::Newton::CurvySlider.get_normal_martix_at_position(@address, distance) end |
#points ⇒ Array<Geom::Point3d>
Get all points the curve is associated of.
49 50 51 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 49 def points MSPhysics::Newton::CurvySlider.get_points(@address) end |
#points_size ⇒ Integer
Get the number of points that make up the curve.
55 56 57 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 55 def points_size MSPhysics::Newton::CurvySlider.get_points_size(@address) end |
#remove_point(index) ⇒ Boolean
Remove point from curve at index.
43 44 45 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 43 def remove_point(index) MSPhysics::Newton::CurvySlider.remove_point(@address, index) end |
#rotation_enabled=(state) ⇒ Object
Enable/disable rotation along the current point on curve.
211 212 213 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 211 def rotation_enabled=(state) MSPhysics::Newton::CurvySlider.enable_rotation(@address, state) end |
#rotation_enabled? ⇒ Boolean
Determine whether the rotation along the current point on curve is enabled.
205 206 207 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 205 def rotation_enabled? MSPhysics::Newton::CurvySlider.rotation_enabled?(@address) end |
#set_point_position(index, position) ⇒ Boolean
Set point position by index.
83 84 85 |
# File 'RubyExtension/MSPhysics/joint_curvy_slider.rb', line 83 def set_point_position(index, position) MSPhysics::Newton::CurvySlider.set_point_position(@address, index, position) end |