Skip to content

Fix pushing direction#37

Merged
diarmidmackenzie merged 1 commit into
c-frame:masterfrom
Yuma-Mori:force-pushable-direction
Jun 26, 2023
Merged

Fix pushing direction#37
diarmidmackenzie merged 1 commit into
c-frame:masterfrom
Yuma-Mori:force-pushable-direction

Conversation

@Yuma-Mori
Copy link
Copy Markdown

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
Copy Markdown
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!

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

Successfully merging this pull request may close these issues.

2 participants