source: GTP/trunk/App/Games/Jungle_Rumble/src/physic/physics/include/NxActor.h @ 1378

Revision 1378, 59.1 KB checked in by giegl, 18 years ago (diff)

GTPD - Jungle Rumble - integrate into GTP SVN structure

Line 
1#ifndef NX_PHYSICS_NX_ACTOR
2#define NX_PHYSICS_NX_ACTOR
3/*----------------------------------------------------------------------------*\
4|
5|                                               Public Interface to NovodeX Technology
6|
7|                                                            www.novodex.com
8|
9\*----------------------------------------------------------------------------*/
10/** \addtogroup physics
11  @{
12*/
13
14#include "Nxp.h"
15#include "NxArray.h"
16#include "NxBounds3.h"
17#include "NxActorDesc.h"
18#include "NxPhysicsSDK.h"
19
20class NxBodyDesc;
21class NxShapeDesc;
22class NxJoint;
23class NxShape;
24
25
26/**
27\brief NxActor is the main simulation object in the physics sdk.
28
29The actor is owned by and contained in a. NxScene.
30
31An actor may optionally encapsulate a dynamic rigid body by setting the body member of the
32actors descriptor when it is created. Otherwise the actor is static, it is fixed in the world).
33
34<h3>Creation</h3>
35Instances of this class are created by calling #NxScene::createActor() and deleted with #NxScene::releaseActor().
36
37See #NxActorDescBase for a more detailed descriptiption of the parameters which can be set when creating an actor.
38
39Example (Static Actor):
40
41\include NxActor_CreateStatic.cpp
42
43Example (Dynamic Actor):
44
45\include NxActor_CreateDynamic.cpp
46
47<h3>Visualizations</h3>
48\li #NX_VISUALIZE_ACTOR_AXES
49\li #NX_VISUALIZE_BODY_AXES
50\li #NX_VISUALIZE_BODY_MASS_AXES
51\li #NX_VISUALIZE_BODY_LIN_VELOCITY
52\li #NX_VISUALIZE_BODY_ANG_VELOCITY
53\li #NX_VISUALIZE_BODY_LIN_MOMENTUM
54\li #NX_VISUALIZE_BODY_ANG_MOMENTUM
55\li #NX_VISUALIZE_BODY_LIN_ACCEL
56\li #NX_VISUALIZE_BODY_ANG_ACCEL
57\li #NX_VISUALIZE_BODY_LIN_FORCE
58\li #NX_VISUALIZE_BODY_ANG_FORCE
59\li #NX_VISUALIZE_BODY_REDUCED
60\li #NX_VISUALIZE_BODY_JOINT_GROUPS
61\li #NX_VISUALIZE_BODY_CONTACT_LIST
62\li #NX_VISUALIZE_BODY_JOINT_LIST
63\li #NX_VISUALIZE_BODY_DAMPING
64\li #NX_VISUALIZE_BODY_SLEEP
65
66
67@see NxActorDesc NxBodyDesc NxScene.createActor() NxScene.releaseActor()
68*/
69
70class NxActor
71        {
72        protected:
73        NX_INLINE                                       NxActor() : userData(NULL)
74                                                                                        {}
75        virtual                                         ~NxActor()      {}
76
77        public:
78        /**
79        \brief Retrieves the scene which this actor belongs to.
80
81        \return Owner Scene.
82
83        <b>Platform:</b>
84        \li PC SW: Yes
85        \li PPU  : Yes
86        \li PS3  : Yes
87        \li XB360: Yes
88
89        @see NxScene
90        */
91        virtual         NxScene&                getScene() = 0;
92
93        // Runtime modifications
94
95        /**
96        \brief Saves the state of the actor to the passed descriptor.
97
98        This method does not save out any shapes belonging to the actor to the descriptor's
99        shape vector, nor does it write to its body member. You have to iterate through
100        the shapes of the actor and save them manually. In addition for dynamic actors you
101        have to call the #saveBodyToDesc() method.
102
103        \param[out] desc        Descriptor to save object state to.
104
105        <b>Platform:</b>
106        \li PC SW: Yes
107        \li PPU  : Yes
108        \li PS3  : Yes
109        \li XB360: Yes
110
111        @see NxActorDesc NxActorDescBase
112        */
113        virtual         void                    saveToDesc(NxActorDescBase& desc) = 0;
114
115        /**
116        \brief Sets a name string for the object that can be retrieved with getName().
117       
118        This is for debugging and is not used by the SDK. The string is not copied by the SDK,
119        only the pointer is stored.
120
121        \param[in] name String to set the objects name to.
122
123        <b>Platform:</b>
124        \li PC SW: Yes
125        \li PPU  : Yes
126        \li PS3  : Yes
127        \li XB360: Yes
128
129        @see getName()
130        */
131        virtual         void                    setName(const char* name)               = 0;
132
133        /**
134        \brief Retrieves the name string set with setName().
135
136        \return Name string associated with object.
137
138        <b>Platform:</b>
139        \li PC SW: Yes
140        \li PPU  : Yes
141        \li PS3  : Yes
142        \li XB360: Yes
143
144        @see setName()
145        */
146        virtual         const char*             getName()                       const   = 0;
147
148/************************************************************************************************/
149/** @name Global Pose Manipulation
150*/
151//@{
152
153        /**
154        \brief Methods for setting a dynamic actor's pose in the world.
155
156        These methods instantaneously change the actor space to world space transformation.
157
158        One should exercise restraint in making use of these methods.
159
160        Static actors should not be moved at all. There are various internal data structures for static actors
161        which may need to be recomputed when one moves. Also, moving static actors will not interact correctly
162        with dynamic actors or joints. If you would like to directly control an actor's position and would like to
163        have it correctly interact with dynamic bodies and joints, you should create a dynamic body with the
164        NX_BF_KINEMATIC flag, and then use the moveGlobal*() commands to move it along a path!
165
166        When briefly moving dynamic actors, one should not:
167       
168        \li Move actors into other actors, thus causing interpenetration (an invalid physical state)
169       
170        \li Move an actor  that is connected by a joint to another away from the other (thus causing joint error)
171
172        \li When moving jointed actors the joints' cached transform information is destroyed and recreated next frame;
173        thus this call is expensive for jointed actors.
174       
175        setGlobalPose(m) has the same effect as calling
176        setGlobalOrientation(m.M);      and setGlobalPosition(m.t);
177        but setGlobalPose() may be faster as it doesn't recompute some internal values twice.
178       
179        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
180
181        \param[in] mat Transformation from the actors local frame to the global frame. <b>Range:</b> rigid body transform.
182
183        <b>Platform:</b>
184        \li PC SW: Yes
185        \li PPU  : Yes
186        \li PS3  : Yes
187        \li XB360: Yes
188
189        @see getGlobalPose() setGlobalPosition() setGlobalOrientation() getGlobalPose()
190        */
191        virtual         void                    setGlobalPose(const NxMat34& mat)                       = 0;
192
193        /**
194        \brief Sets a dynamic actor's position in the world.
195
196        see ::setGlobalPose() for information.
197
198        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
199
200        \param[in] vec New position for the actors frame relative to the global frame. <b>Range:</b> position vector
201
202        <b>Platform:</b>
203        \li PC SW: Yes
204        \li PPU  : Yes
205        \li PS3  : Yes
206        \li XB360: Yes
207
208        @see setGlobalPose() setGlobalOrientation() getGlobalPosition()
209        */
210        virtual         void                    setGlobalPosition(const NxVec3& vec)            = 0;
211
212        /**
213        \brief Sets a dynamic actor's orientation in the world.
214
215        see ::setGlobalPose() for information.
216
217        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
218
219        \param[in] mat New orientation for the actors frame. <b>Range:</b> rotation matrix.
220
221        <b>Platform:</b>
222        \li PC SW: Yes
223        \li PPU  : Yes
224        \li PS3  : Yes
225        \li XB360: Yes
226
227        @see setGlobalPose() setGlobalPosition() getGlobalOrientation() setGlobalOrientationQuat()
228        */
229        virtual         void                    setGlobalOrientation(const NxMat33& mat)        = 0;
230
231        /**
232        \brief Sets a dynamic actor's orientation in the world.
233
234        see ::setGlobalPose() for information.
235
236        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
237
238        \param[in] mat New orientation for the actors frame.
239
240        <b>Platform:</b>
241        \li PC SW: Yes
242        \li PPU  : Yes
243        \li PS3  : Yes
244        \li XB360: Yes
245
246        @see setGlobalOrientation() getGlobalOrientation() setGlobalPose()
247        */
248        virtual         void                    setGlobalOrientationQuat(const NxQuat& mat)     = 0;
249
250        /**
251        \brief Retrieves the actors world space transform.
252
253        The getGlobal*() methods retrieve the actor's current actor space to world space transformation.
254
255        \return Global pose matrix of object.
256
257        <b>Platform:</b>
258        \li PC SW: Yes
259        \li PPU  : Yes
260        \li PS3  : Yes
261        \li XB360: Yes
262
263        @see setGlobalPose() getGlobalPosition() getGlobalOrientation()
264        */
265        virtual         NxMat34                 getGlobalPose()                   const = 0;
266
267        /**
268        \brief Retrieves the actors world space position.
269
270        The getGlobal*() methods retrieve the actor's current actor space to world space transformation.
271
272        \return Global position of object.
273
274        <b>Platform:</b>
275        \li PC SW: Yes
276        \li PPU  : Yes
277        \li PS3  : Yes
278        \li XB360: Yes
279
280        @see setGlobalPosition() getGlobalPose() getGlobalOrientation()
281        */
282        virtual         NxVec3                  getGlobalPosition()               const = 0;
283
284        /**
285        \brief Retrieves the actors world space orientation.
286
287        The getGlobal*() methods retrieve the actor's current actor space to world space transformation.
288
289        \return Global orientation of object.
290
291        <b>Platform:</b>
292        \li PC SW: Yes
293        \li PPU  : Yes
294        \li PS3  : Yes
295        \li XB360: Yes
296
297        @see getGlobalOrientationQuat() setGlobalOrientation() getGlobalPose() getGlobalPosition()
298        */
299        virtual         NxMat33                 getGlobalOrientation()    const = 0;
300
301        /**
302        \brief Retrieves the actors world space orientation.
303
304        The getGlobal*() methods retrieve the actor's current actor space to world space transformation.
305
306        \return Global orientation of the actor as a quaternion.
307
308        <b>Platform:</b>
309        \li PC SW: Yes
310        \li PPU  : Yes
311        \li PS3  : Yes
312        \li XB360: Yes
313
314        @see getGlobalOrientation() setGlobalOrientation() getGlobalPose() getGlobalPosition()
315        */
316        virtual         NxQuat                  getGlobalOrientationQuat()const = 0;
317
318/************************************************************************************************/
319//@}
320
321/** @name Kinematic Actors
322*/
323//@{
324
325        /**
326        \brief The moveGlobal* calls serve to move kinematically controlled dynamic actors through the game world.
327
328        You set a dynamic actor to be kinematic using the NX_BF_KINEMATIC body flag,
329        used either in the NxBodyDesc or with raiseBodyFlag().
330       
331        The move command will result in a velocity that, when successfully carried
332        out (i.e. the motion is not blocked due to joints or collisions) inside run*(),
333        will move the body into the desired pose. After the move is carried out during
334        a single time step, the velocity is returned to zero. Thus, you must
335        continuously call this in every time step for kinematic actors so that they
336        move along a path.
337
338        These functions simply store the move destination until run*() is called,
339        so consecutive calls will simply overwrite the stored target variable.
340
341        Note that in the future we will provide a mechanism for the motion to be blocked
342        in certain cases (such as when a box jams in an automatic door), but currently
343        the motion is always fully carried out.
344
345        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
346
347        \param[in] mat The desired pose for the kinematic actor, in the global frame. <b>Range:</b> rigid body transform.
348
349        <b>Platform:</b>
350        \li PC SW: Yes
351        \li PPU  : Yes
352        \li PS3  : Yes
353        \li XB360: Yes
354
355        @see moveGlobalPosition() moveGlobalOrientation() moveGlobalOrientationQuat() NxBodyFlag raiseBodyFlag() NxBodyDesc.flags
356        */
357        virtual         void                    moveGlobalPose(const NxMat34& mat)                      = 0;
358
359        /**
360        \brief The moveGlobal* calls serve to move kinematically controlled dynamic actors through the game world.
361
362        See ::moveGlobalPose() for more information.
363
364        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
365
366        \param[in] vec The desired position for the kinematic actor, in the global frame. <b>Range:</b> position vector
367
368        <b>Platform:</b>
369        \li PC SW: Yes
370        \li PPU  : Yes
371        \li PS3  : Yes
372        \li XB360: Yes
373
374        @see moveGlobalPose() moveGlobalOrientation() moveGlobalOrientationQuat() NxBodyFlag raiseBodyFlag() NxBodyDesc.flags
375        */
376        virtual         void                    moveGlobalPosition(const NxVec3& vec)           = 0;
377
378        /**
379        \brief The moveGlobal* calls serve to move kinematically controlled dynamic actors through the game world.
380
381        See ::moveGlobalPose() for more information.
382
383        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
384
385        \param[in] mat The desired orientation for the kinematic actor, in the global frame. <b>Range:</b> rotation matrix.
386
387        <b>Platform:</b>
388        \li PC SW: Yes
389        \li PPU  : Yes
390        \li PS3  : Yes
391        \li XB360: Yes
392
393        @see moveGlobalOrientationQuat() moveGlobalPosition() moveGlobalPose() NxBodyFlag raiseBodyFlag() NxBodyDesc.flags
394        */
395        virtual         void                    moveGlobalOrientation(const NxMat33& mat)       = 0;
396
397        /**
398        \brief The moveGlobal* calls serve to move kinematically controlled dynamic actors through the game world.
399
400        See ::moveGlobalPose() for more information.
401
402        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
403
404        \param[in] quat The desired orientation quaternion for the kinematic actor, in the global frame.
405
406        @see moveGlobalPosition() moveGlobalOrientation() moveGlobalPose() NxBodyFlag raiseBodyFlag() NxBodyDesc.flags
407        */
408        virtual         void                    moveGlobalOrientationQuat(const NxQuat& quat)   = 0;
409
410/************************************************************************************************/
411//@}
412
413/** @name Shapes
414*/
415//@{
416
417        /**
418        \brief Creates a new shape and adds it to the list of shapes of this actor.
419       
420        This invalidates the pointer returned by getShapes().
421
422        Note: mass properties of dynamic actors will not automatically be recomputed
423        to reflect the new mass distribution implied by the shape. Follow
424        this call with a call to updateMassFromShapes() to do that.
425
426        <b>Sleeping:</b> Does <b>NOT</b> wake the actor up automatically.
427
428        \param[in] desc The descriptor for the new shape. See eg #NxSphereShapeDesc.
429        \return The newly create shape.
430
431        <b>Platform:</b>
432        \li PC SW: Yes
433        \li PPU  : Partial (Compounds not supported)
434        \li PS3  : Yes
435        \li XB360: Yes
436
437        @see NxShape NxShapeDesc
438        @see NxBoxShape NxCapsuleShape NxConvexShape NxPlaneShape NxSphereShape NxTriangleMeshShape NxWheelShape
439        */
440        virtual         NxShape*                createShape(const NxShapeDesc& desc)    = 0;
441
442        /**
443        \brief Deletes the specified shape.
444       
445        This invalidates the pointer returned by getShapes().
446
447        <b>Sleeping:</b> Does <b>NOT</b> wake the actor up automatically.
448
449        \param[in] shape Shape to be released.
450
451        <b>Platform:</b>
452        \li PC SW: Yes
453        \li PPU  : Yes
454        \li PS3  : Yes
455        \li XB360: Yes
456
457        @see NxShape
458        @see NxBoxShape NxCapsuleShape NxConvexShape NxPlaneShape NxSphereShape NxTriangleMeshShape NxWheelShape
459        */
460        virtual         void                    releaseShape(NxShape& shape) = 0;
461
462        /**
463        \brief Returns the number of shapes assigned to the actor.
464
465        You can use #getShapes() to retrieve an array of shape pointers.
466
467        \return Number of shapes associated with this actor.
468
469        <b>Platform:</b>
470        \li PC SW: Yes
471        \li PPU  : Yes
472        \li PS3  : Yes
473        \li XB360: Yes
474
475        @see NxShape getShapes()
476        */
477        virtual         NxU32                   getNbShapes()           const   = 0;
478
479
480        /**
481        \brief Returns an array of shape pointers belonging to the actor.
482
483        These are the shapes used by the actor for collision detection.
484
485        You can retrieve the number of shape pointers by calling #getNbShapes()
486
487        Note: Adding or removing shapes with #createShape() or #releaseShape() will invalidate the pointer.
488
489        \return Array of shapes which are associated with this actor.
490
491        <b>Platform:</b>
492        \li PC SW: Yes
493        \li PPU  : Yes
494        \li PS3  : Yes
495        \li XB360: Yes
496
497        @see NxShape getNbShapes() createShape() releaseShape()
498        */
499        virtual         NxShape*const * getShapes()                     const   = 0;
500
501/************************************************************************************************/
502//@}
503
504        /**
505        \brief Assigns the actor to a user defined group of actors.
506       
507        NxActorGroup is a 16 bit group identifier.
508
509        This is similar to ?#NxShape groups, except those are only five bits and serve a different purpose.
510       
511        The NxScene::setActorGroupPairFlags() lets you set certain behaviors for pairs of actor groups.
512        By default every actor is created in group 0.
513
514        <b>Sleeping:</b> Does <b>NOT</b> wake the actor up automatically.
515
516        \param[in] actorGroup The actor group flags.
517
518        <b>Platform:</b>
519        \li PC SW: Yes
520        \li PPU  : No
521        \li PS3  : Yes
522        \li XB360: Yes
523
524        @see getGroup() NxActorGroup
525        */
526        virtual         void                    setGroup(NxActorGroup actorGroup)                = 0;
527       
528        /**
529        \brief Retrieves the value set with setGroup().
530
531        \return The group ID of this actor.
532
533        <b>Platform:</b>
534        \li PC SW: Yes
535        \li PPU  : No
536        \li PS3  : Yes
537        \li XB360: Yes
538
539        @see setGroup() NxActorGroup
540        */
541        virtual         NxActorGroup    getGroup() const                         = 0;
542
543        /**
544        \brief Raises a particular actor flag.
545       
546        See the list of flags #NxActorFlag
547
548        <b>Sleeping:</b> Does <b>NOT</b> wake the actor up automatically.
549
550        \param[in] actorFlag The actor flag to raise(set). See #NxActorFlag.
551
552        <b>Platform:</b>
553        \li PC SW: Yes
554        \li PPU  : No
555        \li PS3  : Yes
556        \li XB360: Yes
557
558        @see NxActorFlag clearActorFlag() readActorFlag() NxActorDesc.flags
559        */
560        virtual         void                    raiseActorFlag(NxActorFlag actorFlag)                   = 0;
561       
562        /**
563        \brief Clears a particular actor flag.
564       
565        See the list of flags #NxActorFlag
566
567        <b>Sleeping:</b> Does <b>NOT</b> wake the actor up automatically.
568
569        \param[in] actorFlag The actor flag to clear. See #NxActorFlag.
570
571        <b>Platform:</b>
572        \li PC SW: Yes
573        \li PPU  : No
574        \li PS3  : Yes
575        \li XB360: Yes
576
577        @see NxActorFlag raiseActorFlag() readActorFlag() NxActorDesc.flags
578        */
579        virtual         void                    clearActorFlag(NxActorFlag actorFlag)                   = 0;
580       
581        /**
582        \brief Reads a particular actor flag.
583       
584        See the list of flags #NxActorFlag
585
586        \param[in] actorFlag The actor flag to retrieve. See #NxActorFlag.
587
588        \return The value of the actor flag.
589
590        <b>Platform:</b>
591        \li PC SW: Yes
592        \li PPU  : No
593        \li PS3  : Yes
594        \li XB360: Yes
595
596        @see NxActorFlag raiseActorFlag() clearActorFlag() NxActorDesc.flags
597        */
598        virtual         bool                    readActorFlag(NxActorFlag actorFlag)    const   = 0;
599
600        /**
601        \brief Returns true if the actor is dynamic.
602
603        \return True if this is a dynamic actor.
604
605        <b>Platform:</b>
606        \li PC SW: Yes
607        \li PPU  : Yes
608        \li PS3  : Yes
609        \li XB360: Yes
610
611        @see NxBodyDesc
612        */
613        virtual         bool                    isDynamic()     const                   = 0;
614
615/************************************************************************************************/
616
617/** @name Mass Manipulation
618*/
619//@{
620
621        /**
622        \brief The setCMassOffsetLocal*() methods set the pose of the center of mass relative to the actor.     
623       
624        Methods that automatically compute the center of mass such as updateMassFromShapes() as well as computing
625        the mass and inertia using the actors shapes, will set this pose automatically.
626       
627        The actor must be dynamic.
628
629        \note Changing this transform will not move the actor in the world!
630
631        \note Setting an unrealistic center of mass which is a long way from the body can make it difficult for
632        the SDK to solve constraints. Perhaps leading to instability and jittering bodies.
633
634        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
635
636        \param[in] mat Mass  frame offset transform relative to the actor frame. <b>Range:</b> rigid body transform.
637
638        <b>Platform:</b>
639        \li PC SW: Yes
640        \li PPU  : Yes
641        \li PS3  : Yes
642        \li XB360: Yes
643
644        @see setCMassOffsetLocalPosition() setCMassOffsetLocalOrientation() setCMassOffsetGlobalPose()
645        @see NxBodyDesc.massLocalPose
646        */
647        virtual         void                    setCMassOffsetLocalPose(const NxMat34& mat)                     = 0;
648
649        /**
650        \brief The setCMassOffsetLocal*() methods set the pose of the center of mass relative to the actor.
651
652        The actor must be dynamic.
653
654        See ::setCMassOffsetLocalPose() for more information.
655
656        \note Setting an unrealistic center of mass which is a long way from the body can make it difficult for
657        the SDK to solve constraints. Perhaps leading to instability and jittering bodies.
658
659        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
660
661        \param[in] vec Mass frame offset relative to the actor frame. <b>Range:</b> position vector
662
663        <b>Platform:</b>
664        \li PC SW: Yes
665        \li PPU  : Yes
666        \li PS3  : Yes
667        \li XB360: Yes
668
669        @see setCMassOffsetLocalPose() setCMassOffsetLocalOrientation() setCMassOffsetGlobalPose()
670        @see NxBodyDesc.massLocalPose
671        */
672        virtual         void                    setCMassOffsetLocalPosition(const NxVec3& vec)          = 0;
673
674        /**
675        \brief The setCMassOffsetLocal*() methods set the pose of the center of mass relative to the actor.
676
677        The actor must be dynamic.
678
679        See ::setCMassOffsetLocalPose() for more information.
680
681        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
682
683        \param[in] mat Mass frame orientation offset relative to the actor frame. <b>Range:</b> rotation matrix.
684
685        <b>Platform:</b>
686        \li PC SW: Yes
687        \li PPU  : Yes
688        \li PS3  : Yes
689        \li XB360: Yes
690
691        @see setCMassOffsetLocalPose() setCMassOffsetLocalPosition() setCMassOffsetGlobalPose()
692        @see NxBodyDesc.massLocalPose
693        */
694        virtual         void                    setCMassOffsetLocalOrientation(const NxMat33& mat)      = 0;
695
696        /**
697        \brief The setCMassOffsetGlobal*() methods set the pose of the center of mass relative to world space.
698
699        Note that this will simply transform the parameter to actor space and then call
700        setCMassLocal*(). In other words it only shifts the center of mass but does not move the actor.
701
702        The actor must be dynamic.
703
704
705        \note Setting an unrealistic center of mass which is a long way from the body can make it difficult for
706        the SDK to solve constraints. Perhaps leading to instability and jittering bodies.
707
708        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
709
710        \param[in] mat Mass frame offset transform relative to the global frame. <b>Range:</b> rigid body transform.
711
712        <b>Platform:</b>
713        \li PC SW: Yes
714        \li PPU  : Yes
715        \li PS3  : Yes
716        \li XB360: Yes
717
718        @see setCMassOffsetGlobalPosition() setCMassOffsetGlobalOrientation()
719        @see NxBodyDesc.massLocalPose
720        */
721        virtual         void                    setCMassOffsetGlobalPose(const NxMat34& mat)            = 0;
722
723        /**
724        \brief The setCMassOffsetGlobal*() methods set the pose of the center of mass relative to world space.
725
726        The actor must be dynamic.
727
728        See ::setCMassOffsetGlobalPose() for more information.
729
730        \note Setting an unrealistic center of mass which is a long way from the body can make it difficult for
731        the SDK to solve constraints. Perhaps leading to instability and jittering bodies.
732
733        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
734
735        \param[in] vec Mass frame offset relative to the global frame. <b>Range:</b> position vector
736
737        <b>Platform:</b>
738        \li PC SW: Yes
739        \li PPU  : Yes
740        \li PS3  : Yes
741        \li XB360: Yes
742
743        @see setCMassOffsetGlobalPose() setCMassOffsetGlobalOrientation()
744        @see NxBodyDesc.massLocalPose
745        */
746        virtual         void                    setCMassOffsetGlobalPosition(const NxVec3& vec)         = 0;
747
748        /**
749        \brief The setCMassOffsetGlobal*() methods set the pose of the center of mass relative to world space.
750
751        The actor must be dynamic.
752
753        See ::setCMassOffsetGlobalPose() for more information.
754
755        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
756
757        \param[in] mat Mass frame orientation offset relative to the global frame. <b>Range:</b> rotation matrix.
758       
759        <b>Platform:</b>
760        \li PC SW: Yes
761        \li PPU  : Yes
762        \li PS3  : Yes
763        \li XB360: Yes
764
765        @see setCMassOffsetGlobalPose() setCMassOffsetGlobalPosition()
766        @see NxBodyDesc.massLocalPose
767        */
768        virtual         void                    setCMassOffsetGlobalOrientation(const NxMat33& mat)     = 0;
769
770        /**
771        \brief The setCMassGlobal*() methods move the actor by setting the pose of the center of mass.
772
773        Here the transform between the center of mass and the actor frame is held fixed and the actor
774        to world transform is updated.
775       
776        The actor must be dynamic.
777
778        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
779
780        \param[in] mat Actors new pose, from the transformation of the mass frame to the global frame. <b>Range:</b> rigid body transform.
781
782        <b>Platform:</b>
783        \li PC SW: Yes
784        \li PPU  : Yes
785        \li PS3  : Yes
786        \li XB360: Yes
787
788        @see setCMassGlobalPosition() setCMassGlobalOrientation() getCMassLocalPose()
789        @see NxBodyDesc.massLocalPose
790        */
791        virtual         void                    setCMassGlobalPose(const NxMat34& mat)                  = 0;
792
793        /**
794        \brief The setCMassGlobal*() methods move the actor by setting the pose of the center of mass.
795
796        The actor must be dynamic.
797
798        See ::setCMassGlobalPose() for more information.
799
800        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
801
802        \param[in] vec Actors new position, from the transformation of the mass frame to the global frame. <b>Range:</b> position vector
803
804        <b>Platform:</b>
805        \li PC SW: Yes
806        \li PPU  : Yes
807        \li PS3  : Yes
808        \li XB360: Yes
809
810        @see setCMassGlobalPose() setCMassGlobalOrientation() getCMassLocalPose()
811        @see NxBodyDesc.massLocalPose
812        */
813        virtual         void                    setCMassGlobalPosition(const NxVec3& vec)               = 0;
814
815        /**
816        \brief The setCMassGlobal*() methods move the actor by setting the pose of the center of mass.
817
818        The actor must be dynamic.
819
820        See ::setCMassGlobalPose() for more information.
821
822        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
823
824        \param[in] mat Actors new orientation, from the transformation of the mass frame to the global frame. <b>Range:</b> rotation matrix.
825
826        <b>Platform:</b>
827        \li PC SW: Yes
828        \li PPU  : Yes
829        \li PS3  : Yes
830        \li XB360: Yes
831
832        @see setCMassGlobalPose() setCMassGlobalPosition() getCMassLocalPose()
833        @see NxBodyDesc.massLocalPose
834        */
835        virtual         void                    setCMassGlobalOrientation(const NxMat33& mat)   = 0;
836
837        /**
838        \brief The getCMassLocal*() methods retrieve the center of mass pose relative to the actor.
839
840        The actor must be dynamic.
841
842        \return The centre of mass pose relative to the actor.
843
844        <b>Platform:</b>
845        \li PC SW: Yes
846        \li PPU  : Yes
847        \li PS3  : Yes
848        \li XB360: Yes
849
850        @see getCMassLocalPosition() getCMassLocalOrientation() getCMassGlobalPose()
851        @see NxBodyDesc.massLocalPose
852        */
853        virtual         NxMat34                 getCMassLocalPose()                                     const   = 0;
854
855        /**
856        \brief The getCMassLocal*() methods retrieve the center of mass pose relative to the actor.
857
858        The actor must be dynamic.
859
860        \return The centre of mass position relative to the actor.
861
862        <b>Platform:</b>
863        \li PC SW: Yes
864        \li PPU  : Yes
865        \li PS3  : Yes
866        \li XB360: Yes
867
868        @see getCMassLocalPose() getCMassLocalOrientation() getCMassGlobalPose()
869        @see NxBodyDesc.massLocalPose
870        */
871        virtual         NxVec3                  getCMassLocalPosition()                         const   = 0;
872
873        /**
874        \brief The getCMassLocal*() methods retrieve the center of mass pose relative to the actor.
875
876        The actor must be dynamic.
877
878        \return The mass orientation relative to the actors frame.
879
880        <b>Platform:</b>
881        \li PC SW: Yes
882        \li PPU  : Yes
883        \li PS3  : Yes
884        \li XB360: Yes
885
886        @see getCMassLocalPose() getCMassLocalPosition() getCMassGlobalPose()
887        @see NxBodyDesc.massLocalPose
888        */
889        virtual         NxMat33                 getCMassLocalOrientation()                      const   = 0;
890
891        /**
892        \brief The getCMassGlobal*() methods retrieve the center of mass pose in world space.
893
894        The actor must be dynamic.
895       
896        \return The Mass transform for this actor relative to the global frame.
897
898        <b>Platform:</b>
899        \li PC SW: Yes
900        \li PPU  : Yes
901        \li PS3  : Yes
902        \li XB360: Yes
903
904        @see getCMassGlobalPosition() getCMassGlobalOrientation() getCMassLocalPose()
905        @see NxBodyDesc.massLocalPose
906        */
907        virtual         NxMat34                 getCMassGlobalPose()                            const  = 0;
908
909        /**
910        \brief The getCMassGlobal*() methods retrieve the center of mass pose in world space.
911
912        The actor must be dynamic.
913
914        \return The position of the centre of mass relative to the global frame.
915
916        <b>Platform:</b>
917        \li PC SW: Yes
918        \li PPU  : Yes
919        \li PS3  : Yes
920        \li XB360: Yes
921
922        @see getCMassGlobalPose() getCMassGlobalOrientation() getCMassLocalPose()
923        @see NxBodyDesc.massLocalPose
924        */
925        virtual         NxVec3                  getCMassGlobalPosition()                        const  = 0;
926
927        /**
928        \brief The getCMassGlobal*() methods retrieve the center of mass pose in world space.
929
930        The actor must be dynamic.
931
932        \return The orientation of the mass frame relative to the global frame.
933
934        <b>Platform:</b>
935        \li PC SW: Yes
936        \li PPU  : Yes
937        \li PS3  : Yes
938        \li XB360: Yes
939
940        @see getCMassGlobalPose() getCMassGlobalPosition() getCMassLocalPose()
941        @see NxBodyDesc.massLocalPose
942        */
943        virtual         NxMat33                 getCMassGlobalOrientation()                     const = 0;
944
945        /**
946        \brief Sets the mass of a dynamic actor.
947       
948        The mass must be positive and the actor must be dynamic.
949       
950        <b>Sleeping:</b> Does <b>NOT</b> wake the actor up automatically.
951
952        \param[in] mass New mass value for the actor. <b>Range:</b> (0,inf)
953
954        <b>Platform:</b>
955        \li PC SW: Yes
956        \li PPU  : Yes
957        \li PS3  : Yes
958        \li XB360: Yes
959
960        @see getMass() NxBodyDesc.mass setMassSpaceInertiaTensor()
961        */
962        virtual         void                    setMass(NxReal mass) = 0;
963
964        /**
965        \brief Retrieves the mass of the actor.
966       
967        Static actors will always return 0.
968
969        \return The mass of this actor.
970
971        <b>Platform:</b>
972        \li PC SW: Yes
973        \li PPU  : Yes
974        \li PS3  : Yes
975        \li XB360: Yes
976
977        @see setMass() NxBodyDesc.mass setMassSpaceInertiaTensor()
978        */
979        virtual         NxReal                  getMass() const = 0;
980
981        /**
982        \brief Sets the inertia tensor, using a parameter specified in mass space coordinates.
983       
984        Note that such matrices are diagonal -- the passed vector is the diagonal.
985
986        If you have a non diagonal world/actor space inertia tensor(3x3 matrix). Then you need to
987        diagonalize it and set an appropriate mass space transform. See #setCMassOffsetLocalPose().
988       
989        The actor must be dynamic.
990
991        <b>Sleeping:</b> Does <b>NOT</b> wake the actor up automatically.
992
993        \param[in] m New mass space inertia tensor for the actor. <b>Range:</b> inertia vector
994
995        <b>Platform:</b>
996        \li PC SW: Yes
997        \li PPU  : Yes
998        \li PS3  : Yes
999        \li XB360: Yes
1000
1001        @see NxBodyDesc.massSpaceInertia getMassSpaceInertia() setMass() setCMassOffsetLocalPose()
1002        */
1003        virtual         void                    setMassSpaceInertiaTensor(const NxVec3& m) = 0;
1004
1005        /**
1006        \brief  Retrieves the diagonal inertia tensor of the actor relative to the mass coordinate frame.
1007
1008        This method retrieves a mass frame inertia vector. If you want a global frame inertia tensor(3x3 matrix),
1009        then see #getGlobalInertiaTensor().
1010
1011        The actor must be dynamic.
1012
1013        \return The mass space inertia tensor of this actor.
1014
1015        <b>Platform:</b>
1016        \li PC SW: Yes
1017        \li PPU  : Yes
1018        \li PS3  : Yes
1019        \li XB360: Yes
1020
1021        @see NxBodyDesc.massSpaceInertia setMassSpaceInertiaTensor() setMass() CMassOffsetLocalPose()
1022        */
1023        virtual         NxVec3                  getMassSpaceInertiaTensor()                     const = 0;
1024
1025        /**
1026        \brief Retrieves the inertia tensor of the actor relative to the world coordinate frame.
1027
1028        The actor must be dynamic.
1029
1030        \return The global frame inertia tensor of this actor.
1031
1032        <b>Platform:</b>
1033        \li PC SW: Yes
1034        \li PPU  : Yes
1035        \li PS3  : Yes
1036        \li XB360: Yes
1037
1038        @see getGlobalInertiaTensorInverse() NxBodyDesc.massSpaceInertia setMassSpaceInertiaTensor()
1039        */
1040        virtual         NxMat33                 getGlobalInertiaTensor()                        const = 0;
1041
1042        /**
1043        \brief Retrieves the inverse of the inertia tensor of the actor relative to the world coordinate frame.
1044
1045        The actor must be dynamic.
1046
1047        \return The inverse of the inertia tensor in the global frame.
1048
1049        <b>Platform:</b>
1050        \li PC SW: Yes
1051        \li PPU  : Yes
1052        \li PS3  : Yes
1053        \li XB360: Yes
1054
1055        @see getGlobalInertiaTensor() NxBodyDesc.massSpaceInertia setMassSpaceInertiaTensor()
1056        */
1057        virtual         NxMat33                 getGlobalInertiaTensorInverse()         const = 0;
1058
1059        /**
1060        \brief Recomputes a dynamic actor's mass properties from its shapes
1061
1062        Given a constant density or total mass, the actors mass properties can be recomputed
1063        using the shapes attached to the actor.
1064
1065        If you want to compute the mass properties based on a total mass specify a total mass and set
1066        density to zero. Alternativly specify a density and set totalMass to zero.
1067
1068        If a density is supplied the mass is calculated based on the total mass of the shapes multiplied
1069        by the supplied density.
1070
1071        The mass of each shape is either the shape's local density (default 1.0) multiplied by the shape's
1072        volume or a directly specified shape mass.
1073       
1074        The inertia tensor, mass frame and center of mass will always be recomputed.
1075
1076        The actor must be dynamic.
1077
1078        \param[in] density Density of the shapes belonging to the actor(or zero). <b>Range:</b> (0,inf)
1079        \param[in] totalMass Total mass of the actor(or zero). <b>Range:</b> (0,inf)
1080
1081        <b>Platform:</b>
1082        \li PC SW: Yes
1083        \li PPU  : Yes
1084        \li PS3  : Yes
1085        \li XB360: Yes
1086
1087        @see NxActorDesc NxBodyDesc NxBodyDesc.mass NxActorDesc.density NxActorDesc.lockCOM
1088        */
1089        virtual         void                    updateMassFromShapes(NxReal density, NxReal totalMass)          = 0;
1090
1091//@}
1092/************************************************************************************************/
1093/** @name Damping
1094*/
1095//@{
1096
1097        /**
1098        \brief Sets the linear damping coefficient.
1099       
1100        Zero represents no damping. The damping coefficient must be nonnegative.
1101       
1102        The actor must be dynamic.
1103
1104        <b>Default:</b> 0.
1105       
1106        \param[in] linDamp Linear damping coefficient. <b>Range:</b> [0,inf)
1107
1108        <b>Platform:</b>
1109        \li PC SW: Yes
1110        \li PPU  : Yes
1111        \li PS3  : Yes
1112        \li XB360: Yes
1113
1114        @see getLinearDamping() setAngularDamping() NxBodyDesc.linearDamping
1115        */
1116        virtual         void                    setLinearDamping(NxReal linDamp) = 0;
1117
1118        /**
1119        \brief Retrieves the linear damping coefficient.
1120
1121        The actor must be dynamic.
1122
1123        \return The linear damping coefficient associated with this actor.
1124
1125        <b>Platform:</b>
1126        \li PC SW: Yes
1127        \li PPU  : Yes
1128        \li PS3  : Yes
1129        \li XB360: Yes
1130
1131        @see setLinearDamping() getAngularDamping() NxBodyDesc.linearDamping
1132        */
1133        virtual         NxReal                  getLinearDamping() const = 0;
1134
1135        /**
1136        \brief Sets the angular damping coefficient.
1137       
1138        Zero represents no damping.
1139       
1140        The angular damping coefficient must be nonnegative.
1141       
1142        The actor must be dynamic.
1143
1144        <b>Default:</b> 0.05
1145
1146        \param[in] angDamp Angular damping coefficient. <b>Range:</b> [0,inf)
1147
1148        <b>Platform:</b>
1149        \li PC SW: Yes
1150        \li PPU  : Yes
1151        \li PS3  : Yes
1152        \li XB360: Yes
1153
1154        @see getAngularDamping() NxBodyDesc.angularDamping setLinearDamping()
1155        */
1156        virtual         void                    setAngularDamping(NxReal angDamp) = 0;
1157
1158        /**
1159        \brief Retrieves the angular damping coefficient.
1160
1161        The actor must be dynamic.
1162
1163        \return The angular damping coefficient associated with this actor.
1164
1165        <b>Platform:</b>
1166        \li PC SW: Yes
1167        \li PPU  : Yes
1168        \li PS3  : Yes
1169        \li XB360: Yes
1170
1171        @see setAngularDamping() NxBodyDesc.angularDamping getLinearDamping()
1172        */
1173        virtual         NxReal                  getAngularDamping() const = 0;
1174
1175//@}
1176/************************************************************************************************/
1177/** @name Velocity
1178*/
1179//@{
1180
1181        /**
1182        \brief Sets the linear velocity of the actor.
1183       
1184        Note that if you continuously set the velocity of an actor yourself,
1185        forces such as gravity or friction will not be able to manifest themselves, because forces directly
1186        influence only the velocity/momentum of an actor.
1187
1188        The actor must be dynamic.
1189
1190        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
1191
1192        \param[in] linVel New linear velocity of actor. <b>Range:</b> velocity vector
1193
1194        <b>Platform:</b>
1195        \li PC SW: Yes
1196        \li PPU  : Yes
1197        \li PS3  : Yes
1198        \li XB360: Yes
1199
1200        @see getLinearVelocity() setAngularVelocity() NxBodyDesc.linearVelocity
1201        */
1202        virtual         void                    setLinearVelocity(const NxVec3& linVel) = 0;
1203
1204        /**
1205        \brief Sets the angular velocity of the actor.
1206       
1207        Note that if you continuously set the angular velocity of an actor yourself,
1208        forces such as friction will not be able to rotate the actor, because forces directly influence only the velocity/momentum.
1209
1210        The actor must be dynamic.
1211
1212        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
1213
1214        \param[in] angVel New angular velocity of actor. <b>Range:</b> angular velocity vector
1215
1216        <b>Platform:</b>
1217        \li PC SW: Yes
1218        \li PPU  : Yes
1219        \li PS3  : Yes
1220        \li XB360: Yes
1221
1222        @see getAngularVelocity() setLinearVelocity() NxBodyDesc.angularVelocity
1223        */
1224        virtual         void                    setAngularVelocity(const NxVec3& angVel) = 0;
1225
1226        /**
1227        \brief Retrieves the linear velocity of an actor.
1228
1229        The actor must be dynamic.
1230
1231        \return The linear velocity of the actor.
1232
1233        <b>Platform:</b>
1234        \li PC SW: Yes
1235        \li PPU  : Yes
1236        \li PS3  : Yes
1237        \li XB360: Yes
1238
1239        @see setLinearVelocity() getAngularVelocity() NxBodyDesc.linearVelocity
1240        */
1241        virtual         NxVec3                  getLinearVelocity()             const = 0;
1242
1243        /**
1244        \brief Retrieves the angular velocity of the actor.
1245
1246        The actor must be dynamic.
1247
1248        \return The angular velocity of the actor.
1249
1250        <b>Platform:</b>
1251        \li PC SW: Yes
1252        \li PPU  : Yes
1253        \li PS3  : Yes
1254        \li XB360: Yes
1255
1256        @see setAngularVelocity() getLinearVelocity() NxBodyDesc.angularVelocity
1257        */
1258        virtual         NxVec3                  getAngularVelocity()    const = 0;
1259
1260        /**
1261        \brief Lets you set the maximum angular velocity permitted for this actor.
1262       
1263        Because for various internal computations, very quickly rotating actors introduce error
1264        into the simulation, which leads to undesired results.
1265
1266        With NxPhysicsSDK::setParameter(MAX_ANGULAR_VELOCITY) you can set the default maximum velocity for actors created
1267        after the call. Bodies' high angular velocities are clamped to this value.
1268
1269        However, because some actors, such as car wheels, should be able to rotate quickly, you can override the default setting
1270        on a per-actor basis with the below call. Note that objects such as wheels which are approximated with spherical or
1271        other smooth collision primitives can be simulated with stability at a much higher angular velocity than, say, a box that
1272        has corners.
1273
1274        The actor must be dynamic.
1275
1276        \param[in] maxAngVel Max allowable angular velocity for actor. <b>Range:</b> (0,inf)
1277
1278        <b>Platform:</b>
1279        \li PC SW: Yes
1280        \li PPU  : Yes
1281        \li PS3  : Yes
1282        \li XB360: Yes
1283
1284        @see getMaxAngularVelocity() NxBodyDesc.maxAngularVelocity
1285        */
1286        virtual         void                    setMaxAngularVelocity(NxReal maxAngVel) = 0;
1287
1288        /**
1289        \brief Retrieves the maximum angular velocity permitted for this actor.
1290
1291        \return The maximum allowed angular velocity for this actor.
1292
1293        The actor must be dynamic.
1294
1295        <b>Platform:</b>
1296        \li PC SW: Yes
1297        \li PPU  : Yes
1298        \li PS3  : Yes
1299        \li XB360: Yes
1300
1301        @see setMaxAngularVelocity NxBodyDesc.maxAngularVelocity
1302        */
1303        virtual         NxReal                  getMaxAngularVelocity() const = 0;
1304
1305//@}
1306/************************************************************************************************/
1307/** @name CCD
1308*/
1309//@{
1310
1311        /**
1312        \brief Sets the CCD Motion Threshold.
1313       
1314        If CCD is globally enabled (parameter NX_CONTINUOUS_CD), it is still skipped for bodies
1315        which have no point on any of their shapes moving more than CCDMotionThreshold distance in
1316        one time step. 
1317       
1318        Hence, CCD is always performed if the threshold is 0.
1319
1320        The actor must be dynamic and the CCD motion threshold must be non-negative.
1321
1322        <h3>Visulizations:</h3>
1323        \li #NX_VISUALIZE_COLLISION_CCD
1324        \li #NX_VISUALIZE_COLLISION_SKELETONS
1325
1326        \param[in] thresh CCD Motion threshold. <b>Range:</b> [0,inf)
1327
1328        <b>Platform:</b>
1329        \li PC SW: Yes
1330        \li PPU  : No
1331        \li PS3  : Yes
1332        \li XB360: Yes
1333
1334        @see getCCDMotionThreshold NxParameter
1335        */
1336        virtual         void                    setCCDMotionThreshold(NxReal thresh) = 0;
1337
1338        /**
1339        \brief Retrieves the CCD Motion threshold for this actor.
1340
1341        \return The CCD threshold for the actor.
1342
1343        The actor must be dynamic.
1344
1345        <b>Platform:</b>
1346        \li PC SW: Yes
1347        \li PPU  : No
1348        \li PS3  : Yes
1349        \li XB360: Yes
1350
1351        @see setCCDMotionThreshold NxParameter
1352        */
1353        virtual         NxReal                  getCCDMotionThreshold() const = 0;
1354
1355//@}
1356/************************************************************************************************/
1357
1358/** @name Momentum
1359*/
1360//@{
1361
1362        /**
1363        \brief Sets the linear momentum of the actor.
1364       
1365        Note that if you continuously set the linear momentum of an actor yourself,
1366        forces such as gravity or friction will not be able to manifest themselves, because forces directly
1367        influence only the velocity/momentum of a actor.
1368
1369        The actor must be dynamic.
1370
1371        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
1372
1373        \param[in] linMoment New linear momentum. <b>Range:</b> momentum vector
1374
1375        <b>Platform:</b>
1376        \li PC SW: Yes
1377        \li PPU  : Yes
1378        \li PS3  : Yes
1379        \li XB360: Yes
1380
1381        @see getLinearMomentum() setAngularMomentum()
1382        */
1383        virtual         void                    setLinearMomentum(const NxVec3& linMoment) = 0;
1384
1385        /**
1386        \brief Sets the angular momentum of the actor.
1387       
1388        Note that if you continuously set the angular velocity of an actor yourself,
1389        forces such as friction will not be able to rotate the actor, because forces directly
1390        influence only the velocity of actor.
1391
1392        The actor must be dynamic.
1393
1394        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
1395
1396        \param[in] angMoment New angular momentum. <b>Range:</b> angular momentum vector
1397
1398        <b>Platform:</b>
1399        \li PC SW: Yes
1400        \li PPU  : Yes
1401        \li PS3  : Yes
1402        \li XB360: Yes
1403
1404        @see getAngularMomentum() setLinearMomentum()
1405        */
1406        virtual         void                    setAngularMomentum(const NxVec3& angMoment) = 0;
1407
1408        /**
1409        \brief Retrieves the linear momentum of an actor.
1410       
1411        The momentum is equal to the velocity times the mass.
1412
1413        The actor must be dynamic.
1414
1415        \return The linear momentum for the actor.
1416
1417        <b>Platform:</b>
1418        \li PC SW: Yes
1419        \li PPU  : Yes
1420        \li PS3  : Yes
1421        \li XB360: Yes
1422
1423        @see setLinearMomentum() getAngularMomentum()
1424        */
1425        virtual         NxVec3                  getLinearMomentum()             const = 0;
1426
1427        /**
1428        \brief Retrieves the angular velocity of an actor.
1429       
1430        The angular momentum is equal to the angular velocity times the global space inertia tensor.
1431
1432        The actor must be dynamic.
1433
1434        \return The angular momentum for the actor.
1435
1436        <b>Platform:</b>
1437        \li PC SW: Yes
1438        \li PPU  : Yes
1439        \li PS3  : Yes
1440        \li XB360: Yes
1441
1442        @see setAngularMomentum() getLinearMomentum()
1443        */
1444        virtual         NxVec3                  getAngularMomentum()    const = 0;
1445
1446//@}
1447
1448/************************************************************************************************/
1449
1450/** @name Forces
1451*/
1452//@{
1453
1454        /**
1455        \brief Applies a force (or impulse) defined in the global coordinate frame, acting at a particular
1456        point in global coordinates, to the actor.
1457
1458        Note that if the force does not act along the center of mass of the actor, this
1459        will also add the corresponding torque. Because forces are reset at the end of every timestep,
1460        you can maintain a total external force on an object by calling this once every frame.
1461
1462    ::NxForceMode determines if the force is to be conventional or impulsive.
1463
1464        The actor must be dynamic.
1465
1466        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
1467
1468        \param[in] force Force/impulse to add, defined in the global frame. <b>Range:</b> force vector
1469        \param[in] pos Position in the global frame to add the force at. <b>Range:</b> position vector
1470        \param[in] mode The mode to use when applying the force/impulse(see #NxForceMode)
1471
1472        <b>Platform:</b>
1473        \li PC SW: Yes
1474        \li PPU  : Yes
1475        \li PS3  : Yes
1476        \li XB360: Yes
1477
1478        @see NxForceMode
1479        @see addForceAtLocalPos() addLocalForceAtPos() addLocalForceAtLocalPos() addForce() addLocalForce()
1480        */
1481        virtual         void                    addForceAtPos(const NxVec3& force, const NxVec3& pos, NxForceMode mode = NX_FORCE) = 0;
1482
1483        /**
1484        \brief Applies a force (or impulse) defined in the global coordinate frame, acting at a particular
1485        point in local coordinates, to the actor.
1486
1487        Note that if the force does not act along the center of mass of the actor, this
1488        will also add the corresponding torque. Because forces are reset at the end of every timestep, you can maintain a
1489        total external force on an object by calling this once every frame.
1490
1491        ::NxForceMode determines if the force is to be conventional or impulsive.
1492
1493        The actor must be dynamic.
1494
1495        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
1496
1497        \param[in] force Force/impulse to add, defined in the global frame. <b>Range:</b> force vector
1498        \param[in] pos Position in the local frame to add the force at. <b>Range:</b> position vector
1499        \param[in] mode The mode to use when applying the force/impulse(see #NxForceMode)
1500
1501        <b>Platform:</b>
1502        \li PC SW: Yes
1503        \li PPU  : Yes
1504        \li PS3  : Yes
1505        \li XB360: Yes
1506
1507        @see NxForceMode
1508        @see addForceAtPos() addLocalForceAtPos() addLocalForceAtLocalPos() addForce() addLocalForce()
1509        */
1510        virtual         void                    addForceAtLocalPos(const NxVec3& force, const NxVec3& pos, NxForceMode mode = NX_FORCE) = 0;
1511
1512        /**
1513        \brief Applies a force (or impulse) defined in the actor local coordinate frame, acting at a
1514        particular point in global coordinates, to the actor.
1515
1516        Note that if the force does not act along the center of mass of the actor, this
1517        will also add the corresponding torque. Because forces are reset at the end of every timestep, you can maintain a
1518        total external force on an object by calling this once every frame.
1519
1520        ::NxForceMode determines if the force is to be conventional or impulsive.
1521
1522        The actor must be dynamic.
1523
1524        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
1525
1526        \param[in] force Force/impulse to add, defined in the local frame. <b>Range:</b> force vector
1527        \param[in] pos Position in the global frame to add the force at. <b>Range:</b> position vector
1528        \param[in] mode The mode to use when applying the force/impulse(see #NxForceMode)
1529
1530        <b>Platform:</b>
1531        \li PC SW: Yes
1532        \li PPU  : Yes
1533        \li PS3  : Yes
1534        \li XB360: Yes
1535
1536        @see NxForceMode
1537        @see addForceAtPos() addForceAtLocalPos() addLocalForceAtLocalPos() addForce() addLocalForce()
1538        */
1539        virtual         void                    addLocalForceAtPos(const NxVec3& force, const NxVec3& pos, NxForceMode mode = NX_FORCE) = 0;
1540
1541        /**
1542        \brief Applies a force (or impulse) defined in the actor local coordinate frame, acting at a
1543        particular point in local coordinates, to the actor.
1544
1545        Note that if the force does not act along the center of mass of the actor, this
1546        will also add the corresponding torque. Because forces are reset at the end of every timestep, you can maintain a
1547        total external force on an object by calling this once every frame.
1548
1549        ::NxForceMode determines if the force is to be conventional or impulsive.
1550
1551        The actor must be dynamic.
1552
1553        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
1554
1555        \param[in] force Force/impulse to add, defined in the local frame. <b>Range:</b> force vector
1556        \param[in] pos Position in the local frame to add the force at. <b>Range:</b> position vector
1557        \param[in] mode The mode to use when applying the force/impulse(see #NxForceMode)
1558
1559        <b>Platform:</b>
1560        \li PC SW: Yes
1561        \li PPU  : Yes
1562        \li PS3  : Yes
1563        \li XB360: Yes
1564
1565        @see NxForceMode
1566        @see addForceAtPos() addForceAtLocalPos() addLocalForceAtPos() addForce() addLocalForce()
1567        */
1568        virtual         void                    addLocalForceAtLocalPos(const NxVec3& force, const NxVec3& pos, NxForceMode mode = NX_FORCE) = 0;
1569
1570        /**
1571        \brief Applies a force (or impulse) defined in the global coordinate frame to the actor.
1572
1573        <b>This will not induce a torque</b>.
1574
1575        ::NxForceMode determines if the force is to be conventional or impulsive.
1576
1577        The actor must be dynamic.
1578
1579        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
1580
1581        \param[in] force Force/Impulse to apply defined in the global frame. <b>Range:</b> force vector
1582        \param[in] mode The mode to use when applying the force/impulse(see #NxForceMode)
1583
1584        <b>Platform:</b>
1585        \li PC SW: Yes
1586        \li PPU  : Yes
1587        \li PS3  : Yes
1588        \li XB360: Yes
1589
1590        @see NxForceMode
1591        @see addForceAtPos() addForceAtLocalPos() addLocalForceAtPos() addLocalForceAtLocalPos() addLocalForce()
1592        */
1593        virtual         void                    addForce(const NxVec3& force, NxForceMode mode = NX_FORCE) = 0;
1594
1595        /**
1596        \brief Applies a force (or impulse) defined in the actor local coordinate frame to the actor.
1597
1598        <b>This will not induce a torque</b>.
1599
1600        ::NxForceMode determines if the force is to be conventional or impulsive.
1601
1602        The actor must be dynamic.
1603
1604        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
1605
1606        \param[in] force Force/Impulse to apply defined in the local frame. <b>Range:</b> force vector
1607        \param[in] mode The mode to use when applying the force/impulse(see #NxForceMode)
1608
1609        <b>Platform:</b>
1610        \li PC SW: Yes
1611        \li PPU  : Yes
1612        \li PS3  : Yes
1613        \li XB360: Yes
1614
1615        @see NxForceMode
1616        @see addForceAtPos() addForceAtLocalPos() addLocalForceAtPos() addLocalForceAtLocalPos() addForce()
1617        */
1618        virtual         void                    addLocalForce(const NxVec3& force, NxForceMode mode = NX_FORCE) = 0;
1619
1620        /**
1621        \brief Applies an impulsive torque defined in the global coordinate frame to the actor.
1622
1623        ::NxForceMode determines if the torque is to be conventional or impulsive.
1624
1625        The actor must be dynamic.
1626
1627        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
1628
1629        \param[in] torque Torque to apply defined in the global frame. <b>Range:</b> torque vector
1630        \param[in] mode The mode to use when applying the force/impulse(see #NxForceMode).
1631
1632        <b>Platform:</b>
1633        \li PC SW: Yes
1634        \li PPU  : Yes
1635        \li PS3  : Yes
1636        \li XB360: Yes
1637
1638        @see NxForceMode addLocalTorque() addForce()
1639        */
1640        virtual         void                    addTorque(const NxVec3& torque, NxForceMode mode = NX_FORCE) = 0;
1641
1642        /**
1643        \brief Applies an impulsive torque defined in the actor local coordinate frame to the actor.
1644
1645        ::NxForceMode determines if the torque is to be conventional or impulsive.
1646
1647        The actor must be dynamic.
1648
1649        <b>Sleeping:</b> This call wakes the actor if it is sleeping.
1650
1651        \param[in] torque Torque to apply defined in the local frame. <b>Range:</b> torque vector
1652        \param[in] mode The mode to use when applying the force/impulse(see #NxForceMode).
1653
1654        <b>Platform:</b>
1655        \li PC SW: Yes
1656        \li PPU  : Yes
1657        \li PS3  : Yes
1658        \li XB360: Yes
1659
1660        @see NxForceMode addTorque() addForce()
1661        */
1662        virtual         void                    addLocalTorque(const NxVec3& torque, NxForceMode mode = NX_FORCE) = 0;
1663
1664//@}
1665/************************************************************************************************/
1666
1667        /**
1668        \brief Computes the total kinetic (rotational and translational) energy of the object.
1669
1670        The actor must be dynamic.
1671
1672        <b>Platform:</b>
1673        \li PC SW: Yes
1674        \li PPU  : Yes
1675        \li PS3  : Yes
1676        \li XB360: Yes
1677
1678        \return The kinetic energy of the actor.
1679        */
1680        virtual         NxReal                  computeKineticEnergy() const = 0;
1681
1682/************************************************************************************************/
1683
1684/** @name Point Velocity
1685*/
1686//@{
1687
1688        /**
1689        \brief Computes the velocity of a point given in world coordinates if it were attached to the
1690        actor and moving with it.
1691
1692        The actor must be dynamic.
1693
1694        \param[in] point Point we wish to determine the velocity for, defined in the global frame. <b>Range:</b> position vector
1695        \return The velocity of point in the global frame.
1696
1697        <b>Platform:</b>
1698        \li PC SW: Yes
1699        \li PPU  : Yes
1700        \li PS3  : Yes
1701        \li XB360: Yes
1702
1703        @see getLocalPointVelocity() NxBodyDesc.linearVelocity NxBodyDesc.angularVelocity
1704        */
1705        virtual         NxVec3                  getPointVelocity(const NxVec3& point)   const           = 0;
1706
1707        /**
1708        \brief Computes the velocity of a point given in body local coordinates if it were attached to the
1709        actor and moving with it.
1710
1711        The actor must be dynamic.
1712
1713        \param[in] point Point we wish to determine the velocity of, defined in the local frame. <b>Range:</b> position vector
1714        \return The velocity of point in the actors frame.
1715
1716        <b>Platform:</b>
1717        \li PC SW: Yes
1718        \li PPU  : Yes
1719        \li PS3  : Yes
1720        \li XB360: Yes
1721
1722        @see getPointVelocity() NxBodyDesc.linearVelocity NxBodyDesc.angularVelocity
1723        */
1724        virtual         NxVec3                  getLocalPointVelocity(const NxVec3& point)      const   = 0;
1725
1726//@}
1727/************************************************************************************************/
1728
1729/** @name Sleeping
1730*/
1731//@{
1732
1733        /**
1734        \brief Returns true if this body and all the actors it is touching or is linked to with joints are sleeping.
1735
1736        When an actor does not move for a period of time, it is no longer simulated in order to save time. This state
1737        is called sleeping. However, because the object automatically wakes up when it is either touched by an awake object,
1738        or one of its properties is changed by the user, the entire sleep mechanism should be transparent to the user.
1739       
1740        If an actor is not asleep, its group won't be either, but if it is asleep, its group may not be.
1741       
1742        The actor must be dynamic.
1743
1744        \return True if the actors group is sleeping.
1745
1746        <b>Platform:</b>
1747        \li PC SW: Yes
1748        \li PPU  : No
1749        \li PS3  : Yes
1750        \li XB360: Yes
1751
1752        @see isGroupSleeping() isSleeping() getSleepLinearVelocity() getSleepAngularVelocity() wakeUp() putToSleep()
1753        */
1754        virtual         bool                    isGroupSleeping() const = 0;
1755
1756        /**
1757        \brief Returns true if this body is sleeping.
1758
1759        When an actor does not move for a period of time, it is no longer simulated in order to save time. This state
1760        is called sleeping. However, because the object automatically wakes up when it is either touched by an awake object,
1761        or one of its properties is changed by the user, the entire sleep mechanism should be transparent to the user.
1762       
1763        If an actor is not asleep, its group won't be either, but if it is asleep, its group may not be.
1764
1765        If an actor is asleep after the call to NxScene::fetchResults() returns, it is guaranteed that the pose of the actor
1766        was not changed. You can use this information to avoid updating the transforms of associated of dependant objects.
1767       
1768        The actor must be dynamic.
1769
1770        \return True if the actor is sleeping.
1771
1772        <b>Platform:</b>
1773        \li PC SW: Yes
1774        \li PPU  : Yes (Sleep behavior on hardware differs)
1775        \li PS3  : Yes
1776        \li XB360: Yes
1777
1778        @see isGroupSleeping() isSleeping() getSleepLinearVelocity() getSleepAngularVelocity() wakeUp() putToSleep()
1779        */
1780        virtual         bool                    isSleeping() const = 0;
1781
1782        /**
1783        \brief Returns the linear velocity below which an actor may go to sleep.
1784       
1785        Actors whose linear velocity is above this threshold will not be put to sleep.
1786   
1787    The actor must be dynamic.
1788
1789    @see isSleeping
1790
1791        \return The threshold linear velocity for sleeping.
1792
1793        <b>Platform:</b>
1794        \li PC SW: Yes
1795        \li PPU  : Yes (Sleep behavior on hardware differs)
1796        \li PS3  : Yes
1797        \li XB360: Yes
1798
1799        @see isGroupSleeping() isSleeping() getSleepLinearVelocity() getSleepAngularVelocity() wakeUp() putToSleep() setSleepLinearVelocity()
1800        */
1801    virtual             NxReal                  getSleepLinearVelocity() const = 0;
1802
1803    /**
1804        \brief Sets the linear velocity below which an actor may go to sleep.
1805       
1806        Actors whose linear velocity is above this threshold will not be put to sleep.
1807       
1808        If the threshold value is negative,     the velocity threshold is set using the NxPhysicsSDK's
1809        NX_DEFAULT_SLEEP_LIN_VEL_SQUARED parameter.
1810   
1811    The actor must be dynamic.
1812
1813        \param[in] threshold Linear velocity below which an actor may sleep. <b>Range:</b> (0,inf]
1814
1815        <b>Platform:</b>
1816        \li PC SW: Yes
1817        \li PPU  : Yes (Sleep behavior on hardware differs)
1818        \li PS3  : Yes
1819        \li XB360: Yes
1820
1821        @see isGroupSleeping() isSleeping() getSleepLinearVelocity() getSleepAngularVelocity() wakeUp() putToSleep()
1822        */
1823    virtual             void                    setSleepLinearVelocity(NxReal threshold) = 0;
1824
1825        /**
1826        \brief Returns the angular velocity below which an actor may go to sleep.
1827       
1828        Actors whose angular velocity is above this threshold will not be put to sleep.
1829   
1830    The actor must be dynamic.
1831
1832    \return The threshold angular velocity for sleeping.
1833
1834        <b>Platform:</b>
1835        \li PC SW: Yes
1836        \li PPU  : Yes (Sleep behavior on hardware differs)
1837        \li PS3  : Yes
1838        \li XB360: Yes
1839
1840        @see isGroupSleeping() isSleeping() getSleepLinearVelocity() getSleepAngularVelocity() wakeUp() putToSleep() setSleepAngularVelocity()
1841        */
1842    virtual             NxReal                  getSleepAngularVelocity() const = 0;
1843
1844        /**
1845        \brief Sets the angular velocity below which an actor may go to sleep.
1846       
1847        Actors whose angular velocity is above this threshold will not be put to sleep.
1848
1849        If the threshold value is negative,     the velocity threshold is set using the NxPhysicsSDK's
1850        NX_DEFAULT_SLEEP_LIN_VEL_SQUARED parameter.
1851   
1852    The actor must be dynamic.
1853
1854        \param[in] threshold Angular velocity below which an actor may go to sleep. <b>Range:</b> (0,inf]
1855
1856        <b>Platform:</b>
1857        \li PC SW: Yes
1858        \li PPU  : Yes (Sleep behavior on hardware differs)
1859        \li PS3  : Yes
1860        \li XB360: Yes
1861
1862    @see isGroupSleeping() isSleeping() getSleepLinearVelocity() getSleepAngularVelocity() wakeUp() putToSleep() setSleepLinearVelocity()
1863        */
1864    virtual             void                    setSleepAngularVelocity(NxReal threshold) = 0;
1865
1866        /**
1867        \brief Wakes up the actor if it is sleeping. 
1868
1869        The wakeCounterValue determines how long until the body is put to sleep, a value of zero means
1870        that the body is sleeping. wakeUp(0) is equivalent to NxActor::putToSleep().
1871
1872        The actor must be dynamic.
1873
1874        \param[in] wakeCounterValue New sleep counter value. <b>Range:</b> [0,inf]
1875       
1876        <b>Platform:</b>
1877        \li PC SW: Yes
1878        \li PPU  : Yes (Sleep behavior on hardware differs)
1879        \li PS3  : Yes
1880        \li XB360: Yes
1881
1882        @see isGroupSleeping() isSleeping() getSleepLinearVelocity() getSleepAngularVelocity() putToSleep()
1883        */
1884        virtual         void                    wakeUp(NxReal wakeCounterValue=NX_NUM_SLEEP_FRAMES)     = 0;
1885
1886        /**
1887        \brief Forces the actor to sleep.
1888       
1889        The actor will stay asleep until the next call to simulate, and will not wake up until then even when otherwise
1890        it would (for example a force is applied to it). It can however wake up during
1891        the next simulate call.
1892
1893        The actor must be dynamic.
1894       
1895        <b>Platform:</b>
1896        \li PC SW: Yes
1897        \li PPU  : Yes (Sleep behavior on hardware differs)
1898        \li PS3  : Yes
1899        \li XB360: Yes
1900
1901        @see isGroupSleeping() isSleeping() getSleepLinearVelocity() getSleepAngularVelocity() wakeUp()
1902        */
1903        virtual         void                    putToSleep()    = 0;
1904//@}
1905/************************************************************************************************/
1906
1907        /**
1908        \brief Raises a particular body flag.
1909       
1910        See the actors body flags. See #NxBodyFlag for a list of flags.
1911
1912        The actor must be dynamic.
1913
1914        \param[in] bodyFlag Body flag to raise(set). See #NxBodyFlag.
1915
1916        <b>Platform:</b>
1917        \li PC SW: Yes
1918        \li PPU  : Partial (supports NX_BF_KINEMATIC, NX_BF_DISABLE_GRAVITY)
1919        \li PS3  : Yes
1920        \li XB360: Yes
1921
1922        @see NxBodyFlag clearBodyFlag() readBodyFlag() NxBodyDesc.flags
1923        */
1924        virtual         void                    raiseBodyFlag(NxBodyFlag bodyFlag)                              = 0;
1925       
1926        /**
1927        \brief Clears a particular body flag.
1928       
1929        See #NxBodyFlag for a list of flags.
1930
1931        The actor must be dynamic.
1932
1933        \param[in] bodyFlag Body flag to clear. See #NxBodyFlag.
1934
1935        <b>Platform:</b>
1936        \li PC SW: Yes
1937        \li PPU  : Partial (supports NX_BF_KINEMATIC, NX_BF_DISABLE_GRAVITY)
1938        \li PS3  : Yes
1939        \li XB360: Yes
1940
1941        @see NxBodyFlag raiseBodyFlag() readBodyFlag() NxBodyDesc.flags
1942        */
1943        virtual         void                    clearBodyFlag(NxBodyFlag bodyFlag)                              = 0;
1944        /**
1945        \brief Reads a particular body flag.
1946       
1947        See #NxBodyFlag for a list of flags.
1948
1949        The actor must be dynamic.
1950
1951        \param[in] bodyFlag Body flag to retrieve. See #NxBodyFlag.
1952        \return The value of the body flag specified by bodyFlag.
1953       
1954        <b>Platform:</b>
1955        \li PC SW: Yes
1956        \li PPU  : Partial (supports NX_BF_KINEMATIC, NX_BF_DISABLE_GRAVITY)
1957        \li PS3  : Yes
1958        \li XB360: Yes
1959
1960        @see NxBodyFlag raiseBodyFlag() clearBodyFlag() NxBodyDesc.flags
1961        */
1962        virtual         bool                    readBodyFlag(NxBodyFlag bodyFlag)               const   = 0;
1963
1964        /**
1965        \brief Saves the body information of a dynamic actor to the passed body descriptor.
1966
1967        This method only save the dynamic(body) state for the actor. The user should use #saveToDesc()
1968        to save the state common between static and dynamic actors. Plus manually saving the shapes
1969        belonging to the actor.
1970
1971        The actor must be dynamic.
1972
1973        \param[out] bodyDesc Descriptor to save the state of the body to.
1974        \return True for a dynamic body. Otherwise False.
1975
1976        <b>Platform:</b>
1977        \li PC SW: Yes
1978        \li PPU  : Yes
1979        \li PS3  : Yes
1980        \li XB360: Yes
1981
1982        @see NxBodyDesc saveToDesc() getShape()
1983        */
1984        virtual         bool                    saveBodyToDesc(NxBodyDesc& bodyDesc) = 0;
1985
1986        /**
1987        \brief Sets the solver iteration count for the body.
1988       
1989        The solver iteration count determinews how accuratly joints and contacts are resolved.
1990        If you are having trouble with jointed bodies oscillating and behaving eratically setting
1991        a higher solver iteration count may improve there stability.
1992
1993        The actor must be dynamic.
1994
1995        \param[in] iterCount Number of iterations the solver should perform for this body. <b>Range:</b> [1,NX_MAX_U32]
1996
1997        <b>Platform:</b>
1998        \li PC SW: Yes
1999        \li PPU  : No
2000        \li PS3  : Yes
2001        \li XB360: Yes
2002
2003        @see getSolverIterationCount() NxBodyDesc.solverIterationCount
2004        */
2005        virtual         void                    setSolverIterationCount(NxU32 iterCount) = 0;
2006
2007        /**
2008        \brief Retrieves the solver iteration count.
2009
2010        See #setSolverIterationCount().
2011
2012        The actor must be dynamic.
2013
2014        \return The solver iteration count for this body.
2015
2016        <b>Platform:</b>
2017        \li PC SW: Yes
2018        \li PPU  : No
2019        \li PS3  : Yes
2020        \li XB360: Yes
2021
2022        @see setSolverIterationCount() NxBodyDesc.solverIterationCount
2023        */
2024        virtual         NxU32                   getSolverIterationCount() const = 0;
2025
2026        //public variables:
2027                                void*                   userData;       //!< user can assign this to whatever, usually to create a 1:1 relationship with a user object.
2028        };
2029
2030/** @} */
2031#endif
2032
2033
2034//AGCOPYRIGHTBEGIN
2035///////////////////////////////////////////////////////////////////////////
2036// Copyright © 2005 AGEIA Technologies.
2037// All rights reserved. www.ageia.com
2038///////////////////////////////////////////////////////////////////////////
2039//AGCOPYRIGHTEND
2040
Note: See TracBrowser for help on using the repository browser.