We are working on a project and were getting a random 1125 error in bullet. We decided to update to 4.1.1 beta and the dev branch of away physics. The update seem to fix the crash we were getting but we are now having a problem with one of our constraints with a translational motor not working.
We have 2 of them set up one that slides back and forth along the Z axis it still works ok. The other slides along the Y axis up and down however it longer wants to move. I’ve tried increasing the velocity and motor force to no effect. Any one how any ideas? Heres the code that sets up the rigidbody and constraint.
This was all working on the 4.0.11 alpha build with the master branch of awayphysics.
var rigidbodyPiece : Object = new Object();
var l_wall_pos : Vector3D = new Vector3D(-m_asset_wall_offset_x, 0, 0);
var r_wall_pos : Vector3D = new Vector3D(m_asset_wall_offset_x, 0, 0);
m_l_wall_shape = new AWPBoxShape(m_asset_wall_width, m_asset_size.y, m_asset_size.z);
m_r_wall_shape = new AWPBoxShape(m_asset_wall_width, m_asset_size.y, m_asset_size.z);
shape = new AWPCompoundShape();
shape.addChildShape(m_l_wall_shape, l_wall_pos, new Vector3D());
shape.addChildShape(m_r_wall_shape, r_wall_pos, new Vector3D());
rigidbody = new AWPRigidBody(shape, mesh, 10);
rigidbody.gravity = new Vector3D();
super.initRigidbody(rigidbody);
rigidbody.y = WALL_Y_START;
rigidbody.z += 375;
//after tracing through for some reason the low y is
//doubled so at -300 it's actualy -600 with out doubling
//are low it was throwing off the high. The 5 is pull
//the low/high in a little as they dont end up at exact values
m_wall_low_y = WALL_Y_START * 2;
m_wall_high_y = m_wall_low_y + m_asset_slide_distance - 5;
m_wall_low_y += 5;
m_physicsWorld.addRigidBodyWithGroup(rigidbody, SceneObject.GroundFloorGroup, SceneObject.FloorCollisionMask);
m_constraint = new AWPGeneric6DofConstraint(rigidbody, rigidbody.position, new Vector3D());
var low : Vector3D = new Vector3D(rigidbody.x, rigidbody.y, rigidbody.z);
var high : Vector3D = new Vector3D(rigidbody.x, rigidbody.y + m_asset_slide_distance, rigidbody.z);
m_constraint.setLinearLimit(low, high);
m_constraint.setAngularLimit(new Vector3D(0, 0, 0), new Vector3D(0, 0, 0));
m_constraint.getTranslationalLimitMotor().enableMotorY = true;
m_constraint.getTranslationalLimitMotor().targetVelocity = new Vector3D(0, 30, 0);
m_constraint.getTranslationalLimitMotor().maxMotorForce = new Vector3D(0, 10, 0);
//rigidbody.position = new Vector3D(rigidbody.position.x, rigidbody.position.y + m_asset_slide_distance, rigidbody.position.z);
m_physicsWorld.addConstraint(m_constraint, true);