6DofConstraint motor problem

Software: Away3D 4.x

rfenner, Newbie
Posted: 04 June 2013 12:11 AM   Total Posts: 1

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_x00);
            var 
r_wall_pos Vector3D   = new Vector3D(m_asset_wall_offset_x00);
            
            
m_l_wall_shape = new AWPBoxShape(m_asset_wall_widthm_asset_size.ym_asset_size.z);
            
m_r_wall_shape = new AWPBoxShape(m_asset_wall_widthm_asset_size.ym_asset_size.z);
            
            
shape = new AWPCompoundShape();
            
shape.addChildShape(m_l_wall_shapel_wall_pos, new Vector3D());
            
shape.addChildShape(m_r_wall_shaper_wall_pos, new Vector3D());
            

            
            
rigidbody = new AWPRigidBody(shapemesh10);
            
rigidbody.gravity = new Vector3D();
            
            
super.initRigidbody(rigidbody);
            
            
rigidbody.WALL_Y_START;
            
rigidbody.+= 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(rigidbodySceneObject.GroundFloorGroupSceneObject.FloorCollisionMask);

            
m_constraint = new AWPGeneric6DofConstraint(rigidbodyrigidbody.position, new Vector3D());
            var 
low Vector3D  = new Vector3D(rigidbody.xrigidbody.yrigidbody.z);
            var 
high Vector3D = new Vector3D(rigidbody.xrigidbody.m_asset_slide_distancerigidbody.z);
            
m_constraint.setLinearLimit(lowhigh);
            
m_constraint.setAngularLimit(new Vector3D(000), new Vector3D(000));
            
m_constraint.getTranslationalLimitMotor().enableMotorY true;
            
m_constraint.getTranslationalLimitMotor().targetVelocity = new Vector3D(0300);
            
m_constraint.getTranslationalLimitMotor().maxMotorForce = new Vector3D(0100);
            
            
//rigidbody.position = new Vector3D(rigidbody.position.x, rigidbody.position.y + m_asset_slide_distance, rigidbody.position.z);
            
            
m_physicsWorld.addConstraint(m_constrainttrue); 
   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X