File tree Expand file tree Collapse file tree 6 files changed +390
-22
lines changed Expand file tree Collapse file tree 6 files changed +390
-22
lines changed Original file line number Diff line number Diff line change 1418
1418
Sets which physics engine to use for 3D physics.
1419
1419
"DEFAULT" is currently the [url=https://bulletphysics.org]Bullet[/url] physics engine. The "GodotPhysics" engine is still supported as an alternative.
1420
1420
</member >
1421
+ <member name =" physics/3d/physics_interpolation/scene_traversal" type =" String" setter =" " getter =" " default =" " DEFAULT" " >
1422
+ Allows reverting to [code]Legacy[/code] method for scene tree traversal, which is slower.
1423
+ Also offers a [code]Debug[/code] method which provides logging information.
1424
+ [b]Note:[/b] This setting is intended for debugging only, you should use the [code]DEFAULT[/code] method in most cases.
1425
+ </member >
1421
1426
<member name =" physics/3d/smooth_trimesh_collision" type =" bool" setter =" " getter =" " default =" false" >
1422
1427
If [code]true[/code], smooths out collision with trimesh shapes ([ConcavePolygonShape]) by telling the Bullet physics engine to generate internal edge information for every trimesh shape created.
1423
1428
[b]Note:[/b] Only effective if [member physics/3d/physics_engine] is set to [code]DEFAULT[/code] or [code]Bullet[/code], [i]not[/i] [code]GodotPhysics[/code].
Original file line number Diff line number Diff line change @@ -285,6 +285,10 @@ void Spatial::_notification(int p_what) {
285
285
// unless they need to perform specific tasks (like changing process modes).
286
286
fti_pump_xform ();
287
287
fti_pump_property ();
288
+
289
+ // Detect whether we are using an identity transform.
290
+ // This is an optimization for faster tree transform concatenation.
291
+ data.fti_is_identity = data.local_transform == Transform ();
288
292
} break ;
289
293
290
294
case NOTIFICATION_PAUSED: {
@@ -1127,6 +1131,7 @@ Spatial::Spatial() :
1127
1131
data.fti_on_tick_property_list = false ;
1128
1132
data.fti_global_xform_interp_set = false ;
1129
1133
data.fti_frame_xform_force_update = false ;
1134
+ data.fti_is_identity = false ;
1130
1135
1131
1136
data.merging_mode = MERGING_MODE_INHERIT;
1132
1137
Original file line number Diff line number Diff line change @@ -129,9 +129,12 @@ class Spatial : public Node {
129
129
bool fti_on_tick_property_list : 1 ;
130
130
bool fti_global_xform_interp_set : 1 ;
131
131
bool fti_frame_xform_force_update : 1 ;
132
+ bool fti_is_identity : 1 ;
132
133
133
134
bool merging_allowed : 1 ;
134
135
136
+ uint32_t fti_last_update_half_frame = UINT32_MAX;
137
+
135
138
int children_lock;
136
139
Spatial *parent;
137
140
List<Spatial *> children;
Original file line number Diff line number Diff line change @@ -111,8 +111,8 @@ class Node : public Object {
111
111
HashMap<StringName, Node *> owned_unique_nodes;
112
112
bool unique_name_in_owner = false ;
113
113
114
+ int32_t depth;
114
115
int pos;
115
- int depth;
116
116
int blocked; // safeguard that throws an error when attempting to modify the tree in a harmful way while being traversed.
117
117
StringName name;
118
118
SceneTree *tree;
@@ -266,6 +266,7 @@ class Node : public Object {
266
266
bool _is_physics_interpolation_reset_requested () const { return data.physics_interpolation_reset_requested ; }
267
267
void _set_use_identity_transform (bool p_enable);
268
268
bool _is_using_identity_transform () const { return data.use_identity_transform ; }
269
+ int32_t _get_scene_tree_depth () const { return data.depth ; }
269
270
270
271
public:
271
272
enum {
You can’t perform that action at this time.
0 commit comments