Skip to content

Commit 0c76360

Browse files
committed
Merge pull request godotengine#101237 from mihe/jolt/cache-bounce-velocity
Cache value of Jolt Physics project setting `bounce_velocity_threshold`
2 parents a0c3798 + d6b822c commit 0c76360

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

doc/classes/ProjectSettings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2464,6 +2464,7 @@
24642464
</member>
24652465
<member name="physics/jolt_physics_3d/simulation/bounce_velocity_threshold" type="float" setter="" getter="" default="1.0">
24662466
The minimum velocity needed before a collision can be bouncy, in meters per second.
2467+
[b]Note:[/b] This setting will only be read once during the lifetime of the application.
24672468
</member>
24682469
<member name="physics/jolt_physics_3d/simulation/continuous_cd_max_penetration" type="float" setter="" getter="" default="0.25">
24692470
Fraction of a body's inner radius that may penetrate another body while using continuous collision detection.

modules/jolt_physics/jolt_project_settings.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ float JoltProjectSettings::get_soft_body_point_radius() {
119119
}
120120

121121
float JoltProjectSettings::get_bounce_velocity_threshold() {
122-
return GLOBAL_GET("physics/jolt_physics_3d/simulation/bounce_velocity_threshold");
122+
static const float value = GLOBAL_GET("physics/jolt_physics_3d/simulation/bounce_velocity_threshold");
123+
return value;
123124
}
124125

125126
bool JoltProjectSettings::is_sleep_allowed() {

0 commit comments

Comments
 (0)