altreality Posted October 4, 2014 Share Posted October 4, 2014 I want to apply a force in the local space of a body. But I only see a function to apply it in world space in http://blogs.msdn.com/b/eternalcoding/archive/2013/12/19/create-wonderful-interactive-games-for-the-web-using-webgl-and-a-physics-engine-babylon-js-amp-cannon-js.aspx under "Applying an impulse" Is there any direct function to apply a force in an object's local space ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 6, 2014 Share Posted October 6, 2014 just convert your local vector to world vector with: Vector3.TransformCoordinates(localVector, worldMatrix) Quote Link to comment Share on other sites More sharing options...
Stephen Andrews Posted October 27, 2014 Share Posted October 27, 2014 just convert your local vector to world vector with: Vector3.TransformCoordinates(localVector, worldMatrix)Sorry to bump, but how would one get access to the world matrix? I can't tell exactly where it is, as scene has three different types of matrixes. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 27, 2014 Share Posted October 27, 2014 you can get a mesh's worldmatrix: mesh.getWorldMatrix() Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.