Hello, I encountered a problem in awayphysics1.0alpha

Software: Away3D 4.x

Jonas, Newbie
Posted: 16 April 2013 02:16 PM   Total Posts: 1

i set collisionCallbackOn is true than rigidBody.addEventListener(AWPEvent.COLLISION_ADDED, collision);
when the collision occurred error

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at global/AWPC_Run::physicsStepInC()
at awayphysics.dynamics::AWPDynamicsWorld/step()[E:\ActionScript3\FProject\Maze\src\awayphysics\dynamics\AWPDynamicsWorld.as:334]
at Maze/enterFrame()[E:\ActionScript3\FProject\Maze\src\Maze.as:86]
thank…


thank…


this is my all code

private var _view:View3D;
  private var 
_physics:AWPDynamicsWorld;
  
  
  public function 
Maze()
  
{
   _view  
= new View3D();
   
this.addChild(_view);
   
   
_physics   = new AWPDynamicsWorld();
   
_physics.initWithDbvtBroadphase();
   
_physics.collisionCallbackOn true;
   
_physics.gravity = new Vector3D(0, -100);
   
   
   var 
floor:Mesh  = new Mesh(new CubeGeometry(10001001000));
   
_view.scene.addChild(floor);
   var 
awpBox:AWPBvhTriangleMeshShape = new AWPBvhTriangleMeshShape(floor.geometry);
   var 
rigidBody:AWPRigidBody = new AWPRigidBody(awpBoxfloor0);
   
rigidBody.addEventListener(AWPEvent.COLLISION_ADDEDcollision);
   
_physics.addRigidBody(rigidBody);
   
   
   var 
box:Mesh = new Mesh(new CubeGeometry(100100100), new ColorMaterial(0xff0000));
   
box.y   900;
   
_view.scene.addChild(box);
   var 
awpBox1:AWPBoxShape  = new AWPBoxShape(100100100);
   var 
rigidBody:AWPRigidBody = new AWPRigidBody(awpBox1box1);
   
rigidBody.y  900;
   
_physics.addRigidBody(rigidBody);
   
   
_view.camera.500;
   
_view.camera.= -1200;
   
this.addEventListener(Event.ENTER_FRAMEenterFrame);
  
}
  
  
  
  
  
//============================private function=============
  
  
  
  //============================protected function=============
  
  
  
  //============================event========================
  
  
private function collision(e:AWPEvent):void
  {
   
  }
  
  
private function enterFrame(e:Event):void
  {
   _view
.render();
   
_physics.step(60/1);
   
  

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X