chandlerprall / GoblinPhysics

Collision Detection & Response in JavaScript
http://www.goblinphysics.com
Other
147 stars 18 forks source link

MeshShape can't be child of CompoundShape #44

Closed mbrazell closed 8 years ago

mbrazell commented 9 years ago

Adding a MeshShape as a child shape to a CompoundShape causes "Uncaught TypeError: undefined is not a function", which references line 3578 of goblin.js:

use_contact = contact.object_a.emit( 'newContact', contact.object_b, contact );

"emit" is undefined.

I encountered this issue in my own code, and then re-created it in the mesh-shape-statue demo by adding the MeshShape object as a child to a CompoundShape before adding it to the rigid body:

// shape is the MeshShape of the statue var compoundShape = new Goblin.CompoundShape(); compoundShape.addChildShape(shape, new Goblin.Vector3(), new Goblin.Quaternion());

mesh.goblin = new Goblin.RigidBody( compoundShape, 0 );

chandlerprall commented 9 years ago

Thanks for reporting, will get it looked at soon.

chandlerprall commented 9 years ago

This should now be fixed on the 0.9 branch

mbrazell commented 9 years ago

Thanks for the update!

On Sat, Jul 25, 2015 at 11:57 PM, Chandler notifications@github.com wrote:

This should now be fixed on the 0.9 branch

— Reply to this email directly or view it on GitHub https://github.com/chandlerprall/GoblinPhysics/issues/44#issuecomment-124942713 .