amennelet
10-09-2009 15:07:35
Hi,
I get an AccessViolationException when I create a body using a TreeCollision created with a SceneNode.
If I use the Entity it's working fine (except that I can't scale the collision according to the scene node size).
Is anybody encounter the same problem, or am I doing something wrong?
Alex
I get an AccessViolationException when I create a body using a TreeCollision created with a SceneNode.
Vector3 railPosition = new Vector3(position.x, position.y - 0.7f, position.z);
RailEntity = LocalSceneManager.CreateEntity("Rail" + this.GetHashCode().ToString(), "RailTapis.mesh");
RailSceneNode = LocalSceneManager.RootSceneNode.CreateChildSceneNode(railPosition);
RailSceneNode.AttachObject(RailEntity);
RailSceneNode.SetScale(sizeSection);
MogreNewt.CollisionPrimitives.TreeCollision railColl = new MogreNewt.CollisionPrimitives.TreeCollision(world, RailSceneNode, true);
// AccessViolationException
MogreNewt.Body railBody = new MogreNewt.Body(world, railColl);
railColl.Dispose();
railBody.AttachToNode(RailSceneNode);
railBody.SetPositionOrientation(railPosition, Quaternion.IDENTITY);
If I use the Entity it's working fine (except that I can't scale the collision according to the scene node size).
Is anybody encounter the same problem, or am I doing something wrong?
Alex