Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix pushing direction #37

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

Yuma-Mori
Copy link

In Ammo's force-pushable example, wherever I click an object, the force comes from (0, 0, 0).

I added vector subtraction to direct force from the clicker to the object. Also, this code works if cursor is mouse.

@diarmidmackenzie
Copy link
Member

Thanks for this. I'm happy to merge this as it's clearly an improvement, and this is only test / example code.

A completely correct fix would also allow for the fact that the entity being pushed may not be in world space, so we should use el.object3D.getWorldPostion() rather than el.object3D.position.

It would also be nice to fix up the Cannon version, which looks like it has the same issue.

Further fixes for either of these would be much appreciated!

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

Successfully merging this pull request may close these issues.

2 participants