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, -10, 0);
var floor:Mesh = new Mesh(new CubeGeometry(1000, 100, 1000));
_view.scene.addChild(floor);
var awpBox:AWPBvhTriangleMeshShape = new AWPBvhTriangleMeshShape(floor.geometry);
var rigidBody:AWPRigidBody = new AWPRigidBody(awpBox, floor, 0);
rigidBody.addEventListener(AWPEvent.COLLISION_ADDED, collision);
_physics.addRigidBody(rigidBody);
var box:Mesh = new Mesh(new CubeGeometry(100, 100, 100), new ColorMaterial(0xff0000));
box.y = 900;
_view.scene.addChild(box);
var awpBox1:AWPBoxShape = new AWPBoxShape(100, 100, 100);
var rigidBody:AWPRigidBody = new AWPRigidBody(awpBox1, box, 1);
rigidBody.y = 900;
_physics.addRigidBody(rigidBody);
_view.camera.y = 500;
_view.camera.z = -1200;
this.addEventListener(Event.ENTER_FRAME, enterFrame);
}
//============================private function=============
//============================protected function=============
//============================event========================
private function collision(e:AWPEvent):void
{
}
private function enterFrame(e:Event):void
{
_view.render();
_physics.step(60/1);
}
]]>
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.
]]>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 ![]()
//create
AWPWorld = new AWPDynamicsWorld();
AWPWorld.initWithDbvtBroadphase();
AWPWorld.gravity = new Vector3D(0, 0, -10);
.
.
.
.
//deallocate
AWPWorld.cleanWorld(true);
AWPWorld.dispose();
AWPWorld = null;
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. :(
]]>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
]]>
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.
]]>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?
]]>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.
]]>