[SOLVED]OGRE3DBody* getType() returns large integer

mamairaja

06-01-2010 05:04:50

OGRE3DBody* body = mRenderSystem->createBody(new NxOgre::Capsule(1.5,7), position, node, PhysicsDescription);

body ->getType();
returns a large integer. Is this unique for a body?

spacegaier

08-01-2010 08:28:11

This getType() is in fact inherited from NxOgre::RigidBody and should return any of these values (listed in NxOgreCommon.h):

enum RigidBodyType
{
RigidBodyType_Dynamic = -1, //!< RigidBody is likely to move.
RigidBodyType_Kinematic = -2, //!< RigidBody is likely to move, but it should not have the usual physics properties.
RigidBodyType_Geometry = -3, //!< RigidBody will never move.
RigidBodyType_Volume = -4, //!< RigidBody will never move, and others can pass through it.
RigidBodyType_Unknown = -5, //!< Unknown Type.
RigidBodyType_DynamicInherited = 0 //!< Non-NxOgre class that is dynamic.
};


And then there is also the method (this time from Ogre3DBody), getClassType() which can give more infromation about your body and should return any of these values (listed in Ogre3DCommon.h):
/** \brief This enum just stores an integer identifier for the OGRE3D classes. As some of these classes are
extensions of NxOgre ones. It would be useful to use the same allocator as NxOgre does. For
that, we need to define these classes we want to use as integers to use them in a PointerClass.
*/
enum
{
_OGRE3DRenderSystem = ::NxOgre::Classes::RENDERSYSTEMS_CLASSES_BEGIN + 100,
_OGRE3DBody,
_OGRE3DBodyPrototype,
_OGRE3DRenderable,
_OGRE3DPointRenderable,
_OGRE3DKinematicBody,
};

mamairaja

08-01-2010 17:31:05

Hi
Thank you for answring.
getType returns this number all the time. 4294967291100
Is this unique for a body? Let me state what my target is. If the ray hit a body I want to compare that body with a particular body. What I am doing now is using this getType() method and seems they are equal but do not know it is unique.
As you mention your post if it can be any value you mentioned it cannot be uniqu :(

betajaen

08-01-2010 18:03:43

"Type" refers to the class type. If you want to know if bodyA is bodyB then just compare the pointers.

mamairaja

09-01-2010 16:58:01

Thanx betajaen.
As you said. Comparing of NxActor pointers works fine for me. Thank you very much !!! :)

betajaen

09-01-2010 18:25:58

Or comparing the RigidBody pointers will do to. ;)