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

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

GTPD - Jungle Rumble - integrate into GTP SVN structure

Line 
1#ifndef NX_COLLISION_NXTRIANGLEMESHSHAPEDESC
2#define NX_COLLISION_NXTRIANGLEMESHSHAPEDESC
3/*----------------------------------------------------------------------------*\
4|
5|                                               Public Interface to NovodeX Technology
6|
7|                                                            www.novodex.com
8|
9\*----------------------------------------------------------------------------*/
10/** \addtogroup physics
11  @{
12*/
13
14#include "NxShapeDesc.h"
15#include "NxTriangleMeshShape.h"
16
17/**
18\brief Descriptor class for #NxTriangleMeshShape.
19
20@see NxTriangleMeshShape
21*/
22class NxTriangleMeshShapeDesc : public NxShapeDesc
23        {
24        public:
25        /**
26        \brief References the triangle mesh that we want to instance.
27
28        <b>Default:</b> NULL
29
30        <b>Platform:</b>
31        \li PC SW: Yes
32        \li PPU  : Yes
33        \li PS3  : Yes
34        \li XB360: Yes
35
36        @see NxTriangleMesh
37        */
38        NxTriangleMesh* meshData;       
39
40        /**
41        \brief Combination of ::NxMeshShapeFlag.
42
43        <b>Default:</b> 0
44
45        <b>Platform:</b>
46        \li PC SW: Yes
47        \li PPU  : No
48        \li PS3  : Yes
49        \li XB360: Yes
50
51        @see NxMeshShapeFlag
52        */
53        NxU32                   meshFlags;
54#ifdef NX_SUPPORT_MESH_SCALE
55        NxReal                  scale;
56#endif
57        /**
58        \brief Constructor sets to default.
59        */
60        NX_INLINE                                       NxTriangleMeshShapeDesc();     
61        /**
62        \brief (re)sets the structure to the default.   
63        */
64        NX_INLINE virtual       void    setToDefault();
65        /**
66        \brief Returns true if the descriptor is valid.
67
68        \return true if the current settings are valid
69        */
70        NX_INLINE virtual       bool    isValid() const;
71        };
72
73NX_INLINE NxTriangleMeshShapeDesc::NxTriangleMeshShapeDesc() : NxShapeDesc(NX_SHAPE_MESH)       //constructor sets to default
74        {
75        setToDefault();
76        }
77
78NX_INLINE void NxTriangleMeshShapeDesc::setToDefault()
79        {
80        NxShapeDesc::setToDefault();
81        meshData        = NULL;
82        meshFlags       = 0;
83#ifdef NX_SUPPORT_MESH_SCALE
84        scale           = 1.0f;
85#endif
86        }
87
88NX_INLINE bool NxTriangleMeshShapeDesc::isValid() const
89        {
90        if(!meshData)   return false;
91#ifdef NX_SUPPORT_MESH_SCALE
92        if(scale<=0.0f) return false;
93#endif
94        return NxShapeDesc::isValid();
95        }
96
97/** @} */
98#endif
99
100
101//AGCOPYRIGHTBEGIN
102///////////////////////////////////////////////////////////////////////////
103// Copyright © 2005 AGEIA Technologies.
104// All rights reserved. www.ageia.com
105///////////////////////////////////////////////////////////////////////////
106//AGCOPYRIGHTEND
107
Note: See TracBrowser for help on using the repository browser.