29 #ifndef PHYSICS_JOINT_H 30 #define PHYSICS_JOINT_H 32 #include "scene/3d/spatial.h" 33 #include "scene/3d/physics_body.h" 48 bool exclude_from_collision;
53 void _update_joint(
bool p_only_free=
false);
55 void _notification(
int p_what);
59 static void _bind_methods();
62 void set_node_a(
const NodePath& p_node_a);
65 void set_node_b(
const NodePath& p_node_b);
68 void set_solver_priority(
int p_priority);
69 int get_solver_priority()
const;
71 void set_exclude_nodes_from_collision(
bool p_enable);
72 bool get_exclude_nodes_from_collision()
const;
74 RID get_joint()
const {
return joint; }
88 PARAM_BIAS=PhysicsServer::PIN_JOINT_BIAS,
89 PARAM_DAMPING=PhysicsServer::PIN_JOINT_DAMPING,
90 PARAM_IMPULSE_CLAMP=PhysicsServer::PIN_JOINT_IMPULSE_CLAMP
97 static void _bind_methods();
100 void set_param(Param p_param,
float p_value);
101 float get_param(Param p_param)
const;
106 VARIANT_ENUM_CAST(PinJoint::Param);
115 PARAM_BIAS=PhysicsServer::HINGE_JOINT_BIAS,
116 PARAM_LIMIT_UPPER=PhysicsServer::HINGE_JOINT_LIMIT_UPPER,
117 PARAM_LIMIT_LOWER=PhysicsServer::HINGE_JOINT_LIMIT_LOWER,
118 PARAM_LIMIT_BIAS=PhysicsServer::HINGE_JOINT_LIMIT_BIAS,
119 PARAM_LIMIT_SOFTNESS=PhysicsServer::HINGE_JOINT_LIMIT_SOFTNESS,
120 PARAM_LIMIT_RELAXATION=PhysicsServer::HINGE_JOINT_LIMIT_RELAXATION,
121 PARAM_MOTOR_TARGET_VELOCITY=PhysicsServer::HINGE_JOINT_MOTOR_TARGET_VELOCITY,
122 PARAM_MOTOR_MAX_IMPULSE=PhysicsServer::HINGE_JOINT_MOTOR_MAX_IMPULSE,
123 PARAM_MAX=PhysicsServer::HINGE_JOINT_MAX
127 FLAG_USE_LIMIT=PhysicsServer::HINGE_JOINT_FLAG_USE_LIMIT,
128 FLAG_ENABLE_MOTOR=PhysicsServer::HINGE_JOINT_FLAG_ENABLE_MOTOR,
129 FLAG_MAX=PhysicsServer::HINGE_JOINT_FLAG_MAX
136 float params[PARAM_MAX];
137 bool flags[FLAG_MAX];
139 static void _bind_methods();
141 void _set_upper_limit(
float p_limit);
142 float _get_upper_limit()
const;
144 void _set_lower_limit(
float p_limit);
145 float _get_lower_limit()
const;
149 void set_param(Param p_param,
float p_value);
150 float get_param(Param p_param)
const;
152 void set_flag(Flag p_flag,
bool p_value);
153 bool get_flag(Flag p_flag)
const;
158 VARIANT_ENUM_CAST(HingeJoint::Param);
159 VARIANT_ENUM_CAST(HingeJoint::Flag);
168 PARAM_LINEAR_LIMIT_UPPER=PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_UPPER,
169 PARAM_LINEAR_LIMIT_LOWER=PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_LOWER,
170 PARAM_LINEAR_LIMIT_SOFTNESS=PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS,
171 PARAM_LINEAR_LIMIT_RESTITUTION=PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION,
172 PARAM_LINEAR_LIMIT_DAMPING=PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_DAMPING,
173 PARAM_LINEAR_MOTION_SOFTNESS=PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_SOFTNESS,
174 PARAM_LINEAR_MOTION_RESTITUTION=PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_RESTITUTION,
175 PARAM_LINEAR_MOTION_DAMPING=PhysicsServer::SLIDER_JOINT_LINEAR_MOTION_DAMPING,
176 PARAM_LINEAR_ORTHOGONAL_SOFTNESS=PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_SOFTNESS,
177 PARAM_LINEAR_ORTHOGONAL_RESTITUTION=PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_RESTITUTION,
178 PARAM_LINEAR_ORTHOGONAL_DAMPING=PhysicsServer::SLIDER_JOINT_LINEAR_ORTHOGONAL_DAMPING,
180 PARAM_ANGULAR_LIMIT_UPPER=PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_UPPER,
181 PARAM_ANGULAR_LIMIT_LOWER=PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_LOWER,
182 PARAM_ANGULAR_LIMIT_SOFTNESS=PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS,
183 PARAM_ANGULAR_LIMIT_RESTITUTION=PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_RESTITUTION,
184 PARAM_ANGULAR_LIMIT_DAMPING=PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING,
185 PARAM_ANGULAR_MOTION_SOFTNESS=PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_SOFTNESS,
186 PARAM_ANGULAR_MOTION_RESTITUTION=PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_RESTITUTION,
187 PARAM_ANGULAR_MOTION_DAMPING=PhysicsServer::SLIDER_JOINT_ANGULAR_MOTION_DAMPING,
188 PARAM_ANGULAR_ORTHOGONAL_SOFTNESS=PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_SOFTNESS,
189 PARAM_ANGULAR_ORTHOGONAL_RESTITUTION=PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_RESTITUTION,
190 PARAM_ANGULAR_ORTHOGONAL_DAMPING=PhysicsServer::SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING,
191 PARAM_MAX=PhysicsServer::SLIDER_JOINT_MAX
199 void _set_upper_limit_angular(
float p_limit_angular);
200 float _get_upper_limit_angular()
const;
202 void _set_lower_limit_angular(
float p_limit_angular);
203 float _get_lower_limit_angular()
const;
205 float params[PARAM_MAX];
207 static void _bind_methods();
210 void set_param(Param p_param,
float p_value);
211 float get_param(Param p_param)
const;
217 VARIANT_ENUM_CAST(SliderJoint::Param);
240 void _set_swing_span(
float p_limit_angular);
241 float _get_swing_span()
const;
243 void _set_twist_span(
float p_limit_angular);
244 float _get_twist_span()
const;
246 float params[PARAM_MAX];
248 static void _bind_methods();
251 void set_param(Param p_param,
float p_value);
252 float get_param(Param p_param)
const;
258 VARIANT_ENUM_CAST(ConeTwistJoint::Param);
268 PARAM_LINEAR_LOWER_LIMIT=PhysicsServer::G6DOF_JOINT_LINEAR_LOWER_LIMIT,
269 PARAM_LINEAR_UPPER_LIMIT=PhysicsServer::G6DOF_JOINT_LINEAR_UPPER_LIMIT,
270 PARAM_LINEAR_LIMIT_SOFTNESS=PhysicsServer::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS,
271 PARAM_LINEAR_RESTITUTION=PhysicsServer::G6DOF_JOINT_LINEAR_RESTITUTION,
272 PARAM_LINEAR_DAMPING=PhysicsServer::G6DOF_JOINT_LINEAR_DAMPING,
273 PARAM_ANGULAR_LOWER_LIMIT=PhysicsServer::G6DOF_JOINT_ANGULAR_LOWER_LIMIT,
274 PARAM_ANGULAR_UPPER_LIMIT=PhysicsServer::G6DOF_JOINT_ANGULAR_UPPER_LIMIT,
275 PARAM_ANGULAR_LIMIT_SOFTNESS=PhysicsServer::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS,
276 PARAM_ANGULAR_DAMPING=PhysicsServer::G6DOF_JOINT_ANGULAR_DAMPING,
277 PARAM_ANGULAR_RESTITUTION=PhysicsServer::G6DOF_JOINT_ANGULAR_RESTITUTION,
278 PARAM_ANGULAR_FORCE_LIMIT=PhysicsServer::G6DOF_JOINT_ANGULAR_FORCE_LIMIT,
279 PARAM_ANGULAR_ERP=PhysicsServer::G6DOF_JOINT_ANGULAR_ERP,
280 PARAM_ANGULAR_MOTOR_TARGET_VELOCITY=PhysicsServer::G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY,
281 PARAM_ANGULAR_MOTOR_FORCE_LIMIT=PhysicsServer::G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT,
282 PARAM_MAX=PhysicsServer::G6DOF_JOINT_MAX,
286 FLAG_ENABLE_LINEAR_LIMIT=PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT,
287 FLAG_ENABLE_ANGULAR_LIMIT=PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT,
288 FLAG_ENABLE_MOTOR=PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_MOTOR,
289 FLAG_MAX=PhysicsServer::G6DOF_JOINT_FLAG_MAX
296 void _set_angular_hi_limit_x(
float p_limit_angular);
297 float _get_angular_hi_limit_x()
const;
299 void _set_angular_hi_limit_y(
float p_limit_angular);
300 float _get_angular_hi_limit_y()
const;
302 void _set_angular_hi_limit_z(
float p_limit_angular);
303 float _get_angular_hi_limit_z()
const;
305 void _set_angular_lo_limit_x(
float p_limit_angular);
306 float _get_angular_lo_limit_x()
const;
308 void _set_angular_lo_limit_y(
float p_limit_angular);
309 float _get_angular_lo_limit_y()
const;
311 void _set_angular_lo_limit_z(
float p_limit_angular);
312 float _get_angular_lo_limit_z()
const;
314 float params_x[PARAM_MAX];
315 bool flags_x[FLAG_MAX];
316 float params_y[PARAM_MAX];
317 bool flags_y[FLAG_MAX];
318 float params_z[PARAM_MAX];
319 bool flags_z[FLAG_MAX];
322 static void _bind_methods();
325 void set_param_x(Param p_param,
float p_value);
326 float get_param_x(Param p_param)
const;
328 void set_param_y(Param p_param,
float p_value);
329 float get_param_y(Param p_param)
const;
331 void set_param_z(Param p_param,
float p_value);
332 float get_param_z(Param p_param)
const;
334 void set_flag_x(Flag p_flag,
bool p_enabled);
335 bool get_flag_x(Flag p_flag)
const;
337 void set_flag_y(Flag p_flag,
bool p_enabled);
338 bool get_flag_y(Flag p_flag)
const;
340 void set_flag_z(Flag p_flag,
bool p_enabled);
341 bool get_flag_z(Flag p_flag)
const;
347 VARIANT_ENUM_CAST(Generic6DOFJoint::Param);
348 VARIANT_ENUM_CAST(Generic6DOFJoint::Flag);
352 class PhysicsJoint :
public Spatial {
354 OBJ_TYPE(PhysicsJoint,
Spatial);
355 OBJ_CATEGORY(
"3D Physics Nodes");
363 RID indicator_instance;
365 RID _get_visual_instance_rid()
const;
374 void _notification(
int p_what);
375 static void _bind_methods();
378 virtual void _update_indicator()=0;
384 void set_body_A(
const NodePath& p_path);
385 void set_body_B(
const NodePath& p_path);
389 void set_active(
bool p_active);
390 bool is_active()
const;
392 void set_disable_collision(
bool p_active);
393 bool has_disable_collision()
const;
405 class PhysicsJointPin :
public PhysicsJoint {
407 OBJ_TYPE( PhysicsJointPin, PhysicsJoint );
411 virtual void _update_indicator();
419 #endif // PHYSICS_JOINT_H
Definition: physics_joint.h:82
Definition: string_db.h:48
Definition: physics_joint.h:109
Definition: physics_joint.h:162
Definition: physics_joint.h:36
Definition: physics_joint.h:261
Definition: physics_joint.h:222
Definition: physics_body.h:37