Stop moving obj use AWPGeneric6DofConstraint

Software: Away3D 4.x

Shine Chen, Newbie
Posted: 07 October 2014 01:27 PM   Total Posts: 2

The pushRigidbody use AWPGeneric6DofConstraint just moving a few times, and will stay stopping always.

generic6Dof = new AWPGeneric6DofConstraint(wallRigidbody, new Vector3D( 0, 0, -2800), new Vector3D(), _pushRigidbody, new Vector3D(0, 0,-2000), new Vector3D());

generic6Dof.setLinearLimit(new Vector3D(0, 0, 0), new Vector3D(0, 0, 2600));
generic6Dof.setAngularLimit(new Vector3D(0, 0, 0), new Vector3D(0, 0, 0));
generic6Dof.getTranslationalLimitMotor().enableMotorZ = true;
generic6Dof.getTranslationalLimitMotor().targetVelocity = new Vector3D(0, 0, 30);
generic6Dof.getTranslationalLimitMotor().maxMotorForce = new Vector3D(0, 0, 30000);
_physicsWorld.addConstraint(generic6Dof, true);
   
var 
timer : Timer = new Timer(3000);
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.start();

private function 
onTimer(e : TimerEvent) : void 
{
 
var vec : Number = generic6Dof.getTranslationalLimitMotor().targetVelocity.z;
 
generic6Dof.getTranslationalLimitMotor().targetVelocity = new Vector3D(0, 0, -vec);   
} 

The below issue was happen when I public this project to mobile devices.

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at adobe
.abc.GlobalOptimizer.createBlock(GlobalOptimizer.java:9949) 

(The attachment source code)

 

File Attachments
BasicTest.as  (File Size: 8KB - Downloads: 275)
   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X