[BloodyMess 1.5.4] RigidBodyType_Kinematic does not work?

kaneyxt

20-05-2009 14:28:06

I try to create kinematic actor by flag RigidBodyType_Kinematic, but seems this flag does not work. The actor is still dynamic, it will fall down after I create it in the sky.
My code is as follows:

NxOgre_Namespace::RigidBodyDescription rbDesc;
rbDesc.mType = NxOgre_Namespace::Enums::RigidBodyType_Kinematic;
OGRE3DBody* testBody = mRenderSystem->createBody(new NxOgre_Namespace::Box(1.0), NxOgre_Namespace::Real3(0, 50, 0), "cube.1m.mesh", rbDesc);

Anybody has the same problem with me? Or do we have another way to create kinematic actor?

spacegaier

20-05-2009 14:50:37

OGRE3DKinematicBody *pBodyArm_01 = m_pRenderSystem->createKinematicBody(tgArm_01, NxOgre::Real3(-10, 8.5, 2.5), "Arm_01.mesh");

betajaen

20-05-2009 15:06:45

What SpaceGaier said;

The "mType" variable is off-limits to users, and any changes to it will be quickly undone when it meets Scene.

kaneyxt

20-05-2009 15:27:51

Get it! Thanks, man!

Actually, I have done it in another way:

#include "NxPhysics.h"
... ...
NxActor* PhysXActor = testBody->getNxActor();
PhysXActor->raiseBodyFlag(NX_BF_KINEMATIC);


This is some PhysX-NxOgre mixed up method. Anyway, I am much more familiar with PhysX than NxOgre. :)

betajaen

20-05-2009 16:14:02

Yes. But then your Actor/Body class has tons of functions that are useless and get in the way for the Kinematic Actor.