How to make a real motorcycle with awayphyesics?

Software: Away3D 4.x

liuyi, Member
Posted: 15 September 2011 02:45 AM   Total Posts: 65

I want to do a motorcycle race game.
can somebody give me some advises?
Have no idea now.

   

Avatar
Alejandro Santander, Administrator
Posted: 15 September 2011 04:39 PM   Total Posts: 414   [ # 1 ]

I have seen several vehicle (car) examples in AwayPhysics. I recommend checking the AwayPhysics examples at Github. There is even a vehicle class inherent in the AwayPhysics engine, so I reckon it should be very possible.

   

liuyi, Member
Posted: 16 September 2011 02:16 AM   Total Posts: 65   [ # 2 ]

Thanks
I have checked that and try to do the motorcycle.
BTW, how can we display the collision shape?
It’s very hard to set the width ,height and depth…

 

   

Avatar
Alejandro Santander, Administrator
Posted: 16 September 2011 04:30 PM   Total Posts: 414   [ # 3 ]

From another thread, I can see that Yang Li is working on a way to visually debug collision shapes, which should be very handy.

So far I am doing things like this regarding this matter:

In order to determine the dimensions of a rigid body that applies to a mesh, given that I know beforehand what kind of shape I need to use, I do:

aabb AxisAlignedBoundingBox(mesh.bounds);
     
shape = new AWPBoxShape(aabb.max.aabb.min.xaabb.max.aabb.min.yaabb.max.aabb.min.z); 

In order to imitate the transform of a mesh into its rigid body counterpart, I do:

private function objTransformToBodyTransform(obj:ObjectContainer3Dbody:AWPRigidBody):void
     {
   
const TO_DEGS:Number 180/Math.PI;

         var 
ms:Vector.<Vector3D> = obj.transform.decompose();
         var 
position:Vector3D ms[0];
         var 
rotation:Vector3D ms[1];
   var 
scale:Vector3D ms[2];
         var 
rot:Matrix3D = new Matrix3D();

         
rot.appendRotationrotation.TO_DEGSVector3D.X_AXIS );
         
rot.appendRotationrotation.TO_DEGSVector3D.Y_AXIS );
         
rot.appendRotationrotation.TO_DEGSVector3D.Z_AXIS );

   
body.position position;
         
body.rotation rot;
   
body.shape.setLocalScaling(scale._scalescale._scalescale._scale);
     
   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X