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

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

GTPD - Jungle Rumble - integrate into GTP SVN structure

Line 
1#ifndef NX_COLLISION_NXPLANESHAPE
2#define NX_COLLISION_NXPLANESHAPE
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
17class NxPlane;
18class NxPlaneShapeDesc;
19
20/**
21\brief A plane collision detection primitive.
22
23By default it is configured to be the y == 0 plane. You can then set a normal and a d to specify
24an arbitrary plane. d is the distance of the plane from the origin along the normal, assuming
25the normal is normalized. Thus the plane equation is:
26normal.x * X + normal.y * Y + normal.z * Z  = d
27
28Note: the plane does not represent an infinitely thin object, but rather a completely solid negative
29half space (all points p for which normal.dot(p) - d < 0 are inside the solid region.)
30
31
32Each shape is owned by an actor that it is attached to.
33
34
35<h3>Creation</h3>
36
37An instance can be created by calling the createShape() method of the NxActor object
38that should own it, with a NxPlaneShapeDesc object as the parameter, or by adding the
39shape descriptor into the NxActorDesc class before creating the actor.
40
41The shape is deleted by calling NxActor::releaseShape() on the owning actor.
42
43Example:
44
45\include NxPlaneShape_Create.cpp
46
47<h3>Visualizations</h3>
48\li NX_VISUALIZE_COLLISION_AABBS
49\li NX_VISUALIZE_COLLISION_SHAPES
50\li NX_VISUALIZE_COLLISION_AXES
51
52@see NxActor.createShape() NxPlaneShapeDesc NxShape NxPlane
53*/
54
55class NxPlaneShape: public NxShape
56        {
57        public:
58
59        /**
60        \brief sets the plane equation.
61
62        <b>Sleeping:</b> Does <b>NOT</b> wake any actors associated with the shape.
63
64        \param[in] normal Normal for the plane, in the global frame. <b>Range:</b> direction vector
65        \param[in] d 'd' coefficient of the plane equation. <b>Range:</b> (-inf,inf)
66
67        <b>Platform:</b>
68        \li PC SW: Yes
69        \li PPU  : Yes
70        \li PS3  : Yes
71        \li XB360: Yes
72
73        @see getPlane() NxPlane
74        */
75        virtual void setPlane(const NxVec3 & normal, NxReal d) = 0;
76
77        /*
78        \brief Saves the state of the shape object to a descriptor.
79
80        \param[out] desc Descriptor to save this objects state to.
81
82        <b>Platform:</b>
83        \li PC SW: Yes
84        \li PPU  : Yes
85        \li PS3  : Yes
86        \li XB360: Yes
87
88        @see NxPlaneShapeDesc
89        */
90        virtual void    saveToDesc(NxPlaneShapeDesc& desc)      const = 0;
91
92        /**
93        \brief retrieves the plane
94
95        \return The description of this plane. See #NxPlane.
96
97        <b>Platform:</b>
98        \li PC SW: Yes
99        \li PPU  : Yes
100        \li PS3  : Yes
101        \li XB360: Yes
102
103        @see setPlane NxPlane
104        */
105        virtual NxPlane getPlane() const = 0;
106
107        };
108
109/** @} */
110#endif
111
112
113//AGCOPYRIGHTBEGIN
114///////////////////////////////////////////////////////////////////////////
115// Copyright © 2005 AGEIA Technologies.
116// All rights reserved. www.ageia.com
117///////////////////////////////////////////////////////////////////////////
118//AGCOPYRIGHTEND
119
Note: See TracBrowser for help on using the repository browser.