Away3D Forum 0 Copyright (c) 2013 ExpressionEngine tag:away3d.com,2013:04:16 Hello, I encountered a problem in awayphysics1.0alpha tag:away3d.com,2013:forum/viewthread/.4370 2013-04-16T14:16:24Z 0 Jonas 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);
   
  

 

]]>
generic6Dof.getRotationalLimitMotor(1).targetVelocity apparently capped at 8, on pinball flipper usage tag:away3d.com,2012:forum/viewthread/.3383 2012-10-17T13:53:02Z 2012-10-17T14:10:02Z salvador 1.
I need my pinball flippers, to turn faster. I had decided on using a generic6Dof, to use the rotationalLimitMotor to drive the flipping from its own guts, instead of being passively impulsed. In this way, on top I can easily link to limit the range of turning to 30 degrees.

Though I perceive a rotational speed increment as I increase targetVelocity, from 1 to 8, higher numbers result in no apparent turning speed.

In summary these two lines below yield the same physical result:
generic6Dof.getRotationalLimitMotor(1).targetVelocity =1;//slow
generic6Dof.getRotationalLimitMotor(1).targetVelocity =7;//faster
generic6Dof.getRotationalLimitMotor(1).targetVelocity =8;//fastest
generic6Dof.getRotationalLimitMotor(1).targetVelocity = 1000;//=8

I tried messing about with damping, force, etc…  but these seem to be not-operative.

How do I increase the turning speed?

2.
Another thing I would like to improve, is the way the flipper reaches its limits, it does it too softly, I would like to feel the sudden impact. I am not sure but this could be related to the problem above, bullet thinking that if it wants a soft landing on the angular limit, going over 8 would be impossible. I tried to affect this with the motor’s limitSoftness, bounce ... no perceivable effects that I could anchor on to infere a way into the model.

How do I make the flipper hit strongly its angular limit, without bouncing, in the spirit of real pinball machines?

I am starting to question the use of this generic6Dof, for this use, with fears that may be is modelled for vehicles which have lower accelerations than a pinball flipper. :-( The C documentation is as dry as it can be.

]]>
obj - AWPBvhTriangleMeshShape terrain problem tag:away3d.com,2013:forum/viewthread/.3930 2013-02-01T19:55:49Z 2013-02-01T20:01:29Z Luca Hi guys,

Someone can see and eventually correct this…
Here the source:
http://www.estiva2.altervista.org/Away3D/CarSampleMod1.7z

( the source contains two version of library incuded in the 7z file )

This is important for me… With version 4.1 i can load the right material or/and texture but the physics can’t work…

Thanks in advance smile

]]>
AWPDynamicsWorld deallocation tag:away3d.com,2013:forum/viewthread/.3870 2013-01-23T08:08:24Z 0 Denis AWPDynamicsWorld can not release memory.

//create
AWPWorld = new AWPDynamicsWorld();
AWPWorld.initWithDbvtBroadphase();
AWPWorld.gravity = new Vector3D(00, -10);

.
.
.
.
//deallocate
AWPWorld.cleanWorld(true);
AWPWorld.dispose();
AWPWorld null
]]>
AWPKinematicCharacterController Error tag:away3d.com,2012:forum/viewthread/.3106 2012-08-24T18:07:24Z 2012-08-24T18:08:04Z fxdev RangeError: Error #1125: Der Index 1181054049 liegt außerhalb des gültigen Bereichs 1182.
at cmodule.AwayPhysics::FSM__ZN12gjkepa2_impl3GJK8EvaluateERKNS_13MinkowskiDiffERK9btVector3/work()
at MethodInfo-4370()
at MethodInfo-4013()
at awayphysics.dynamics::AWPDynamicsWorld/step()
at com.cs.shooter3d.physics::PhysicsController/updatePhysicsWorld()
at com.cs.shooter3d.core::Core/render()

This happens if I add my Character :

var shape : AWPCylinderShape = new AWPCylinderShape(300, 500);
var ghostObject : AWPGhostObject = new AWPGhostObject(shape, core.camera3D);
ghostObject.collisionFlags = AWPCollisionFlags.CF_CHARACTER_OBJECT;

_character = new AWPKinematicCharacterController(ghostObject, 1);

Directly if I rotate my mouse. At the moment I only have this Character and the Terrain as Physic Objects. :(

]]>
AWPConvexHullShape error tag:away3d.com,2012:forum/viewthread/.2945 2012-07-28T18:50:15Z 0 ron~ Hi,

I’m getting an error while using more than 2 AWPConvexHullShapes.

Here is the error details:

RangeError: Error #1125: The index 1869182049 is out of range 1176.
at cmodule.AwayPhysics::FSM__ZN12gjkepa2_impl3GJK8EvaluateERKNS_13MinkowskiDiffERK9btVector3/work()
at Function/<anonymous>()
at Function/<anonymous>()
at awayphysics.dynamics::AWPDynamicsWorld/step()[F:expawdsrcawayphysicsdynamicsAWPDynamicsWorld.as:318]

If any body knows this issue, please let me know the reason

Thanks

 

 

]]>
AWPVehicle two wheels bug tag:away3d.com,2012:forum/viewthread/.2804 2012-07-16T13:13:47Z 0 JohnBrookes As an example…

Take the BvhTriangleMeshCarTest and remove the back two wheels.
https://raw.github.com/away3d/awayphysics-examples-fp11/master/src/BvhTriangleMeshCarTest.as
eg
comment out
176 -177

265-268

and change camera so you can see
274
_view.camera.position = car.getRigidBody().position.add(new Vector3D(500, 120, 100));

The wheels constantly rotate even though the car is static.

]]>
DRIV: (no view) tag:away3d.com,2012:forum/viewthread/.2821 2012-07-17T17:56:45Z 0 random Hi Everyone, and thank you very much for being here to hopefully answer a question for me.

Firstly I should note briefly that my goal is simply to get some type of relatively stable physics engine working with away3d.  I had done this previously with jiglib and away3d but it has been a few years and things seem to be changing rapidly.

After trying to mix-match every possible combination of jiglib with versions of away3d I started looking for alternatives, and so far awayphysics seemed easy enough to compile and the demos look promising.

I am trying to compile an example file with the latest packages I have found here:

Away3D
http://away3d.com/download/

AwayPhysics
https://github.com/away3d/awayphysics-core-fp11

And I am using Flex4.6 compiler on LInux. 

This set up works fine when compiling pure Away3D, but seems to have a problem when getting into physics.  However I can view the demos just fine, and everything else I’ve ever compiled with Flex 4.6 works just fine, so I’m hesitant to believe it is a problem with Linux or Flex.

I managed to get BasicTest.as and another example to compile, but when I view them they just have a black screen with the usage monitor, and next to DRIV it says: n/a (no view).

Do you know what might be wrong here?  Am I missing something?

Are there older more stable away3D + engine solutions that I could still find available somewhere?

]]>
removeRigidBody doesnt delete from memory tag:away3d.com,2012:forum/viewthread/.2750 2012-07-06T17:54:16Z 0 JohnBrookes A rigidbody or any collsionObject stays in memory after being removed from the physics world using either removeRigidBody or removeCollisionObject.

]]>
LinearVelocity = 0 on a moving object tag:away3d.com,2012:forum/viewthread/.2706 2012-06-29T08:18:37Z 0 GiGBiG I was working on a dice game: I created a method that recorded the simulation of the launch, and later replayed it.

When I was rendering the simulation always was ok, but when replaying the record sometimes happened that a dice stopped moving for a few frames, reappering later at the right sequence position.
I recorded the frames saving the position and the rotation of the dices, setting a minimum threshold for the linearVelocity of the dices: if linearVelocty is lower than it, do not save the position to reduce the sequence weight. Later after a few tests I discovered that sometimes AwayPhysics gives a rigid body the correct position, but a linearVelocity vector equal to (0, 0, 0), even if the frame is in the middle of the sequence. This is why the simulation was correct, but not the replay.

Is this a know bug? I haven’t got the code to show, as I had to hurry and replace that optimization with a different calculation, based on the previous frame to check the distance between two frames.

]]>