[1378] | 1 | #ifndef NX_COLLISION_NXCAPSULESHAPE
|
---|
| 2 | #define NX_COLLISION_NXCAPSULESHAPE
|
---|
| 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 "NxShape.h"
|
---|
| 16 |
|
---|
| 17 | class NxShape;
|
---|
| 18 | class NxCapsule;
|
---|
| 19 | class NxCapsuleShapeDesc;
|
---|
| 20 |
|
---|
| 21 | /**
|
---|
| 22 | \brief A capsule shaped collision detection primitive, also known as a line swept sphere.
|
---|
| 23 |
|
---|
| 24 | 'radius' is the radius of the capsule's hemispherical ends and its trunk.
|
---|
| 25 | 'height' is the distance between the two hemispherical ends of the capsule.
|
---|
| 26 | The height is along the capsule's Y axis.
|
---|
| 27 |
|
---|
| 28 | Each shape is owned by an actor that it is attached to.
|
---|
| 29 |
|
---|
| 30 | <h3>Creation</h3>
|
---|
| 31 |
|
---|
| 32 | An instance can be created by calling the createShape() method of the NxActor object
|
---|
| 33 | that should own it, with a NxCapsuleShapeDesc object as the parameter, or by adding the
|
---|
| 34 | shape descriptor into the NxActorDesc class before creating the actor.
|
---|
| 35 |
|
---|
| 36 | Example:
|
---|
| 37 |
|
---|
| 38 | \include NxCapsuleShape_Create.cpp
|
---|
| 39 |
|
---|
| 40 | The shape is deleted by calling NxActor::releaseShape() on the owning actor.
|
---|
| 41 |
|
---|
| 42 | <h3>Visualizations</h3>
|
---|
| 43 | \li NX_VISUALIZE_COLLISION_AABBS
|
---|
| 44 | \li NX_VISUALIZE_COLLISION_SHAPES
|
---|
| 45 | \li NX_VISUALIZE_COLLISION_AXES
|
---|
| 46 |
|
---|
| 47 | @see NxCapsuleShapeDesc NxShape NxActor.createShape()
|
---|
| 48 | */
|
---|
| 49 |
|
---|
| 50 | class NxCapsuleShape: public NxShape
|
---|
| 51 | {
|
---|
| 52 | public:
|
---|
| 53 | /**
|
---|
| 54 | \brief Call this to initialize or alter the capsule.
|
---|
| 55 |
|
---|
| 56 | <b>Sleeping:</b> Does <b>NOT</b> wake the associated actor up automatically.
|
---|
| 57 |
|
---|
| 58 | \param[in] radius The new radius of the capsule. <b>Range:</b> (0,inf)
|
---|
| 59 | \param[in] height The new height of the capsule. <b>Range:</b> (0,inf)
|
---|
| 60 |
|
---|
| 61 | <b>Platform:</b>
|
---|
| 62 | \li PC SW: Yes
|
---|
| 63 | \li PPU : Yes
|
---|
| 64 | \li PS3 : Yes
|
---|
| 65 | \li XB360: Yes
|
---|
| 66 |
|
---|
| 67 | @see setRadius() setHeight()
|
---|
| 68 | */
|
---|
| 69 | virtual void setDimensions(NxReal radius, NxReal height) = 0;
|
---|
| 70 |
|
---|
| 71 | /**
|
---|
| 72 | \brief Alters the radius of the capsule.
|
---|
| 73 |
|
---|
| 74 | <b>Sleeping:</b> Does <b>NOT</b> wake the associated actor up automatically.
|
---|
| 75 |
|
---|
| 76 | \param[in] radius The new radius of the capsule. <b>Range:</b> (0,inf)
|
---|
| 77 |
|
---|
| 78 | <b>Platform:</b>
|
---|
| 79 | \li PC SW: Yes
|
---|
| 80 | \li PPU : Yes
|
---|
| 81 | \li PS3 : Yes
|
---|
| 82 | \li XB360: Yes
|
---|
| 83 |
|
---|
| 84 | @see setDimensions() NxCapsuleShapeDesc.radius getRadius()
|
---|
| 85 | */
|
---|
| 86 | virtual void setRadius(NxReal radius) = 0;
|
---|
| 87 |
|
---|
| 88 | /**
|
---|
| 89 | \brief Retrieves the radius of the capsule.
|
---|
| 90 |
|
---|
| 91 | \return The radius of the capsule.
|
---|
| 92 |
|
---|
| 93 | <b>Platform:</b>
|
---|
| 94 | \li PC SW: Yes
|
---|
| 95 | \li PPU : Yes
|
---|
| 96 | \li PS3 : Yes
|
---|
| 97 | \li XB360: Yes
|
---|
| 98 |
|
---|
| 99 | @see setRadius() setDimensions() NxCapsuleShapeDesc.radius
|
---|
| 100 | */
|
---|
| 101 | virtual NxReal getRadius() const = 0;
|
---|
| 102 |
|
---|
| 103 | /**
|
---|
| 104 | \brief Alters the height of the capsule.
|
---|
| 105 |
|
---|
| 106 | <b>Sleeping:</b> Does <b>NOT</b> wake the associated actor up automatically.
|
---|
| 107 |
|
---|
| 108 | \param[in] height The new height of the capsule. <b>Range:</b> (0,inf)
|
---|
| 109 |
|
---|
| 110 | <b>Platform:</b>
|
---|
| 111 | \li PC SW: Yes
|
---|
| 112 | \li PPU : Yes
|
---|
| 113 | \li PS3 : Yes
|
---|
| 114 | \li XB360: Yes
|
---|
| 115 |
|
---|
| 116 | @see getHeight() NxCapsuleShapeDesc.height getRadius() setDimensions()
|
---|
| 117 | */
|
---|
| 118 | virtual void setHeight(NxReal height) = 0;
|
---|
| 119 |
|
---|
| 120 | /**
|
---|
| 121 | \brief Retrieves the height of the capsule.
|
---|
| 122 |
|
---|
| 123 | \return The height of the capsule measured from end to end.
|
---|
| 124 |
|
---|
| 125 | <b>Platform:</b>
|
---|
| 126 | \li PC SW: Yes
|
---|
| 127 | \li PPU : Yes
|
---|
| 128 | \li PS3 : Yes
|
---|
| 129 | \li XB360: Yes
|
---|
| 130 |
|
---|
| 131 | @see setHeight() setRadius() NxCapsuleShapeDesc.height
|
---|
| 132 | */
|
---|
| 133 | virtual NxReal getHeight() const = 0;
|
---|
| 134 |
|
---|
| 135 | /**
|
---|
| 136 | \brief Retrieves the capsule parameters in world space. See #NxCapsule.
|
---|
| 137 |
|
---|
| 138 | \param[out] worldCapsule Use to retrieve the capsule parameters in world space.
|
---|
| 139 |
|
---|
| 140 | <b>Platform:</b>
|
---|
| 141 | \li PC SW: Yes
|
---|
| 142 | \li PPU : Yes
|
---|
| 143 | \li PS3 : Yes
|
---|
| 144 | \li XB360: Yes
|
---|
| 145 |
|
---|
| 146 | @see NxCapsule
|
---|
| 147 | */
|
---|
| 148 | virtual void getWorldCapsule(NxCapsule& worldCapsule) const = 0;
|
---|
| 149 |
|
---|
| 150 | /*
|
---|
| 151 | \brief Saves the state of the shape object to a descriptor.
|
---|
| 152 |
|
---|
| 153 | \param[out] desc Descriptor to save the state of the object to.
|
---|
| 154 |
|
---|
| 155 | <b>Platform:</b>
|
---|
| 156 | \li PC SW: Yes
|
---|
| 157 | \li PPU : Yes
|
---|
| 158 | \li PS3 : Yes
|
---|
| 159 | \li XB360: Yes
|
---|
| 160 |
|
---|
| 161 | @see NxCapsuleShapeDesc
|
---|
| 162 | */
|
---|
| 163 | virtual void saveToDesc(NxCapsuleShapeDesc& desc) const = 0;
|
---|
| 164 | };
|
---|
| 165 |
|
---|
| 166 | /** @} */
|
---|
| 167 | #endif
|
---|
| 168 |
|
---|
| 169 |
|
---|
| 170 | //AGCOPYRIGHTBEGIN
|
---|
| 171 | ///////////////////////////////////////////////////////////////////////////
|
---|
| 172 | // Copyright © 2005 AGEIA Technologies.
|
---|
| 173 | // All rights reserved. www.ageia.com
|
---|
| 174 | ///////////////////////////////////////////////////////////////////////////
|
---|
| 175 | //AGCOPYRIGHTEND
|
---|
| 176 |
|
---|