latest library on GIT:I am not sure is this a bug or not. when a rigidbody has aleady on physicsworld, remove it and then add it to group, error happe

Software: Away3D 4.x

liuyi, Member
Posted: 21 December 2011 07:26 AM   Total Posts: 65

I am not sure is this a bug or not. when a rigidbody has aleady on physicsworld, remove it and then add it as addRigidBodyWithGroup(),

then get error. everybody can test this code clip

mat = new ColorMaterial(0xffdd0c0.4);
   
mat.lights=[_light]
   
var cube:Basic3dObj = new Basic3dObj();
   
cube.model = new Cube(mat200200200);
   
cube.rigidbody = new AWPRigidBody(new AWPBoxShape(200200200), cube.model50);
   
   
cube.rigidbody.position = new Vector3D(03000);
   
_view.scene.addChild(cube.model);
   
_physicsWorld.addRigidBody(cube.rigidbody as AWPRigidBody);
   
   
_physicsWorld.removeRigidBody(cube.rigidbody as AWPRigidBody);
   
   
_physicsWorld.addRigidBodyWithGroup(cube.rigidbody as AWPRigidBody,1,2); //get error at here! 

ps:this error only happen when pull the latest files from git.

   

liuyi, Member
Posted: 21 December 2011 08:54 AM   Total Posts: 65   [ # 1 ]

it will works when comment removeRigidbody();

   

Yang Li, Administrator
Posted: 21 December 2011 09:51 AM   Total Posts: 80   [ # 2 ]

update: this is a bug, have fixed in latest commit.

   

R Villani, Newbie
Posted: 06 February 2012 11:07 AM   Total Posts: 13   [ # 3 ]

Sorry, Li, but there is still some bug with removeRigidBody(). I just posted about it on the thread RangeError: Error #1125: index out of range.

One thing about this error is that it’s most common with AWPBvhTriangleMesh. If I use AWPConvexHullShape I don’t get it so often. But the #1125 one still happens either way.

   

liuyi, Member
Posted: 13 February 2012 07:05 AM   Total Posts: 65   [ # 4 ]

My experience is don’t use the latest version, you can revert to a older version.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X