#ifndef NX_PHYSICS_NX_ACTOR #define NX_PHYSICS_NX_ACTOR /*----------------------------------------------------------------------------*\ | | Public Interface to NovodeX Technology | | www.novodex.com | \*----------------------------------------------------------------------------*/ /** \addtogroup physics @{ */ #include "Nxp.h" #include "NxArray.h" #include "NxBounds3.h" #include "NxActorDesc.h" #include "NxPhysicsSDK.h" class NxBodyDesc; class NxShapeDesc; class NxJoint; class NxShape; /** \brief NxActor is the main simulation object in the physics sdk. The actor is owned by and contained in a. NxScene. An actor may optionally encapsulate a dynamic rigid body by setting the body member of the actors descriptor when it is created. Otherwise the actor is static, it is fixed in the world).

Creation

Instances of this class are created by calling #NxScene::createActor() and deleted with #NxScene::releaseActor(). See #NxActorDescBase for a more detailed descriptiption of the parameters which can be set when creating an actor. Example (Static Actor): \include NxActor_CreateStatic.cpp Example (Dynamic Actor): \include NxActor_CreateDynamic.cpp

Visualizations

\li #NX_VISUALIZE_ACTOR_AXES \li #NX_VISUALIZE_BODY_AXES \li #NX_VISUALIZE_BODY_MASS_AXES \li #NX_VISUALIZE_BODY_LIN_VELOCITY \li #NX_VISUALIZE_BODY_ANG_VELOCITY \li #NX_VISUALIZE_BODY_LIN_MOMENTUM \li #NX_VISUALIZE_BODY_ANG_MOMENTUM \li #NX_VISUALIZE_BODY_LIN_ACCEL \li #NX_VISUALIZE_BODY_ANG_ACCEL \li #NX_VISUALIZE_BODY_LIN_FORCE \li #NX_VISUALIZE_BODY_ANG_FORCE \li #NX_VISUALIZE_BODY_REDUCED \li #NX_VISUALIZE_BODY_JOINT_GROUPS \li #NX_VISUALIZE_BODY_CONTACT_LIST \li #NX_VISUALIZE_BODY_JOINT_LIST \li #NX_VISUALIZE_BODY_DAMPING \li #NX_VISUALIZE_BODY_SLEEP @see NxActorDesc NxBodyDesc NxScene.createActor() NxScene.releaseActor() */ class NxActor { protected: NX_INLINE NxActor() : userData(NULL) {} virtual ~NxActor() {} public: /** \brief Retrieves the scene which this actor belongs to. \return Owner Scene. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxScene */ virtual NxScene& getScene() = 0; // Runtime modifications /** \brief Saves the state of the actor to the passed descriptor. This method does not save out any shapes belonging to the actor to the descriptor's shape vector, nor does it write to its body member. You have to iterate through the shapes of the actor and save them manually. In addition for dynamic actors you have to call the #saveBodyToDesc() method. \param[out] desc Descriptor to save object state to. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxActorDesc NxActorDescBase */ virtual void saveToDesc(NxActorDescBase& desc) = 0; /** \brief Sets a name string for the object that can be retrieved with getName(). This is for debugging and is not used by the SDK. The string is not copied by the SDK, only the pointer is stored. \param[in] name String to set the objects name to. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getName() */ virtual void setName(const char* name) = 0; /** \brief Retrieves the name string set with setName(). \return Name string associated with object. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setName() */ virtual const char* getName() const = 0; /************************************************************************************************/ /** @name Global Pose Manipulation */ //@{ /** \brief Methods for setting a dynamic actor's pose in the world. These methods instantaneously change the actor space to world space transformation. One should exercise restraint in making use of these methods. Static actors should not be moved at all. There are various internal data structures for static actors which may need to be recomputed when one moves. Also, moving static actors will not interact correctly with dynamic actors or joints. If you would like to directly control an actor's position and would like to have it correctly interact with dynamic bodies and joints, you should create a dynamic body with the NX_BF_KINEMATIC flag, and then use the moveGlobal*() commands to move it along a path! When briefly moving dynamic actors, one should not: \li Move actors into other actors, thus causing interpenetration (an invalid physical state) \li Move an actor that is connected by a joint to another away from the other (thus causing joint error) \li When moving jointed actors the joints' cached transform information is destroyed and recreated next frame; thus this call is expensive for jointed actors. setGlobalPose(m) has the same effect as calling setGlobalOrientation(m.M); and setGlobalPosition(m.t); but setGlobalPose() may be faster as it doesn't recompute some internal values twice. Sleeping: This call wakes the actor if it is sleeping. \param[in] mat Transformation from the actors local frame to the global frame. Range: rigid body transform. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getGlobalPose() setGlobalPosition() setGlobalOrientation() getGlobalPose() */ virtual void setGlobalPose(const NxMat34& mat) = 0; /** \brief Sets a dynamic actor's position in the world. see ::setGlobalPose() for information. Sleeping: This call wakes the actor if it is sleeping. \param[in] vec New position for the actors frame relative to the global frame. Range: position vector Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setGlobalPose() setGlobalOrientation() getGlobalPosition() */ virtual void setGlobalPosition(const NxVec3& vec) = 0; /** \brief Sets a dynamic actor's orientation in the world. see ::setGlobalPose() for information. Sleeping: This call wakes the actor if it is sleeping. \param[in] mat New orientation for the actors frame. Range: rotation matrix. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setGlobalPose() setGlobalPosition() getGlobalOrientation() setGlobalOrientationQuat() */ virtual void setGlobalOrientation(const NxMat33& mat) = 0; /** \brief Sets a dynamic actor's orientation in the world. see ::setGlobalPose() for information. Sleeping: This call wakes the actor if it is sleeping. \param[in] mat New orientation for the actors frame. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setGlobalOrientation() getGlobalOrientation() setGlobalPose() */ virtual void setGlobalOrientationQuat(const NxQuat& mat) = 0; /** \brief Retrieves the actors world space transform. The getGlobal*() methods retrieve the actor's current actor space to world space transformation. \return Global pose matrix of object. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setGlobalPose() getGlobalPosition() getGlobalOrientation() */ virtual NxMat34 getGlobalPose() const = 0; /** \brief Retrieves the actors world space position. The getGlobal*() methods retrieve the actor's current actor space to world space transformation. \return Global position of object. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setGlobalPosition() getGlobalPose() getGlobalOrientation() */ virtual NxVec3 getGlobalPosition() const = 0; /** \brief Retrieves the actors world space orientation. The getGlobal*() methods retrieve the actor's current actor space to world space transformation. \return Global orientation of object. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getGlobalOrientationQuat() setGlobalOrientation() getGlobalPose() getGlobalPosition() */ virtual NxMat33 getGlobalOrientation() const = 0; /** \brief Retrieves the actors world space orientation. The getGlobal*() methods retrieve the actor's current actor space to world space transformation. \return Global orientation of the actor as a quaternion. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getGlobalOrientation() setGlobalOrientation() getGlobalPose() getGlobalPosition() */ virtual NxQuat getGlobalOrientationQuat()const = 0; /************************************************************************************************/ //@} /** @name Kinematic Actors */ //@{ /** \brief The moveGlobal* calls serve to move kinematically controlled dynamic actors through the game world. You set a dynamic actor to be kinematic using the NX_BF_KINEMATIC body flag, used either in the NxBodyDesc or with raiseBodyFlag(). The move command will result in a velocity that, when successfully carried out (i.e. the motion is not blocked due to joints or collisions) inside run*(), will move the body into the desired pose. After the move is carried out during a single time step, the velocity is returned to zero. Thus, you must continuously call this in every time step for kinematic actors so that they move along a path. These functions simply store the move destination until run*() is called, so consecutive calls will simply overwrite the stored target variable. Note that in the future we will provide a mechanism for the motion to be blocked in certain cases (such as when a box jams in an automatic door), but currently the motion is always fully carried out. Sleeping: This call wakes the actor if it is sleeping. \param[in] mat The desired pose for the kinematic actor, in the global frame. Range: rigid body transform. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see moveGlobalPosition() moveGlobalOrientation() moveGlobalOrientationQuat() NxBodyFlag raiseBodyFlag() NxBodyDesc.flags */ virtual void moveGlobalPose(const NxMat34& mat) = 0; /** \brief The moveGlobal* calls serve to move kinematically controlled dynamic actors through the game world. See ::moveGlobalPose() for more information. Sleeping: This call wakes the actor if it is sleeping. \param[in] vec The desired position for the kinematic actor, in the global frame. Range: position vector Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see moveGlobalPose() moveGlobalOrientation() moveGlobalOrientationQuat() NxBodyFlag raiseBodyFlag() NxBodyDesc.flags */ virtual void moveGlobalPosition(const NxVec3& vec) = 0; /** \brief The moveGlobal* calls serve to move kinematically controlled dynamic actors through the game world. See ::moveGlobalPose() for more information. Sleeping: This call wakes the actor if it is sleeping. \param[in] mat The desired orientation for the kinematic actor, in the global frame. Range: rotation matrix. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see moveGlobalOrientationQuat() moveGlobalPosition() moveGlobalPose() NxBodyFlag raiseBodyFlag() NxBodyDesc.flags */ virtual void moveGlobalOrientation(const NxMat33& mat) = 0; /** \brief The moveGlobal* calls serve to move kinematically controlled dynamic actors through the game world. See ::moveGlobalPose() for more information. Sleeping: This call wakes the actor if it is sleeping. \param[in] quat The desired orientation quaternion for the kinematic actor, in the global frame. @see moveGlobalPosition() moveGlobalOrientation() moveGlobalPose() NxBodyFlag raiseBodyFlag() NxBodyDesc.flags */ virtual void moveGlobalOrientationQuat(const NxQuat& quat) = 0; /************************************************************************************************/ //@} /** @name Shapes */ //@{ /** \brief Creates a new shape and adds it to the list of shapes of this actor. This invalidates the pointer returned by getShapes(). Note: mass properties of dynamic actors will not automatically be recomputed to reflect the new mass distribution implied by the shape. Follow this call with a call to updateMassFromShapes() to do that. Sleeping: Does NOT wake the actor up automatically. \param[in] desc The descriptor for the new shape. See eg #NxSphereShapeDesc. \return The newly create shape. Platform: \li PC SW: Yes \li PPU : Partial (Compounds not supported) \li PS3 : Yes \li XB360: Yes @see NxShape NxShapeDesc @see NxBoxShape NxCapsuleShape NxConvexShape NxPlaneShape NxSphereShape NxTriangleMeshShape NxWheelShape */ virtual NxShape* createShape(const NxShapeDesc& desc) = 0; /** \brief Deletes the specified shape. This invalidates the pointer returned by getShapes(). Sleeping: Does NOT wake the actor up automatically. \param[in] shape Shape to be released. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxShape @see NxBoxShape NxCapsuleShape NxConvexShape NxPlaneShape NxSphereShape NxTriangleMeshShape NxWheelShape */ virtual void releaseShape(NxShape& shape) = 0; /** \brief Returns the number of shapes assigned to the actor. You can use #getShapes() to retrieve an array of shape pointers. \return Number of shapes associated with this actor. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxShape getShapes() */ virtual NxU32 getNbShapes() const = 0; /** \brief Returns an array of shape pointers belonging to the actor. These are the shapes used by the actor for collision detection. You can retrieve the number of shape pointers by calling #getNbShapes() Note: Adding or removing shapes with #createShape() or #releaseShape() will invalidate the pointer. \return Array of shapes which are associated with this actor. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxShape getNbShapes() createShape() releaseShape() */ virtual NxShape*const * getShapes() const = 0; /************************************************************************************************/ //@} /** \brief Assigns the actor to a user defined group of actors. NxActorGroup is a 16 bit group identifier. This is similar to ?#NxShape groups, except those are only five bits and serve a different purpose. The NxScene::setActorGroupPairFlags() lets you set certain behaviors for pairs of actor groups. By default every actor is created in group 0. Sleeping: Does NOT wake the actor up automatically. \param[in] actorGroup The actor group flags. Platform: \li PC SW: Yes \li PPU : No \li PS3 : Yes \li XB360: Yes @see getGroup() NxActorGroup */ virtual void setGroup(NxActorGroup actorGroup) = 0; /** \brief Retrieves the value set with setGroup(). \return The group ID of this actor. Platform: \li PC SW: Yes \li PPU : No \li PS3 : Yes \li XB360: Yes @see setGroup() NxActorGroup */ virtual NxActorGroup getGroup() const = 0; /** \brief Raises a particular actor flag. See the list of flags #NxActorFlag Sleeping: Does NOT wake the actor up automatically. \param[in] actorFlag The actor flag to raise(set). See #NxActorFlag. Platform: \li PC SW: Yes \li PPU : No \li PS3 : Yes \li XB360: Yes @see NxActorFlag clearActorFlag() readActorFlag() NxActorDesc.flags */ virtual void raiseActorFlag(NxActorFlag actorFlag) = 0; /** \brief Clears a particular actor flag. See the list of flags #NxActorFlag Sleeping: Does NOT wake the actor up automatically. \param[in] actorFlag The actor flag to clear. See #NxActorFlag. Platform: \li PC SW: Yes \li PPU : No \li PS3 : Yes \li XB360: Yes @see NxActorFlag raiseActorFlag() readActorFlag() NxActorDesc.flags */ virtual void clearActorFlag(NxActorFlag actorFlag) = 0; /** \brief Reads a particular actor flag. See the list of flags #NxActorFlag \param[in] actorFlag The actor flag to retrieve. See #NxActorFlag. \return The value of the actor flag. Platform: \li PC SW: Yes \li PPU : No \li PS3 : Yes \li XB360: Yes @see NxActorFlag raiseActorFlag() clearActorFlag() NxActorDesc.flags */ virtual bool readActorFlag(NxActorFlag actorFlag) const = 0; /** \brief Returns true if the actor is dynamic. \return True if this is a dynamic actor. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxBodyDesc */ virtual bool isDynamic() const = 0; /************************************************************************************************/ /** @name Mass Manipulation */ //@{ /** \brief The setCMassOffsetLocal*() methods set the pose of the center of mass relative to the actor. Methods that automatically compute the center of mass such as updateMassFromShapes() as well as computing the mass and inertia using the actors shapes, will set this pose automatically. The actor must be dynamic. \note Changing this transform will not move the actor in the world! \note Setting an unrealistic center of mass which is a long way from the body can make it difficult for the SDK to solve constraints. Perhaps leading to instability and jittering bodies. Sleeping: This call wakes the actor if it is sleeping. \param[in] mat Mass frame offset transform relative to the actor frame. Range: rigid body transform. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setCMassOffsetLocalPosition() setCMassOffsetLocalOrientation() setCMassOffsetGlobalPose() @see NxBodyDesc.massLocalPose */ virtual void setCMassOffsetLocalPose(const NxMat34& mat) = 0; /** \brief The setCMassOffsetLocal*() methods set the pose of the center of mass relative to the actor. The actor must be dynamic. See ::setCMassOffsetLocalPose() for more information. \note Setting an unrealistic center of mass which is a long way from the body can make it difficult for the SDK to solve constraints. Perhaps leading to instability and jittering bodies. Sleeping: This call wakes the actor if it is sleeping. \param[in] vec Mass frame offset relative to the actor frame. Range: position vector Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setCMassOffsetLocalPose() setCMassOffsetLocalOrientation() setCMassOffsetGlobalPose() @see NxBodyDesc.massLocalPose */ virtual void setCMassOffsetLocalPosition(const NxVec3& vec) = 0; /** \brief The setCMassOffsetLocal*() methods set the pose of the center of mass relative to the actor. The actor must be dynamic. See ::setCMassOffsetLocalPose() for more information. Sleeping: This call wakes the actor if it is sleeping. \param[in] mat Mass frame orientation offset relative to the actor frame. Range: rotation matrix. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setCMassOffsetLocalPose() setCMassOffsetLocalPosition() setCMassOffsetGlobalPose() @see NxBodyDesc.massLocalPose */ virtual void setCMassOffsetLocalOrientation(const NxMat33& mat) = 0; /** \brief The setCMassOffsetGlobal*() methods set the pose of the center of mass relative to world space. Note that this will simply transform the parameter to actor space and then call setCMassLocal*(). In other words it only shifts the center of mass but does not move the actor. The actor must be dynamic. \note Setting an unrealistic center of mass which is a long way from the body can make it difficult for the SDK to solve constraints. Perhaps leading to instability and jittering bodies. Sleeping: This call wakes the actor if it is sleeping. \param[in] mat Mass frame offset transform relative to the global frame. Range: rigid body transform. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setCMassOffsetGlobalPosition() setCMassOffsetGlobalOrientation() @see NxBodyDesc.massLocalPose */ virtual void setCMassOffsetGlobalPose(const NxMat34& mat) = 0; /** \brief The setCMassOffsetGlobal*() methods set the pose of the center of mass relative to world space. The actor must be dynamic. See ::setCMassOffsetGlobalPose() for more information. \note Setting an unrealistic center of mass which is a long way from the body can make it difficult for the SDK to solve constraints. Perhaps leading to instability and jittering bodies. Sleeping: This call wakes the actor if it is sleeping. \param[in] vec Mass frame offset relative to the global frame. Range: position vector Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setCMassOffsetGlobalPose() setCMassOffsetGlobalOrientation() @see NxBodyDesc.massLocalPose */ virtual void setCMassOffsetGlobalPosition(const NxVec3& vec) = 0; /** \brief The setCMassOffsetGlobal*() methods set the pose of the center of mass relative to world space. The actor must be dynamic. See ::setCMassOffsetGlobalPose() for more information. Sleeping: This call wakes the actor if it is sleeping. \param[in] mat Mass frame orientation offset relative to the global frame. Range: rotation matrix. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setCMassOffsetGlobalPose() setCMassOffsetGlobalPosition() @see NxBodyDesc.massLocalPose */ virtual void setCMassOffsetGlobalOrientation(const NxMat33& mat) = 0; /** \brief The setCMassGlobal*() methods move the actor by setting the pose of the center of mass. Here the transform between the center of mass and the actor frame is held fixed and the actor to world transform is updated. The actor must be dynamic. Sleeping: This call wakes the actor if it is sleeping. \param[in] mat Actors new pose, from the transformation of the mass frame to the global frame. Range: rigid body transform. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setCMassGlobalPosition() setCMassGlobalOrientation() getCMassLocalPose() @see NxBodyDesc.massLocalPose */ virtual void setCMassGlobalPose(const NxMat34& mat) = 0; /** \brief The setCMassGlobal*() methods move the actor by setting the pose of the center of mass. The actor must be dynamic. See ::setCMassGlobalPose() for more information. Sleeping: This call wakes the actor if it is sleeping. \param[in] vec Actors new position, from the transformation of the mass frame to the global frame. Range: position vector Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setCMassGlobalPose() setCMassGlobalOrientation() getCMassLocalPose() @see NxBodyDesc.massLocalPose */ virtual void setCMassGlobalPosition(const NxVec3& vec) = 0; /** \brief The setCMassGlobal*() methods move the actor by setting the pose of the center of mass. The actor must be dynamic. See ::setCMassGlobalPose() for more information. Sleeping: This call wakes the actor if it is sleeping. \param[in] mat Actors new orientation, from the transformation of the mass frame to the global frame. Range: rotation matrix. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setCMassGlobalPose() setCMassGlobalPosition() getCMassLocalPose() @see NxBodyDesc.massLocalPose */ virtual void setCMassGlobalOrientation(const NxMat33& mat) = 0; /** \brief The getCMassLocal*() methods retrieve the center of mass pose relative to the actor. The actor must be dynamic. \return The centre of mass pose relative to the actor. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getCMassLocalPosition() getCMassLocalOrientation() getCMassGlobalPose() @see NxBodyDesc.massLocalPose */ virtual NxMat34 getCMassLocalPose() const = 0; /** \brief The getCMassLocal*() methods retrieve the center of mass pose relative to the actor. The actor must be dynamic. \return The centre of mass position relative to the actor. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getCMassLocalPose() getCMassLocalOrientation() getCMassGlobalPose() @see NxBodyDesc.massLocalPose */ virtual NxVec3 getCMassLocalPosition() const = 0; /** \brief The getCMassLocal*() methods retrieve the center of mass pose relative to the actor. The actor must be dynamic. \return The mass orientation relative to the actors frame. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getCMassLocalPose() getCMassLocalPosition() getCMassGlobalPose() @see NxBodyDesc.massLocalPose */ virtual NxMat33 getCMassLocalOrientation() const = 0; /** \brief The getCMassGlobal*() methods retrieve the center of mass pose in world space. The actor must be dynamic. \return The Mass transform for this actor relative to the global frame. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getCMassGlobalPosition() getCMassGlobalOrientation() getCMassLocalPose() @see NxBodyDesc.massLocalPose */ virtual NxMat34 getCMassGlobalPose() const = 0; /** \brief The getCMassGlobal*() methods retrieve the center of mass pose in world space. The actor must be dynamic. \return The position of the centre of mass relative to the global frame. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getCMassGlobalPose() getCMassGlobalOrientation() getCMassLocalPose() @see NxBodyDesc.massLocalPose */ virtual NxVec3 getCMassGlobalPosition() const = 0; /** \brief The getCMassGlobal*() methods retrieve the center of mass pose in world space. The actor must be dynamic. \return The orientation of the mass frame relative to the global frame. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getCMassGlobalPose() getCMassGlobalPosition() getCMassLocalPose() @see NxBodyDesc.massLocalPose */ virtual NxMat33 getCMassGlobalOrientation() const = 0; /** \brief Sets the mass of a dynamic actor. The mass must be positive and the actor must be dynamic. Sleeping: Does NOT wake the actor up automatically. \param[in] mass New mass value for the actor. Range: (0,inf) Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getMass() NxBodyDesc.mass setMassSpaceInertiaTensor() */ virtual void setMass(NxReal mass) = 0; /** \brief Retrieves the mass of the actor. Static actors will always return 0. \return The mass of this actor. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setMass() NxBodyDesc.mass setMassSpaceInertiaTensor() */ virtual NxReal getMass() const = 0; /** \brief Sets the inertia tensor, using a parameter specified in mass space coordinates. Note that such matrices are diagonal -- the passed vector is the diagonal. If you have a non diagonal world/actor space inertia tensor(3x3 matrix). Then you need to diagonalize it and set an appropriate mass space transform. See #setCMassOffsetLocalPose(). The actor must be dynamic. Sleeping: Does NOT wake the actor up automatically. \param[in] m New mass space inertia tensor for the actor. Range: inertia vector Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxBodyDesc.massSpaceInertia getMassSpaceInertia() setMass() setCMassOffsetLocalPose() */ virtual void setMassSpaceInertiaTensor(const NxVec3& m) = 0; /** \brief Retrieves the diagonal inertia tensor of the actor relative to the mass coordinate frame. This method retrieves a mass frame inertia vector. If you want a global frame inertia tensor(3x3 matrix), then see #getGlobalInertiaTensor(). The actor must be dynamic. \return The mass space inertia tensor of this actor. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxBodyDesc.massSpaceInertia setMassSpaceInertiaTensor() setMass() CMassOffsetLocalPose() */ virtual NxVec3 getMassSpaceInertiaTensor() const = 0; /** \brief Retrieves the inertia tensor of the actor relative to the world coordinate frame. The actor must be dynamic. \return The global frame inertia tensor of this actor. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getGlobalInertiaTensorInverse() NxBodyDesc.massSpaceInertia setMassSpaceInertiaTensor() */ virtual NxMat33 getGlobalInertiaTensor() const = 0; /** \brief Retrieves the inverse of the inertia tensor of the actor relative to the world coordinate frame. The actor must be dynamic. \return The inverse of the inertia tensor in the global frame. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getGlobalInertiaTensor() NxBodyDesc.massSpaceInertia setMassSpaceInertiaTensor() */ virtual NxMat33 getGlobalInertiaTensorInverse() const = 0; /** \brief Recomputes a dynamic actor's mass properties from its shapes Given a constant density or total mass, the actors mass properties can be recomputed using the shapes attached to the actor. If you want to compute the mass properties based on a total mass specify a total mass and set density to zero. Alternativly specify a density and set totalMass to zero. If a density is supplied the mass is calculated based on the total mass of the shapes multiplied by the supplied density. The mass of each shape is either the shape's local density (default 1.0) multiplied by the shape's volume or a directly specified shape mass. The inertia tensor, mass frame and center of mass will always be recomputed. The actor must be dynamic. \param[in] density Density of the shapes belonging to the actor(or zero). Range: (0,inf) \param[in] totalMass Total mass of the actor(or zero). Range: (0,inf) Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxActorDesc NxBodyDesc NxBodyDesc.mass NxActorDesc.density NxActorDesc.lockCOM */ virtual void updateMassFromShapes(NxReal density, NxReal totalMass) = 0; //@} /************************************************************************************************/ /** @name Damping */ //@{ /** \brief Sets the linear damping coefficient. Zero represents no damping. The damping coefficient must be nonnegative. The actor must be dynamic. Default: 0. \param[in] linDamp Linear damping coefficient. Range: [0,inf) Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getLinearDamping() setAngularDamping() NxBodyDesc.linearDamping */ virtual void setLinearDamping(NxReal linDamp) = 0; /** \brief Retrieves the linear damping coefficient. The actor must be dynamic. \return The linear damping coefficient associated with this actor. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setLinearDamping() getAngularDamping() NxBodyDesc.linearDamping */ virtual NxReal getLinearDamping() const = 0; /** \brief Sets the angular damping coefficient. Zero represents no damping. The angular damping coefficient must be nonnegative. The actor must be dynamic. Default: 0.05 \param[in] angDamp Angular damping coefficient. Range: [0,inf) Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getAngularDamping() NxBodyDesc.angularDamping setLinearDamping() */ virtual void setAngularDamping(NxReal angDamp) = 0; /** \brief Retrieves the angular damping coefficient. The actor must be dynamic. \return The angular damping coefficient associated with this actor. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setAngularDamping() NxBodyDesc.angularDamping getLinearDamping() */ virtual NxReal getAngularDamping() const = 0; //@} /************************************************************************************************/ /** @name Velocity */ //@{ /** \brief Sets the linear velocity of the actor. Note that if you continuously set the velocity of an actor yourself, forces such as gravity or friction will not be able to manifest themselves, because forces directly influence only the velocity/momentum of an actor. The actor must be dynamic. Sleeping: This call wakes the actor if it is sleeping. \param[in] linVel New linear velocity of actor. Range: velocity vector Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getLinearVelocity() setAngularVelocity() NxBodyDesc.linearVelocity */ virtual void setLinearVelocity(const NxVec3& linVel) = 0; /** \brief Sets the angular velocity of the actor. Note that if you continuously set the angular velocity of an actor yourself, forces such as friction will not be able to rotate the actor, because forces directly influence only the velocity/momentum. The actor must be dynamic. Sleeping: This call wakes the actor if it is sleeping. \param[in] angVel New angular velocity of actor. Range: angular velocity vector Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getAngularVelocity() setLinearVelocity() NxBodyDesc.angularVelocity */ virtual void setAngularVelocity(const NxVec3& angVel) = 0; /** \brief Retrieves the linear velocity of an actor. The actor must be dynamic. \return The linear velocity of the actor. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setLinearVelocity() getAngularVelocity() NxBodyDesc.linearVelocity */ virtual NxVec3 getLinearVelocity() const = 0; /** \brief Retrieves the angular velocity of the actor. The actor must be dynamic. \return The angular velocity of the actor. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setAngularVelocity() getLinearVelocity() NxBodyDesc.angularVelocity */ virtual NxVec3 getAngularVelocity() const = 0; /** \brief Lets you set the maximum angular velocity permitted for this actor. Because for various internal computations, very quickly rotating actors introduce error into the simulation, which leads to undesired results. With NxPhysicsSDK::setParameter(MAX_ANGULAR_VELOCITY) you can set the default maximum velocity for actors created after the call. Bodies' high angular velocities are clamped to this value. However, because some actors, such as car wheels, should be able to rotate quickly, you can override the default setting on a per-actor basis with the below call. Note that objects such as wheels which are approximated with spherical or other smooth collision primitives can be simulated with stability at a much higher angular velocity than, say, a box that has corners. The actor must be dynamic. \param[in] maxAngVel Max allowable angular velocity for actor. Range: (0,inf) Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getMaxAngularVelocity() NxBodyDesc.maxAngularVelocity */ virtual void setMaxAngularVelocity(NxReal maxAngVel) = 0; /** \brief Retrieves the maximum angular velocity permitted for this actor. \return The maximum allowed angular velocity for this actor. The actor must be dynamic. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setMaxAngularVelocity NxBodyDesc.maxAngularVelocity */ virtual NxReal getMaxAngularVelocity() const = 0; //@} /************************************************************************************************/ /** @name CCD */ //@{ /** \brief Sets the CCD Motion Threshold. If CCD is globally enabled (parameter NX_CONTINUOUS_CD), it is still skipped for bodies which have no point on any of their shapes moving more than CCDMotionThreshold distance in one time step. Hence, CCD is always performed if the threshold is 0. The actor must be dynamic and the CCD motion threshold must be non-negative.

Visulizations:

\li #NX_VISUALIZE_COLLISION_CCD \li #NX_VISUALIZE_COLLISION_SKELETONS \param[in] thresh CCD Motion threshold. Range: [0,inf) Platform: \li PC SW: Yes \li PPU : No \li PS3 : Yes \li XB360: Yes @see getCCDMotionThreshold NxParameter */ virtual void setCCDMotionThreshold(NxReal thresh) = 0; /** \brief Retrieves the CCD Motion threshold for this actor. \return The CCD threshold for the actor. The actor must be dynamic. Platform: \li PC SW: Yes \li PPU : No \li PS3 : Yes \li XB360: Yes @see setCCDMotionThreshold NxParameter */ virtual NxReal getCCDMotionThreshold() const = 0; //@} /************************************************************************************************/ /** @name Momentum */ //@{ /** \brief Sets the linear momentum of the actor. Note that if you continuously set the linear momentum of an actor yourself, forces such as gravity or friction will not be able to manifest themselves, because forces directly influence only the velocity/momentum of a actor. The actor must be dynamic. Sleeping: This call wakes the actor if it is sleeping. \param[in] linMoment New linear momentum. Range: momentum vector Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getLinearMomentum() setAngularMomentum() */ virtual void setLinearMomentum(const NxVec3& linMoment) = 0; /** \brief Sets the angular momentum of the actor. Note that if you continuously set the angular velocity of an actor yourself, forces such as friction will not be able to rotate the actor, because forces directly influence only the velocity of actor. The actor must be dynamic. Sleeping: This call wakes the actor if it is sleeping. \param[in] angMoment New angular momentum. Range: angular momentum vector Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getAngularMomentum() setLinearMomentum() */ virtual void setAngularMomentum(const NxVec3& angMoment) = 0; /** \brief Retrieves the linear momentum of an actor. The momentum is equal to the velocity times the mass. The actor must be dynamic. \return The linear momentum for the actor. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setLinearMomentum() getAngularMomentum() */ virtual NxVec3 getLinearMomentum() const = 0; /** \brief Retrieves the angular velocity of an actor. The angular momentum is equal to the angular velocity times the global space inertia tensor. The actor must be dynamic. \return The angular momentum for the actor. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see setAngularMomentum() getLinearMomentum() */ virtual NxVec3 getAngularMomentum() const = 0; //@} /************************************************************************************************/ /** @name Forces */ //@{ /** \brief Applies a force (or impulse) defined in the global coordinate frame, acting at a particular point in global coordinates, to the actor. Note that if the force does not act along the center of mass of the actor, this will also add the corresponding torque. Because forces are reset at the end of every timestep, you can maintain a total external force on an object by calling this once every frame. ::NxForceMode determines if the force is to be conventional or impulsive. The actor must be dynamic. Sleeping: This call wakes the actor if it is sleeping. \param[in] force Force/impulse to add, defined in the global frame. Range: force vector \param[in] pos Position in the global frame to add the force at. Range: position vector \param[in] mode The mode to use when applying the force/impulse(see #NxForceMode) Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxForceMode @see addForceAtLocalPos() addLocalForceAtPos() addLocalForceAtLocalPos() addForce() addLocalForce() */ virtual void addForceAtPos(const NxVec3& force, const NxVec3& pos, NxForceMode mode = NX_FORCE) = 0; /** \brief Applies a force (or impulse) defined in the global coordinate frame, acting at a particular point in local coordinates, to the actor. Note that if the force does not act along the center of mass of the actor, this will also add the corresponding torque. Because forces are reset at the end of every timestep, you can maintain a total external force on an object by calling this once every frame. ::NxForceMode determines if the force is to be conventional or impulsive. The actor must be dynamic. Sleeping: This call wakes the actor if it is sleeping. \param[in] force Force/impulse to add, defined in the global frame. Range: force vector \param[in] pos Position in the local frame to add the force at. Range: position vector \param[in] mode The mode to use when applying the force/impulse(see #NxForceMode) Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxForceMode @see addForceAtPos() addLocalForceAtPos() addLocalForceAtLocalPos() addForce() addLocalForce() */ virtual void addForceAtLocalPos(const NxVec3& force, const NxVec3& pos, NxForceMode mode = NX_FORCE) = 0; /** \brief Applies a force (or impulse) defined in the actor local coordinate frame, acting at a particular point in global coordinates, to the actor. Note that if the force does not act along the center of mass of the actor, this will also add the corresponding torque. Because forces are reset at the end of every timestep, you can maintain a total external force on an object by calling this once every frame. ::NxForceMode determines if the force is to be conventional or impulsive. The actor must be dynamic. Sleeping: This call wakes the actor if it is sleeping. \param[in] force Force/impulse to add, defined in the local frame. Range: force vector \param[in] pos Position in the global frame to add the force at. Range: position vector \param[in] mode The mode to use when applying the force/impulse(see #NxForceMode) Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxForceMode @see addForceAtPos() addForceAtLocalPos() addLocalForceAtLocalPos() addForce() addLocalForce() */ virtual void addLocalForceAtPos(const NxVec3& force, const NxVec3& pos, NxForceMode mode = NX_FORCE) = 0; /** \brief Applies a force (or impulse) defined in the actor local coordinate frame, acting at a particular point in local coordinates, to the actor. Note that if the force does not act along the center of mass of the actor, this will also add the corresponding torque. Because forces are reset at the end of every timestep, you can maintain a total external force on an object by calling this once every frame. ::NxForceMode determines if the force is to be conventional or impulsive. The actor must be dynamic. Sleeping: This call wakes the actor if it is sleeping. \param[in] force Force/impulse to add, defined in the local frame. Range: force vector \param[in] pos Position in the local frame to add the force at. Range: position vector \param[in] mode The mode to use when applying the force/impulse(see #NxForceMode) Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxForceMode @see addForceAtPos() addForceAtLocalPos() addLocalForceAtPos() addForce() addLocalForce() */ virtual void addLocalForceAtLocalPos(const NxVec3& force, const NxVec3& pos, NxForceMode mode = NX_FORCE) = 0; /** \brief Applies a force (or impulse) defined in the global coordinate frame to the actor. This will not induce a torque. ::NxForceMode determines if the force is to be conventional or impulsive. The actor must be dynamic. Sleeping: This call wakes the actor if it is sleeping. \param[in] force Force/Impulse to apply defined in the global frame. Range: force vector \param[in] mode The mode to use when applying the force/impulse(see #NxForceMode) Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxForceMode @see addForceAtPos() addForceAtLocalPos() addLocalForceAtPos() addLocalForceAtLocalPos() addLocalForce() */ virtual void addForce(const NxVec3& force, NxForceMode mode = NX_FORCE) = 0; /** \brief Applies a force (or impulse) defined in the actor local coordinate frame to the actor. This will not induce a torque. ::NxForceMode determines if the force is to be conventional or impulsive. The actor must be dynamic. Sleeping: This call wakes the actor if it is sleeping. \param[in] force Force/Impulse to apply defined in the local frame. Range: force vector \param[in] mode The mode to use when applying the force/impulse(see #NxForceMode) Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxForceMode @see addForceAtPos() addForceAtLocalPos() addLocalForceAtPos() addLocalForceAtLocalPos() addForce() */ virtual void addLocalForce(const NxVec3& force, NxForceMode mode = NX_FORCE) = 0; /** \brief Applies an impulsive torque defined in the global coordinate frame to the actor. ::NxForceMode determines if the torque is to be conventional or impulsive. The actor must be dynamic. Sleeping: This call wakes the actor if it is sleeping. \param[in] torque Torque to apply defined in the global frame. Range: torque vector \param[in] mode The mode to use when applying the force/impulse(see #NxForceMode). Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxForceMode addLocalTorque() addForce() */ virtual void addTorque(const NxVec3& torque, NxForceMode mode = NX_FORCE) = 0; /** \brief Applies an impulsive torque defined in the actor local coordinate frame to the actor. ::NxForceMode determines if the torque is to be conventional or impulsive. The actor must be dynamic. Sleeping: This call wakes the actor if it is sleeping. \param[in] torque Torque to apply defined in the local frame. Range: torque vector \param[in] mode The mode to use when applying the force/impulse(see #NxForceMode). Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxForceMode addTorque() addForce() */ virtual void addLocalTorque(const NxVec3& torque, NxForceMode mode = NX_FORCE) = 0; //@} /************************************************************************************************/ /** \brief Computes the total kinetic (rotational and translational) energy of the object. The actor must be dynamic. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes \return The kinetic energy of the actor. */ virtual NxReal computeKineticEnergy() const = 0; /************************************************************************************************/ /** @name Point Velocity */ //@{ /** \brief Computes the velocity of a point given in world coordinates if it were attached to the actor and moving with it. The actor must be dynamic. \param[in] point Point we wish to determine the velocity for, defined in the global frame. Range: position vector \return The velocity of point in the global frame. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getLocalPointVelocity() NxBodyDesc.linearVelocity NxBodyDesc.angularVelocity */ virtual NxVec3 getPointVelocity(const NxVec3& point) const = 0; /** \brief Computes the velocity of a point given in body local coordinates if it were attached to the actor and moving with it. The actor must be dynamic. \param[in] point Point we wish to determine the velocity of, defined in the local frame. Range: position vector \return The velocity of point in the actors frame. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see getPointVelocity() NxBodyDesc.linearVelocity NxBodyDesc.angularVelocity */ virtual NxVec3 getLocalPointVelocity(const NxVec3& point) const = 0; //@} /************************************************************************************************/ /** @name Sleeping */ //@{ /** \brief Returns true if this body and all the actors it is touching or is linked to with joints are sleeping. When an actor does not move for a period of time, it is no longer simulated in order to save time. This state is called sleeping. However, because the object automatically wakes up when it is either touched by an awake object, or one of its properties is changed by the user, the entire sleep mechanism should be transparent to the user. If an actor is not asleep, its group won't be either, but if it is asleep, its group may not be. The actor must be dynamic. \return True if the actors group is sleeping. Platform: \li PC SW: Yes \li PPU : No \li PS3 : Yes \li XB360: Yes @see isGroupSleeping() isSleeping() getSleepLinearVelocity() getSleepAngularVelocity() wakeUp() putToSleep() */ virtual bool isGroupSleeping() const = 0; /** \brief Returns true if this body is sleeping. When an actor does not move for a period of time, it is no longer simulated in order to save time. This state is called sleeping. However, because the object automatically wakes up when it is either touched by an awake object, or one of its properties is changed by the user, the entire sleep mechanism should be transparent to the user. If an actor is not asleep, its group won't be either, but if it is asleep, its group may not be. If an actor is asleep after the call to NxScene::fetchResults() returns, it is guaranteed that the pose of the actor was not changed. You can use this information to avoid updating the transforms of associated of dependant objects. The actor must be dynamic. \return True if the actor is sleeping. Platform: \li PC SW: Yes \li PPU : Yes (Sleep behavior on hardware differs) \li PS3 : Yes \li XB360: Yes @see isGroupSleeping() isSleeping() getSleepLinearVelocity() getSleepAngularVelocity() wakeUp() putToSleep() */ virtual bool isSleeping() const = 0; /** \brief Returns the linear velocity below which an actor may go to sleep. Actors whose linear velocity is above this threshold will not be put to sleep. The actor must be dynamic. @see isSleeping \return The threshold linear velocity for sleeping. Platform: \li PC SW: Yes \li PPU : Yes (Sleep behavior on hardware differs) \li PS3 : Yes \li XB360: Yes @see isGroupSleeping() isSleeping() getSleepLinearVelocity() getSleepAngularVelocity() wakeUp() putToSleep() setSleepLinearVelocity() */ virtual NxReal getSleepLinearVelocity() const = 0; /** \brief Sets the linear velocity below which an actor may go to sleep. Actors whose linear velocity is above this threshold will not be put to sleep. If the threshold value is negative, the velocity threshold is set using the NxPhysicsSDK's NX_DEFAULT_SLEEP_LIN_VEL_SQUARED parameter. The actor must be dynamic. \param[in] threshold Linear velocity below which an actor may sleep. Range: (0,inf] Platform: \li PC SW: Yes \li PPU : Yes (Sleep behavior on hardware differs) \li PS3 : Yes \li XB360: Yes @see isGroupSleeping() isSleeping() getSleepLinearVelocity() getSleepAngularVelocity() wakeUp() putToSleep() */ virtual void setSleepLinearVelocity(NxReal threshold) = 0; /** \brief Returns the angular velocity below which an actor may go to sleep. Actors whose angular velocity is above this threshold will not be put to sleep. The actor must be dynamic. \return The threshold angular velocity for sleeping. Platform: \li PC SW: Yes \li PPU : Yes (Sleep behavior on hardware differs) \li PS3 : Yes \li XB360: Yes @see isGroupSleeping() isSleeping() getSleepLinearVelocity() getSleepAngularVelocity() wakeUp() putToSleep() setSleepAngularVelocity() */ virtual NxReal getSleepAngularVelocity() const = 0; /** \brief Sets the angular velocity below which an actor may go to sleep. Actors whose angular velocity is above this threshold will not be put to sleep. If the threshold value is negative, the velocity threshold is set using the NxPhysicsSDK's NX_DEFAULT_SLEEP_LIN_VEL_SQUARED parameter. The actor must be dynamic. \param[in] threshold Angular velocity below which an actor may go to sleep. Range: (0,inf] Platform: \li PC SW: Yes \li PPU : Yes (Sleep behavior on hardware differs) \li PS3 : Yes \li XB360: Yes @see isGroupSleeping() isSleeping() getSleepLinearVelocity() getSleepAngularVelocity() wakeUp() putToSleep() setSleepLinearVelocity() */ virtual void setSleepAngularVelocity(NxReal threshold) = 0; /** \brief Wakes up the actor if it is sleeping. The wakeCounterValue determines how long until the body is put to sleep, a value of zero means that the body is sleeping. wakeUp(0) is equivalent to NxActor::putToSleep(). The actor must be dynamic. \param[in] wakeCounterValue New sleep counter value. Range: [0,inf] Platform: \li PC SW: Yes \li PPU : Yes (Sleep behavior on hardware differs) \li PS3 : Yes \li XB360: Yes @see isGroupSleeping() isSleeping() getSleepLinearVelocity() getSleepAngularVelocity() putToSleep() */ virtual void wakeUp(NxReal wakeCounterValue=NX_NUM_SLEEP_FRAMES) = 0; /** \brief Forces the actor to sleep. The actor will stay asleep until the next call to simulate, and will not wake up until then even when otherwise it would (for example a force is applied to it). It can however wake up during the next simulate call. The actor must be dynamic. Platform: \li PC SW: Yes \li PPU : Yes (Sleep behavior on hardware differs) \li PS3 : Yes \li XB360: Yes @see isGroupSleeping() isSleeping() getSleepLinearVelocity() getSleepAngularVelocity() wakeUp() */ virtual void putToSleep() = 0; //@} /************************************************************************************************/ /** \brief Raises a particular body flag. See the actors body flags. See #NxBodyFlag for a list of flags. The actor must be dynamic. \param[in] bodyFlag Body flag to raise(set). See #NxBodyFlag. Platform: \li PC SW: Yes \li PPU : Partial (supports NX_BF_KINEMATIC, NX_BF_DISABLE_GRAVITY) \li PS3 : Yes \li XB360: Yes @see NxBodyFlag clearBodyFlag() readBodyFlag() NxBodyDesc.flags */ virtual void raiseBodyFlag(NxBodyFlag bodyFlag) = 0; /** \brief Clears a particular body flag. See #NxBodyFlag for a list of flags. The actor must be dynamic. \param[in] bodyFlag Body flag to clear. See #NxBodyFlag. Platform: \li PC SW: Yes \li PPU : Partial (supports NX_BF_KINEMATIC, NX_BF_DISABLE_GRAVITY) \li PS3 : Yes \li XB360: Yes @see NxBodyFlag raiseBodyFlag() readBodyFlag() NxBodyDesc.flags */ virtual void clearBodyFlag(NxBodyFlag bodyFlag) = 0; /** \brief Reads a particular body flag. See #NxBodyFlag for a list of flags. The actor must be dynamic. \param[in] bodyFlag Body flag to retrieve. See #NxBodyFlag. \return The value of the body flag specified by bodyFlag. Platform: \li PC SW: Yes \li PPU : Partial (supports NX_BF_KINEMATIC, NX_BF_DISABLE_GRAVITY) \li PS3 : Yes \li XB360: Yes @see NxBodyFlag raiseBodyFlag() clearBodyFlag() NxBodyDesc.flags */ virtual bool readBodyFlag(NxBodyFlag bodyFlag) const = 0; /** \brief Saves the body information of a dynamic actor to the passed body descriptor. This method only save the dynamic(body) state for the actor. The user should use #saveToDesc() to save the state common between static and dynamic actors. Plus manually saving the shapes belonging to the actor. The actor must be dynamic. \param[out] bodyDesc Descriptor to save the state of the body to. \return True for a dynamic body. Otherwise False. Platform: \li PC SW: Yes \li PPU : Yes \li PS3 : Yes \li XB360: Yes @see NxBodyDesc saveToDesc() getShape() */ virtual bool saveBodyToDesc(NxBodyDesc& bodyDesc) = 0; /** \brief Sets the solver iteration count for the body. The solver iteration count determinews how accuratly joints and contacts are resolved. If you are having trouble with jointed bodies oscillating and behaving eratically setting a higher solver iteration count may improve there stability. The actor must be dynamic. \param[in] iterCount Number of iterations the solver should perform for this body. Range: [1,NX_MAX_U32] Platform: \li PC SW: Yes \li PPU : No \li PS3 : Yes \li XB360: Yes @see getSolverIterationCount() NxBodyDesc.solverIterationCount */ virtual void setSolverIterationCount(NxU32 iterCount) = 0; /** \brief Retrieves the solver iteration count. See #setSolverIterationCount(). The actor must be dynamic. \return The solver iteration count for this body. Platform: \li PC SW: Yes \li PPU : No \li PS3 : Yes \li XB360: Yes @see setSolverIterationCount() NxBodyDesc.solverIterationCount */ virtual NxU32 getSolverIterationCount() const = 0; //public variables: void* userData; //!< user can assign this to whatever, usually to create a 1:1 relationship with a user object. }; /** @} */ #endif //AGCOPYRIGHTBEGIN /////////////////////////////////////////////////////////////////////////// // Copyright © 2005 AGEIA Technologies. // All rights reserved. www.ageia.com /////////////////////////////////////////////////////////////////////////// //AGCOPYRIGHTEND