MackeyK24 Posted January 3, 2017 Share Posted January 3, 2017 As ANY EVER got physicsImpostor.unregisterOnPhysicsCollide to work... No matter what i try i always get "Function to remove not found" Quote Link to comment Share on other sites More sharing options...
adam Posted January 4, 2017 Share Posted January 4, 2017 PG? It should work if you pass it an imposter and function you have previously registered. https://github.com/BabylonJS/Babylon.js/blob/master/src/Physics/babylon.physicsImpostor.ts#L283 Quote Link to comment Share on other sites More sharing options...
MackeyK24 Posted January 4, 2017 Author Share Posted January 4, 2017 Well it must does not work with an empty array of imposter: private _collidedAgainstList:Array<PhysicsImpostor> = []; this._mesh.physicsImpostor.registerOnPhysicsCollide(this._collidedAgainstList, this.processPhysicsCollisions) Everything works fine the collisions happen... but i guess it can't find using array.indexOf if the array is empty... Dunno... But does not work this._mesh.physicsImpostor.unregisterOnPhysicsCollide(this._collidedAgainstList, this.processPhysicsCollisions) throws the not found error Dunno... I have been thinking above removing OIMO physics support from Toolkit ... If i can't reliable provide an API layer for the toolkit collision detection ... I guess i will only support the engine i can... So far just Cannon... But hopefully this Energy.js engine will AT least provide the type of set mass, friction, restitution, angularDamping, linearDamping, collisionDetection plus onCollide Events that Cannon.js does. What do you think @Sebavan ??? 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.