Skip to content

Commit e291c4a

Browse files
committed
UPBGE: Remove game property range and increase mass limit.
The game property range for floats and ints is replaced by -FLT/INT_MAX to FLT/INT_MAX. The object mass limit is up to 1000000, indeed higher there's some issue with bullet collision handling.
1 parent e280d91 commit e291c4a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

source/blender/makesrna/intern/rna_object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
17041704
RNA_def_property_ui_text(prop, "Ghost", "Object does not react to collisions, like a ghost");
17051705

17061706
prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
1707-
RNA_def_property_range(prop, 0.01, 10000.0);
1707+
RNA_def_property_range(prop, 0.01, 1000000.0);
17081708
RNA_def_property_float_default(prop, 1.0f);
17091709
RNA_def_property_ui_text(prop, "Mass", "Mass of the object");
17101710

source/blender/makesrna/intern/rna_property.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static float rna_GameFloatProperty_value_get(PointerRNA *ptr)
8686
static void rna_GameFloatProperty_value_set(PointerRNA *ptr, float value)
8787
{
8888
bProperty *prop = (bProperty *)(ptr->data);
89-
CLAMP(value, -10000.0f, 10000.0f);
89+
CLAMP(value, -FLT_MAX, FLT_MAX);
9090
*(float *)(&prop->data) = value;
9191
}
9292

@@ -159,7 +159,7 @@ void RNA_def_gameproperty(BlenderRNA *brna)
159159
prop = RNA_def_property(srna, "value", PROP_INT, PROP_NONE);
160160
RNA_def_property_int_sdna(prop, NULL, "data");
161161
RNA_def_property_ui_text(prop, "Value", "Property value");
162-
RNA_def_property_range(prop, -10000, 10000);
162+
RNA_def_property_range(prop, -INT_MAX, INT_MAX);
163163
RNA_def_property_update(prop, NC_LOGIC, NULL);
164164

165165
/* GameFloatProperty */
@@ -170,7 +170,7 @@ void RNA_def_gameproperty(BlenderRNA *brna)
170170
prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
171171
/* RNA_def_property_float_sdna(prop, NULL, "data"); */
172172
RNA_def_property_ui_text(prop, "Value", "Property value");
173-
RNA_def_property_range(prop, -10000, 10000);
173+
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
174174
RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL);
175175
RNA_def_property_update(prop, NC_LOGIC, NULL);
176176

@@ -182,7 +182,7 @@ void RNA_def_gameproperty(BlenderRNA *brna)
182182
prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
183183
/* RNA_def_property_float_sdna(prop, NULL, "data"); */
184184
RNA_def_property_ui_text(prop, "Value", "Property value");
185-
RNA_def_property_range(prop, -10000, 10000);
185+
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
186186
RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL);
187187
RNA_def_property_update(prop, NC_LOGIC, NULL);
188188

0 commit comments

Comments
 (0)