mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Physics Interpolation - Move 3D FTI to SceneTree
Moves 3D interpolation from server to the client code (`SceneTree`). Complete rework of 3D physics interpolation, but using the same user API.
This commit is contained in:
parent
8954125990
commit
ae04a3a5dd
30 changed files with 1030 additions and 432 deletions
|
|
@ -408,17 +408,9 @@ public:
|
|||
|
||||
RID mesh_instance; //only used for meshes and when skeleton/blendshapes exist
|
||||
|
||||
// This is the main transform to be drawn with ...
|
||||
// This will either be the interpolated transform (when using fixed timestep interpolation)
|
||||
// or the ONLY transform (when not using FTI).
|
||||
Transform3D transform;
|
||||
bool teleported = false;
|
||||
|
||||
// For interpolation we store the current transform (this physics tick)
|
||||
// and the transform in the previous tick.
|
||||
Transform3D transform_curr;
|
||||
Transform3D transform_prev;
|
||||
|
||||
float lod_bias;
|
||||
|
||||
bool ignore_occlusion_culling;
|
||||
|
|
@ -437,16 +429,6 @@ public:
|
|||
bool dynamic_gi : 1; // Same as above for dynamic objects.
|
||||
bool redraw_if_visible : 1;
|
||||
|
||||
bool on_interpolate_list : 1;
|
||||
bool on_interpolate_transform_list : 1;
|
||||
bool interpolated : 1;
|
||||
TransformInterpolator::Method interpolation_method : 3;
|
||||
|
||||
// For fixed timestep interpolation.
|
||||
// Note 32 bits is plenty for checksum, no need for real_t
|
||||
float transform_checksum_curr;
|
||||
float transform_checksum_prev;
|
||||
|
||||
Instance *lightmap = nullptr;
|
||||
Rect2 lightmap_uv_scale;
|
||||
int lightmap_slice_index;
|
||||
|
|
@ -587,13 +569,6 @@ public:
|
|||
dynamic_gi = false;
|
||||
redraw_if_visible = false;
|
||||
|
||||
on_interpolate_list = false;
|
||||
on_interpolate_transform_list = false;
|
||||
interpolated = true;
|
||||
interpolation_method = TransformInterpolator::INTERP_LERP;
|
||||
transform_checksum_curr = 0.0;
|
||||
transform_checksum_prev = 0.0;
|
||||
|
||||
lightmap_slice_index = 0;
|
||||
lightmap = nullptr;
|
||||
lightmap_cull_index = 0;
|
||||
|
|
@ -1047,8 +1022,6 @@ public:
|
|||
virtual void instance_set_layer_mask(RID p_instance, uint32_t p_mask);
|
||||
virtual void instance_set_pivot_data(RID p_instance, float p_sorting_offset, bool p_use_aabb_center);
|
||||
virtual void instance_set_transform(RID p_instance, const Transform3D &p_transform);
|
||||
virtual void instance_set_interpolated(RID p_instance, bool p_interpolated);
|
||||
virtual void instance_reset_physics_interpolation(RID p_instance);
|
||||
virtual void instance_attach_object_instance_id(RID p_instance, ObjectID p_id);
|
||||
virtual void instance_set_blend_shape_weight(RID p_instance, int p_shape, float p_weight);
|
||||
virtual void instance_set_surface_override_material(RID p_instance, int p_surface, RID p_material);
|
||||
|
|
@ -1430,12 +1403,6 @@ public:
|
|||
virtual void set_physics_interpolation_enabled(bool p_enabled);
|
||||
|
||||
struct InterpolationData {
|
||||
void notify_free_instance(RID p_rid, Instance &r_instance);
|
||||
LocalVector<RID> instance_interpolate_update_list;
|
||||
LocalVector<RID> instance_transform_update_lists[2];
|
||||
LocalVector<RID> *instance_transform_update_list_curr = &instance_transform_update_lists[0];
|
||||
LocalVector<RID> *instance_transform_update_list_prev = &instance_transform_update_lists[1];
|
||||
|
||||
bool interpolation_enabled = false;
|
||||
} _interpolation_data;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue