When I try and add collision detection between a hand I’ve imported (created with md5) and a sphere with awayphysics it causes my collision function to repeatedly fire.
var bodyShape:AWPBvhTriangleMeshShape = new AWPBvhTriangleMeshShape(_controller.mesh.geometry);
var body:AWPCollisionObject = new AWPCollisionObject(bodyShape, _controller.mesh);
physicsWorld.addCollisionObject(body);
body.collisionFlags = AWPCollisionFlags.CF_CHARACTER_OBJECT;
body.addEventListener(AWPEvent.COLLISION_ADDED, sphereCollisionAdded);
private function sphereCollisionAdded(event:AWPEvent):void {
trace("hit");
var material:ColorMaterial = new ColorMaterial(0xFFFFFF);
var mesh:Mesh = Mesh(event.collisionObject.skin);
mesh.material = material;
}
Could there be a problem with the model?