Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kinematic objects to Cannon #27

Open
diarmidmackenzie opened this issue Jan 4, 2023 · 0 comments
Open

Add kinematic objects to Cannon #27

diarmidmackenzie opened this issue Jan 4, 2023 · 0 comments

Comments

@diarmidmackenzie
Copy link
Member

Offshoot of #15.

Possible (modest) perf improvement to Cannon wrapper by not syncing positions of static objects to the physics engine (cos they are static, so should never move).

Requires introducing a distinction between kinematic & static objects (as per the Ammo driver), which doesn't currently exist. Kinematic objects will require syncing to physics every tick. That will be the only difference.

The relevant part of #15 quoted here for convenience:

Cannon doesn't distinguish between kinematic & static objects. So you could say that all static objects in Cannon are kinematic - hence we should update them every frame.

We could introduce a "kinematic" concept at the wrapper level in Cannon, where the sole difference between static & kinematic would be that kinematic objects would have their position sync'd to the physics engine every frame, whereas static objects wouldn't.

I'd suggest a new issue to track that potential improvement. That said, I'm not sure there's that much value as the before/after phases are already much cheaper relative to the engine with Cannon than they are with Ammo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant