X Tutup
Skip to content

Add MultiMesh physics interpolation for 2D transforms (MultiMeshInstance2D)#107666

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
Sch1nken:add-physics-interpolation-multimesh2d
Oct 3, 2025
Merged

Add MultiMesh physics interpolation for 2D transforms (MultiMeshInstance2D)#107666
Repiteo merged 1 commit intogodotengine:masterfrom
Sch1nken:add-physics-interpolation-multimesh2d

Conversation

@Sch1nken
Copy link
Contributor

@Sch1nken Sch1nken commented Jun 18, 2025

I already discussed this on rocket chat. The docs wrongly state that MultiMeshInstance2D (or rather MultiMesh with 2D Transforms) make use of physics interpolation (https://docs.godotengine.org/en/latest/tutorials/physics/interpolation/2d_and_3d_physics_interpolation.html#other). After some fiddling I discovered that this was not the case.

So here is a hopefully decent implementation I basically replicated MultimeshInstance3D behaviour to MultiMeshInstance2D and added mesh_storage for 2D transforms.

Edit:
Small Testproject: MultiMesh2D_Interp_Test.zip

(Use space bar to toggle physics interpolation for the meshinstance on/off)

@Sch1nken Sch1nken requested review from a team as code owners June 18, 2025 11:18
@AThousandShips AThousandShips changed the title Added multimesh physics interpolation for 2D transforms (MultiMeshInstance2D) Add MultiMesh physics interpolation for 2D transforms (MultiMeshInstance2D) Jun 18, 2025
@AThousandShips AThousandShips added this to the 4.x milestone Jun 18, 2025
@akien-mga akien-mga requested a review from lawnjelly June 18, 2025 11:27
@lawnjelly
Copy link
Member

This looks great!

As discussed on RC, I likely just forgot to add this wrapper, all the backend should be the same as used by CPUParticles2D using bulk mode.

Any testing would be great, and I'll try and test.

@Sch1nken Sch1nken force-pushed the add-physics-interpolation-multimesh2d branch from 9f7fa7d to 004cff5 Compare June 18, 2025 12:04
@Sch1nken
Copy link
Contributor Author

I added the mentioned changes. All squashed into 1 commit.

I also added a simple test project in the intitial post.

@Sch1nken Sch1nken force-pushed the add-physics-interpolation-multimesh2d branch 2 times, most recently from a51fc31 to 69d7238 Compare June 18, 2025 13:44
@Sch1nken Sch1nken requested a review from a team as a code owner June 18, 2025 14:03
…tance2D)

Replicated MultimeshInstance3D behaviour to MultiMeshInstance2D and added mesh_storage for 2D transform

Also call VisualInstance::_physics_interpolated_changed()

Use Node instead of VisualInstance. Addded comment

Fixed typo :)

Using CanvasItem instead of Node now. Made CanvasItem::_physics_interpolated_changed() protected
@Sch1nken Sch1nken force-pushed the add-physics-interpolation-multimesh2d branch from 2358e1e to a9ac00f Compare June 18, 2025 14:04
Copy link
Member

@lawnjelly lawnjelly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Providing it passes CI (I think there's some CI problem at the moment).

@akien-mga akien-mga modified the milestones: 4.x, 4.6 Jun 18, 2025
@Repiteo Repiteo merged commit fb572af into godotengine:master Oct 3, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 3, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

X Tutup