Apply Force Precisely on Cube, Fiber + Cannon #2226
Replies: 3 comments 2 replies
-
Yeah, it is acting weird. Here is a modification with the normal aligned correctly to the face I added an ArrowHelper to show where the force is being applied. The normal points away from the position where force is to be applied. But it behaves like it is receiving force from the opposite direction. If I flip it, it does the opposite. Not an answer, but will maybe help a little. |
Beta Was this translation helpful? Give feedback.
-
This has the normal flipped in (what appears to be) the correct direction, but the opposite occurs. https://codesandbox.io/s/force-on-click-position-forked-33geiu?file=/src/App.js |
Beta Was this translation helpful? Give feedback.
-
What if, instead of an impulse you have another physics object that pushes into the box. Kind of like a little invisible bullet you shoot at the box. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, could someone help me figure out where I am going wrong? Here is a CSB I made where you click on a cube face and push it in that direction. It applies force on the center of the cube volume (default). https://codesandbox.io/s/force-on-center-of-volume-r1sym0?file=/src/App.js. This works.
I have then been trying to apply force on precisely where the cube has been clicked in this CSB: https://codesandbox.io/s/force-on-click-position-o7qm37?file=/src/App.js. And it works to some extent but it works wrong in many more ways:
ISSUES:
1) Once the cube is pushed over onto another face- forces applied break in a way I don't understand
2) const deltaPosition = worldPoint.sub(center);
This works well for only vertical faces. Clicking on a horizontal face will produce wrong results?
3) const deltaPosition = center.sub(worldPoint);
This works well for only horizontal faces. Clicking on a vertical face will produce wrong results?
4) Force is more powerful when applied closer to the center of gravity, instead of further away from it
e.g. imagine a skyscraper, it will fall over easily when pushed at the base instead of the top/roof. Try it on a face.
I have written comments to explain my steps in the CSB, here is the snippet:
Beta Was this translation helpful? Give feedback.
All reactions