Pottej
21-05-2007 14:24:42
Hi,
I have been getting to grips with 0.4RC3 for a month or so and I've just got some questions about the character controller.
My character (capsule shape) moves around fine but seems to jerk occasionally, with his movement slightly stuttered (it isn't the framerate that causes this). I saw this mentioned in an older thread but I never saw if it got fixed. Is this just a problem with 0.4 in general, or is it more likely to be my implementation?
Also I know Betajaen said that the character controller got a big upgrade in 0.9, well what exactly are the changes? I am very tempted to start working out of the 0.9 SVN, but what features are currently missing compared to 0.4/0.6?
For someone quite new like me, would you recommend me using 0.4,0.6 or just going to 0.9?
Thanks,
Pottej
Pottej
22-05-2007 14:49:39
Bump bump Betajaen
What is the difference between character controller's in 0.9 from 0.4
Cheers!
Pottej
23-05-2007 17:35:12
Hi again,
I have been trying to port my code over to 0.9 but I am getting an access violation in the character controller creation. I really can't see what I'm doing wrong, the error seems to happen in the PhysX code itself.
I am creating the character like this:
mPlayerChar = mScene->createCharacter("Player_char",Vector3(0,100,0),"dimensions: 0.15 1, type: capsule");
The program compiles fine, but at run time I get:
Unhandled exception at 0x007b1245 (NxOgre_d.dll) in PracticeProj.exe: 0xC0000005: Access violation reading location 0x00000000.
The debugger is halting at the line
mCharacter->getActor()->setGroup(0);
Which is inside nxogrecharacter.cpp
All of the variables seem to be initialised OK so I can't really see what I'm doing wrong. I am using PhysX SDK 2.7.0 with system software 7.01.12.
Also whilst I am here I had a strange link error when trying to create a box:
Body* box = mScene->createBody(
"cube.mesh",
new NxOgre::CubeShape(1.0,""),
Vector3(0.0,5,0),
"scale: 0.01 0.01 0.01, density: 1.0"
);
Gives me the error:
1>Linking...
1>PlayState.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall NxOgre::CubeShape::CubeShape(float,class NxOgre::ShapeParams const &)" (__imp_??0CubeShape@NxOgre@@QAE@MABVShapeParams@1@@Z) referenced in function "private: void __thiscall PlayState::createScene(void)" (?createScene@PlayState@@AAEXXZ)
Input on any of these problems would be much appreciated
betajaen
23-05-2007 17:42:47
1. I have no idea about that one. Try changing the type to a box and see what happens.
2. Use new CubeShape(1,1,1) instead.
Pottej
23-05-2007 17:51:20
Cheers, I should have tried it myself before asking newbie questions!
The boxshape works, so is the capsule shape just not working at the moment or is it a problem on my end?
Pottej
betajaen
23-05-2007 18:08:34
Last time I checked it was working for me, I can have a stab at it next week, but if anyone else can check - please do.
Aiursrage2k
25-05-2007 05:48:52
I ran into the same type of problem.
There seems to be a solution (found at ageia forms).
If you update the camera at a different frequency than the PhysX, attaching the camera to a PhysX object is bound to give you issues unless you extrapolate the camera position. If the updates are even multiples of each other, such as camera updates at 60 Hz and PhysX at 30 Hz, you may not notice the problem. But when they are not even multiples, you with see a jerky camera.
The order will guarantee the poses from car and camera you are using are from the same frame.
fetchresult()
get new pose of the car
compute camera pose
render
http://devsupport.ageia.com/ics/support ... eptID=1949
Pottej
25-05-2007 12:54:54
Cheers for the advice, I'll look into it.
Isn't nxogre made such that the physics is updated exactly every frame though? So the render window and the physics world should be at the same frequency?
betajaen
25-05-2007 13:56:46
Yep, for every frame rendered in Ogre, NxOgre tells PhysX to simulate and render the difference in time since the last frame.