Skip to content

Commit 9cea7eb

Browse files
committed
Fix SCU build issues related to Jolt Physics
1 parent db66343 commit 9cea7eb

File tree

10 files changed

+185
-185
lines changed

10 files changed

+185
-185
lines changed

modules/jolt_physics/joints/jolt_cone_twist_joint_3d.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838

3939
namespace {
4040

41-
constexpr double DEFAULT_BIAS = 0.3;
42-
constexpr double DEFAULT_SOFTNESS = 0.8;
43-
constexpr double DEFAULT_RELAXATION = 1.0;
41+
constexpr double CONE_TWIST_DEFAULT_BIAS = 0.3;
42+
constexpr double CONE_TWIST_DEFAULT_SOFTNESS = 0.8;
43+
constexpr double CONE_TWIST_DEFAULT_RELAXATION = 1.0;
4444

4545
} // namespace
4646

@@ -168,13 +168,13 @@ double JoltConeTwistJoint3D::get_param(PhysicsServer3D::ConeTwistJointParam p_pa
168168
return twist_limit_span;
169169
}
170170
case PhysicsServer3D::CONE_TWIST_JOINT_BIAS: {
171-
return DEFAULT_BIAS;
171+
return CONE_TWIST_DEFAULT_BIAS;
172172
}
173173
case PhysicsServer3D::CONE_TWIST_JOINT_SOFTNESS: {
174-
return DEFAULT_SOFTNESS;
174+
return CONE_TWIST_DEFAULT_SOFTNESS;
175175
}
176176
case PhysicsServer3D::CONE_TWIST_JOINT_RELAXATION: {
177-
return DEFAULT_RELAXATION;
177+
return CONE_TWIST_DEFAULT_RELAXATION;
178178
}
179179
default: {
180180
ERR_FAIL_V_MSG(0.0, vformat("Unhandled cone twist joint parameter: '%d'. This should not happen. Please report this.", p_param));
@@ -193,17 +193,17 @@ void JoltConeTwistJoint3D::set_param(PhysicsServer3D::ConeTwistJointParam p_para
193193
_limits_changed();
194194
} break;
195195
case PhysicsServer3D::CONE_TWIST_JOINT_BIAS: {
196-
if (!Math::is_equal_approx(p_value, DEFAULT_BIAS)) {
196+
if (!Math::is_equal_approx(p_value, CONE_TWIST_DEFAULT_BIAS)) {
197197
WARN_PRINT(vformat("Cone twist joint bias is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
198198
}
199199
} break;
200200
case PhysicsServer3D::CONE_TWIST_JOINT_SOFTNESS: {
201-
if (!Math::is_equal_approx(p_value, DEFAULT_SOFTNESS)) {
201+
if (!Math::is_equal_approx(p_value, CONE_TWIST_DEFAULT_SOFTNESS)) {
202202
WARN_PRINT(vformat("Cone twist joint softness is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
203203
}
204204
} break;
205205
case PhysicsServer3D::CONE_TWIST_JOINT_RELAXATION: {
206-
if (!Math::is_equal_approx(p_value, DEFAULT_RELAXATION)) {
206+
if (!Math::is_equal_approx(p_value, CONE_TWIST_DEFAULT_RELAXATION)) {
207207
WARN_PRINT(vformat("Cone twist joint relaxation is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
208208
}
209209
} break;

modules/jolt_physics/joints/jolt_generic_6dof_joint_3d.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838

3939
namespace {
4040

41-
constexpr double DEFAULT_LINEAR_LIMIT_SOFTNESS = 0.7;
42-
constexpr double DEFAULT_LINEAR_RESTITUTION = 0.5;
43-
constexpr double DEFAULT_LINEAR_DAMPING = 1.0;
41+
constexpr double G6DOF_DEFAULT_LINEAR_LIMIT_SOFTNESS = 0.7;
42+
constexpr double G6DOF_DEFAULT_LINEAR_RESTITUTION = 0.5;
43+
constexpr double G6DOF_DEFAULT_LINEAR_DAMPING = 1.0;
4444

45-
constexpr double DEFAULT_ANGULAR_LIMIT_SOFTNESS = 0.5;
46-
constexpr double DEFAULT_ANGULAR_DAMPING = 1.0;
47-
constexpr double DEFAULT_ANGULAR_RESTITUTION = 0.0;
48-
constexpr double DEFAULT_ANGULAR_FORCE_LIMIT = 0.0;
49-
constexpr double DEFAULT_ANGULAR_ERP = 0.5;
45+
constexpr double G6DOF_DEFAULT_ANGULAR_LIMIT_SOFTNESS = 0.5;
46+
constexpr double G6DOF_DEFAULT_ANGULAR_DAMPING = 1.0;
47+
constexpr double G6DOF_DEFAULT_ANGULAR_RESTITUTION = 0.0;
48+
constexpr double G6DOF_DEFAULT_ANGULAR_FORCE_LIMIT = 0.0;
49+
constexpr double G6DOF_DEFAULT_ANGULAR_ERP = 0.5;
5050

5151
} // namespace
5252

@@ -271,13 +271,13 @@ double JoltGeneric6DOFJoint3D::get_param(Axis p_axis, Param p_param) const {
271271
return limit_upper[axis_lin];
272272
}
273273
case PhysicsServer3D::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS: {
274-
return DEFAULT_LINEAR_LIMIT_SOFTNESS;
274+
return G6DOF_DEFAULT_LINEAR_LIMIT_SOFTNESS;
275275
}
276276
case PhysicsServer3D::G6DOF_JOINT_LINEAR_RESTITUTION: {
277-
return DEFAULT_LINEAR_RESTITUTION;
277+
return G6DOF_DEFAULT_LINEAR_RESTITUTION;
278278
}
279279
case PhysicsServer3D::G6DOF_JOINT_LINEAR_DAMPING: {
280-
return DEFAULT_LINEAR_DAMPING;
280+
return G6DOF_DEFAULT_LINEAR_DAMPING;
281281
}
282282
case PhysicsServer3D::G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY: {
283283
return motor_speed[axis_lin];
@@ -301,19 +301,19 @@ double JoltGeneric6DOFJoint3D::get_param(Axis p_axis, Param p_param) const {
301301
return limit_upper[axis_ang];
302302
}
303303
case PhysicsServer3D::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS: {
304-
return DEFAULT_ANGULAR_LIMIT_SOFTNESS;
304+
return G6DOF_DEFAULT_ANGULAR_LIMIT_SOFTNESS;
305305
}
306306
case PhysicsServer3D::G6DOF_JOINT_ANGULAR_DAMPING: {
307-
return DEFAULT_ANGULAR_DAMPING;
307+
return G6DOF_DEFAULT_ANGULAR_DAMPING;
308308
}
309309
case PhysicsServer3D::G6DOF_JOINT_ANGULAR_RESTITUTION: {
310-
return DEFAULT_ANGULAR_RESTITUTION;
310+
return G6DOF_DEFAULT_ANGULAR_RESTITUTION;
311311
}
312312
case PhysicsServer3D::G6DOF_JOINT_ANGULAR_FORCE_LIMIT: {
313-
return DEFAULT_ANGULAR_FORCE_LIMIT;
313+
return G6DOF_DEFAULT_ANGULAR_FORCE_LIMIT;
314314
}
315315
case PhysicsServer3D::G6DOF_JOINT_ANGULAR_ERP: {
316-
return DEFAULT_ANGULAR_ERP;
316+
return G6DOF_DEFAULT_ANGULAR_ERP;
317317
}
318318
case PhysicsServer3D::G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY: {
319319
return motor_speed[axis_ang];
@@ -350,17 +350,17 @@ void JoltGeneric6DOFJoint3D::set_param(Axis p_axis, Param p_param, double p_valu
350350
_limits_changed();
351351
} break;
352352
case PhysicsServer3D::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS: {
353-
if (!Math::is_equal_approx(p_value, DEFAULT_LINEAR_LIMIT_SOFTNESS)) {
353+
if (!Math::is_equal_approx(p_value, G6DOF_DEFAULT_LINEAR_LIMIT_SOFTNESS)) {
354354
WARN_PRINT(vformat("6DOF joint linear limit softness is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
355355
}
356356
} break;
357357
case PhysicsServer3D::G6DOF_JOINT_LINEAR_RESTITUTION: {
358-
if (!Math::is_equal_approx(p_value, DEFAULT_LINEAR_RESTITUTION)) {
358+
if (!Math::is_equal_approx(p_value, G6DOF_DEFAULT_LINEAR_RESTITUTION)) {
359359
WARN_PRINT(vformat("6DOF joint linear restitution is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
360360
}
361361
} break;
362362
case PhysicsServer3D::G6DOF_JOINT_LINEAR_DAMPING: {
363-
if (!Math::is_equal_approx(p_value, DEFAULT_LINEAR_DAMPING)) {
363+
if (!Math::is_equal_approx(p_value, G6DOF_DEFAULT_LINEAR_DAMPING)) {
364364
WARN_PRINT(vformat("6DOF joint linear damping is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
365365
}
366366
} break;
@@ -393,27 +393,27 @@ void JoltGeneric6DOFJoint3D::set_param(Axis p_axis, Param p_param, double p_valu
393393
_limits_changed();
394394
} break;
395395
case PhysicsServer3D::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS: {
396-
if (!Math::is_equal_approx(p_value, DEFAULT_ANGULAR_LIMIT_SOFTNESS)) {
396+
if (!Math::is_equal_approx(p_value, G6DOF_DEFAULT_ANGULAR_LIMIT_SOFTNESS)) {
397397
WARN_PRINT(vformat("6DOF joint angular limit softness is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
398398
}
399399
} break;
400400
case PhysicsServer3D::G6DOF_JOINT_ANGULAR_DAMPING: {
401-
if (!Math::is_equal_approx(p_value, DEFAULT_ANGULAR_DAMPING)) {
401+
if (!Math::is_equal_approx(p_value, G6DOF_DEFAULT_ANGULAR_DAMPING)) {
402402
WARN_PRINT(vformat("6DOF joint angular damping is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
403403
}
404404
} break;
405405
case PhysicsServer3D::G6DOF_JOINT_ANGULAR_RESTITUTION: {
406-
if (!Math::is_equal_approx(p_value, DEFAULT_ANGULAR_RESTITUTION)) {
406+
if (!Math::is_equal_approx(p_value, G6DOF_DEFAULT_ANGULAR_RESTITUTION)) {
407407
WARN_PRINT(vformat("6DOF joint angular restitution is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
408408
}
409409
} break;
410410
case PhysicsServer3D::G6DOF_JOINT_ANGULAR_FORCE_LIMIT: {
411-
if (!Math::is_equal_approx(p_value, DEFAULT_ANGULAR_FORCE_LIMIT)) {
411+
if (!Math::is_equal_approx(p_value, G6DOF_DEFAULT_ANGULAR_FORCE_LIMIT)) {
412412
WARN_PRINT(vformat("6DOF joint angular force limit is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
413413
}
414414
} break;
415415
case PhysicsServer3D::G6DOF_JOINT_ANGULAR_ERP: {
416-
if (!Math::is_equal_approx(p_value, DEFAULT_ANGULAR_ERP)) {
416+
if (!Math::is_equal_approx(p_value, G6DOF_DEFAULT_ANGULAR_ERP)) {
417417
WARN_PRINT(vformat("6DOF joint angular ERP is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
418418
}
419419
} break;

modules/jolt_physics/joints/jolt_hinge_joint_3d.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141

4242
namespace {
4343

44-
constexpr double DEFAULT_BIAS = 0.3;
45-
constexpr double DEFAULT_LIMIT_BIAS = 0.3;
46-
constexpr double DEFAULT_SOFTNESS = 0.9;
47-
constexpr double DEFAULT_RELAXATION = 1.0;
44+
constexpr double HINGE_DEFAULT_BIAS = 0.3;
45+
constexpr double HINGE_DEFAULT_LIMIT_BIAS = 0.3;
46+
constexpr double HINGE_DEFAULT_SOFTNESS = 0.9;
47+
constexpr double HINGE_DEFAULT_RELAXATION = 1.0;
4848

4949
double estimate_physics_step() {
5050
Engine *engine = Engine::get_singleton();
@@ -171,7 +171,7 @@ JoltHingeJoint3D::JoltHingeJoint3D(const JoltJoint3D &p_old_joint, JoltBody3D *p
171171
double JoltHingeJoint3D::get_param(Parameter p_param) const {
172172
switch (p_param) {
173173
case PhysicsServer3D::HINGE_JOINT_BIAS: {
174-
return DEFAULT_BIAS;
174+
return HINGE_DEFAULT_BIAS;
175175
}
176176
case PhysicsServer3D::HINGE_JOINT_LIMIT_UPPER: {
177177
return limit_upper;
@@ -180,13 +180,13 @@ double JoltHingeJoint3D::get_param(Parameter p_param) const {
180180
return limit_lower;
181181
}
182182
case PhysicsServer3D::HINGE_JOINT_LIMIT_BIAS: {
183-
return DEFAULT_LIMIT_BIAS;
183+
return HINGE_DEFAULT_LIMIT_BIAS;
184184
}
185185
case PhysicsServer3D::HINGE_JOINT_LIMIT_SOFTNESS: {
186-
return DEFAULT_SOFTNESS;
186+
return HINGE_DEFAULT_SOFTNESS;
187187
}
188188
case PhysicsServer3D::HINGE_JOINT_LIMIT_RELAXATION: {
189-
return DEFAULT_RELAXATION;
189+
return HINGE_DEFAULT_RELAXATION;
190190
}
191191
case PhysicsServer3D::HINGE_JOINT_MOTOR_TARGET_VELOCITY: {
192192
return motor_target_speed;
@@ -204,7 +204,7 @@ double JoltHingeJoint3D::get_param(Parameter p_param) const {
204204
void JoltHingeJoint3D::set_param(Parameter p_param, double p_value) {
205205
switch (p_param) {
206206
case PhysicsServer3D::HINGE_JOINT_BIAS: {
207-
if (!Math::is_equal_approx(p_value, DEFAULT_BIAS)) {
207+
if (!Math::is_equal_approx(p_value, HINGE_DEFAULT_BIAS)) {
208208
WARN_PRINT(vformat("Hinge joint bias is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
209209
}
210210
} break;
@@ -217,17 +217,17 @@ void JoltHingeJoint3D::set_param(Parameter p_param, double p_value) {
217217
_limits_changed();
218218
} break;
219219
case PhysicsServer3D::HINGE_JOINT_LIMIT_BIAS: {
220-
if (!Math::is_equal_approx(p_value, DEFAULT_LIMIT_BIAS)) {
220+
if (!Math::is_equal_approx(p_value, HINGE_DEFAULT_LIMIT_BIAS)) {
221221
WARN_PRINT(vformat("Hinge joint bias limit is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
222222
}
223223
} break;
224224
case PhysicsServer3D::HINGE_JOINT_LIMIT_SOFTNESS: {
225-
if (!Math::is_equal_approx(p_value, DEFAULT_SOFTNESS)) {
225+
if (!Math::is_equal_approx(p_value, HINGE_DEFAULT_SOFTNESS)) {
226226
WARN_PRINT(vformat("Hinge joint softness is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
227227
}
228228
} break;
229229
case PhysicsServer3D::HINGE_JOINT_LIMIT_RELAXATION: {
230-
if (!Math::is_equal_approx(p_value, DEFAULT_RELAXATION)) {
230+
if (!Math::is_equal_approx(p_value, HINGE_DEFAULT_RELAXATION)) {
231231
WARN_PRINT(vformat("Hinge joint relaxation is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
232232
}
233233
} break;

modules/jolt_physics/joints/jolt_joint_3d.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
namespace {
3939

40-
constexpr int DEFAULT_SOLVER_PRIORITY = 1;
40+
constexpr int JOINT_DEFAULT_SOLVER_PRIORITY = 1;
4141

4242
} // namespace
4343

@@ -173,11 +173,11 @@ void JoltJoint3D::set_enabled(bool p_enabled) {
173173
}
174174

175175
int JoltJoint3D::get_solver_priority() const {
176-
return DEFAULT_SOLVER_PRIORITY;
176+
return JOINT_DEFAULT_SOLVER_PRIORITY;
177177
}
178178

179179
void JoltJoint3D::set_solver_priority(int p_priority) {
180-
if (p_priority != DEFAULT_SOLVER_PRIORITY) {
180+
if (p_priority != JOINT_DEFAULT_SOLVER_PRIORITY) {
181181
WARN_PRINT(vformat("Joint solver priority is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
182182
}
183183
}

modules/jolt_physics/joints/jolt_pin_joint_3d.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838

3939
namespace {
4040

41-
constexpr double DEFAULT_BIAS = 0.3;
42-
constexpr double DEFAULT_DAMPING = 1.0;
43-
constexpr double DEFAULT_IMPULSE_CLAMP = 0.0;
41+
constexpr double PIN_DEFAULT_BIAS = 0.3;
42+
constexpr double PIN_DEFAULT_DAMPING = 1.0;
43+
constexpr double PIN_DEFAULT_IMPULSE_CLAMP = 0.0;
4444

4545
} // namespace
4646

@@ -82,13 +82,13 @@ void JoltPinJoint3D::set_local_b(const Vector3 &p_local_b) {
8282
double JoltPinJoint3D::get_param(PhysicsServer3D::PinJointParam p_param) const {
8383
switch (p_param) {
8484
case PhysicsServer3D::PIN_JOINT_BIAS: {
85-
return DEFAULT_BIAS;
85+
return PIN_DEFAULT_BIAS;
8686
}
8787
case PhysicsServer3D::PIN_JOINT_DAMPING: {
88-
return DEFAULT_DAMPING;
88+
return PIN_DEFAULT_DAMPING;
8989
}
9090
case PhysicsServer3D::PIN_JOINT_IMPULSE_CLAMP: {
91-
return DEFAULT_IMPULSE_CLAMP;
91+
return PIN_DEFAULT_IMPULSE_CLAMP;
9292
}
9393
default: {
9494
ERR_FAIL_V_MSG(0.0, vformat("Unhandled pin joint parameter: '%d'. This should not happen. Please report this.", p_param));
@@ -99,17 +99,17 @@ double JoltPinJoint3D::get_param(PhysicsServer3D::PinJointParam p_param) const {
9999
void JoltPinJoint3D::set_param(PhysicsServer3D::PinJointParam p_param, double p_value) {
100100
switch (p_param) {
101101
case PhysicsServer3D::PIN_JOINT_BIAS: {
102-
if (!Math::is_equal_approx(p_value, DEFAULT_BIAS)) {
102+
if (!Math::is_equal_approx(p_value, PIN_DEFAULT_BIAS)) {
103103
WARN_PRINT(vformat("Pin joint bias is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
104104
}
105105
} break;
106106
case PhysicsServer3D::PIN_JOINT_DAMPING: {
107-
if (!Math::is_equal_approx(p_value, DEFAULT_DAMPING)) {
107+
if (!Math::is_equal_approx(p_value, PIN_DEFAULT_DAMPING)) {
108108
WARN_PRINT(vformat("Pin joint damping is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
109109
}
110110
} break;
111111
case PhysicsServer3D::PIN_JOINT_IMPULSE_CLAMP: {
112-
if (!Math::is_equal_approx(p_value, DEFAULT_IMPULSE_CLAMP)) {
112+
if (!Math::is_equal_approx(p_value, PIN_DEFAULT_IMPULSE_CLAMP)) {
113113
WARN_PRINT(vformat("Pin joint impulse clamp is not supported when using Jolt Physics. Any such value will be ignored. This joint connects %s.", _bodies_to_string()));
114114
}
115115
} break;

0 commit comments

Comments
 (0)