Class: MSPhysics::BallAndSocket
- Defined in:
- RubyExtension/MSPhysics/joint_ball_and_socket.rb
Overview
Constant Summary collapse
- DEFAULT_MAX_CONE_ANGLE =
30.0.degrees
- DEFAULT_CONE_LIMITS_ENABLED =
false
- DEFAULT_MIN_TWIST_ANGLE =
-180.0.degrees
- DEFAULT_MAX_TWIST_ANGLE =
180.0.degrees
- DEFAULT_TWIST_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
-
#cone_limits_enabled=(state) ⇒ Object
Enable/disable cone angle limits.
-
#cone_limits_enabled? ⇒ Boolean
Determine whether cone angle limits are enabled.
-
#controller ⇒ Numeric
Get magnitude of the angular friction.
-
#controller=(value) ⇒ Object
Set magnitude of the angular friction.
-
#cur_cone_angle ⇒ Numeric
Get current cone angle in radians.
-
#cur_twist_alpha ⇒ Numeric
Get current twist acceleration in radians per second per second.
-
#cur_twist_angle ⇒ Numeric
Get current twist angle in radians.
-
#cur_twist_omega ⇒ Numeric
Get current twist omega in radians per second.
-
#friction ⇒ Numeric
Get angular friction.
-
#friction=(value) ⇒ Object
Set angular friction.
-
#initialize(world, parent, pin_tra, group = nil) ⇒ BallAndSocket
constructor
Create a ball & socket joint.
-
#max_cone_angle ⇒ Numeric
Get maximum cone angle in radians.
-
#max_cone_angle=(angle) ⇒ Object
Set maximum cone angle in radians.
-
#max_twist_angle ⇒ Numeric
Get maximum twist angle in radians.
-
#max_twist_angle=(angle) ⇒ Object
Set maximum twist angle in radians.
-
#min_twist_angle ⇒ Numeric
Get minimum twist angle in radians.
-
#min_twist_angle=(angle) ⇒ Object
Set minimum twist angle in radians.
-
#twist_limits_enabled=(state) ⇒ Object
Enable/disable twist angle limits.
-
#twist_limits_enabled? ⇒ Boolean
Determine whether twist angle limits are enabled.
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) ⇒ BallAndSocket
Create a ball & socket joint.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 21 def initialize(world, parent, pin_tra, group = nil) super(world, parent, pin_tra, group) MSPhysics::Newton::BallAndSocket.create(@address) MSPhysics::Newton::BallAndSocket.set_max_cone_angle(@address, DEFAULT_MAX_CONE_ANGLE) MSPhysics::Newton::BallAndSocket.enable_cone_limits(@address, DEFAULT_CONE_LIMITS_ENABLED) MSPhysics::Newton::BallAndSocket.set_min_twist_angle(@address, DEFAULT_MIN_TWIST_ANGLE) MSPhysics::Newton::BallAndSocket.set_max_twist_angle(@address, DEFAULT_MAX_TWIST_ANGLE) MSPhysics::Newton::BallAndSocket.enable_twist_limits(@address, DEFAULT_TWIST_LIMITS_ENABLED) MSPhysics::Newton::BallAndSocket.set_friction(@address, DEFAULT_FRICTION) MSPhysics::Newton::BallAndSocket.set_controller(@address, DEFAULT_CONTROLLER) end |
Instance Method Details
#cone_limits_enabled=(state) ⇒ Object
Enable/disable cone angle limits.
53 54 55 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 53 def cone_limits_enabled=(state) MSPhysics::Newton::BallAndSocket.enable_cone_limits(@address, state) end |
#cone_limits_enabled? ⇒ Boolean
Determine whether cone angle limits are enabled.
47 48 49 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 47 def cone_limits_enabled? MSPhysics::Newton::BallAndSocket.cone_limits_enabled?(@address) end |
#controller ⇒ Numeric
Default controller value is 1.0.
The actual friction is friction * controller
.
Get magnitude of the angular friction.
135 136 137 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 135 def controller MSPhysics::Newton::BallAndSocket.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.
143 144 145 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 143 def controller=(value) MSPhysics::Newton::BallAndSocket.set_controller(@address, value) end |
#cur_cone_angle ⇒ Numeric
Get current cone angle in radians.
95 96 97 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 95 def cur_cone_angle MSPhysics::Newton::BallAndSocket.get_cur_cone_angle(@address) end |
#cur_twist_alpha ⇒ Numeric
Get current twist acceleration in radians per second per second.
113 114 115 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 113 def cur_twist_alpha MSPhysics::Newton::BallAndSocket.get_cur_twist_alpha(@address) end |
#cur_twist_angle ⇒ Numeric
Get current twist angle in radians.
101 102 103 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 101 def cur_twist_angle MSPhysics::Newton::BallAndSocket.get_cur_twist_angle(@address) end |
#cur_twist_omega ⇒ Numeric
Get current twist omega in radians per second.
107 108 109 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 107 def cur_twist_omega MSPhysics::Newton::BallAndSocket.get_cur_twist_omega(@address) end |
#friction ⇒ Numeric
The actual friction is friction * controller
.
Get angular friction.
120 121 122 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 120 def friction MSPhysics::Newton::BallAndSocket.get_friction(@address) end |
#friction=(value) ⇒ Object
The actual friction is friction * controller
.
Set angular friction.
127 128 129 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 127 def friction=(value) MSPhysics::Newton::BallAndSocket.set_friction(@address, value) end |
#max_cone_angle ⇒ Numeric
Get maximum cone angle in radians.
35 36 37 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 35 def max_cone_angle MSPhysics::Newton::BallAndSocket.get_max_cone_angle(@address) end |
#max_cone_angle=(angle) ⇒ Object
Set maximum cone angle in radians.
41 42 43 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 41 def max_cone_angle=(angle) MSPhysics::Newton::BallAndSocket.set_max_cone_angle(@address, angle) end |
#max_twist_angle ⇒ Numeric
Get maximum twist angle in radians.
71 72 73 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 71 def max_twist_angle MSPhysics::Newton::BallAndSocket.get_max_twist_angle(@address) end |
#max_twist_angle=(angle) ⇒ Object
Set maximum twist angle in radians.
77 78 79 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 77 def max_twist_angle=(angle) MSPhysics::Newton::BallAndSocket.set_max_twist_angle(@address, angle) end |
#min_twist_angle ⇒ Numeric
Get minimum twist angle in radians.
59 60 61 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 59 def min_twist_angle MSPhysics::Newton::BallAndSocket.get_min_twist_angle(@address) end |
#min_twist_angle=(angle) ⇒ Object
Set minimum twist angle in radians.
65 66 67 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 65 def min_twist_angle=(angle) MSPhysics::Newton::BallAndSocket.set_min_twist_angle(@address, angle) end |
#twist_limits_enabled=(state) ⇒ Object
Enable/disable twist angle limits.
89 90 91 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 89 def twist_limits_enabled=(state) MSPhysics::Newton::BallAndSocket.enable_twist_limits(@address, state) end |
#twist_limits_enabled? ⇒ Boolean
Determine whether twist angle limits are enabled.
83 84 85 |
# File 'RubyExtension/MSPhysics/joint_ball_and_socket.rb', line 83 def twist_limits_enabled? MSPhysics::Newton::BallAndSocket.twist_limits_enabled?(@address) end |