Art Vandelay Posted November 18, 2017 Share Posted November 18, 2017 Hi, I have two meshes. In my createScene function i have a point where I check if they are intersecting. The thing is I would like to first move one of the meshes (change its position) and then IMMEDIATELY check if they intersect BEFORE waiting for the next rendering iteration. The problem is if i change the position of one mesh so that it intersects with the other and then immediately check for intersection it says they don't intersect (I guess because the actual position is changed only while the render loop is called). Is there anyway to solve this? Thanks! Quote Link to comment Share on other sites More sharing options...
brianzinn Posted November 18, 2017 Share Posted November 18, 2017 I think if you use mesh.computeWorldMatrix(true) that it will update the actual position (otherwise a cached position is used):https://doc.babylonjs.com/classes/3.1/abstractmesh#computeworldmatrix-force-rarr-matrix-classes-3-1-matrix- There are ways to force a render, but that's an expensive operation... Quote Link to comment Share on other sites More sharing options...
Art Vandelay Posted November 18, 2017 Author Share Posted November 18, 2017 Exactly what I needed! Thanks @brianzinn! brianzinn 1 Quote Link to comment Share on other sites More sharing options...
brianzinn Posted November 18, 2017 Share Posted November 18, 2017 There's a sticky topic called "marking questions as solved". Art Vandelay and GameMonetize 2 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.