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

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

GTPD - Jungle Rumble - integrate into GTP SVN structure

Line 
1#ifndef NX_COLLISION_NXBOXSHAPEDESC
2#define NX_COLLISION_NXBOXSHAPEDESC
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
16/**
17\brief Descriptor class for #NxBoxShape.
18
19@see NxBox NxShapeDesc NxActor.createShape()
20*/
21class NxBoxShapeDesc : public NxShapeDesc
22        {
23        public:
24        /**
25        \brief Dimensions of the box.
26       
27        The dimensions are the 'radii' of the box, meaning 1/2 extents in x dimension,
28        1/2 extents in y dimension, 1/2 extents in z dimension. All three must be positive.
29
30        <b>Range:</b> .x (0,inf)
31        <b>Range:</b> .y (0,inf)
32        <b>Range:</b> .x (0,inf)
33        <b>Default:</b> Zero
34
35        <b>Platform:</b>
36        \li PC SW: Yes
37        \li PPU  : Yes
38        \li PS3  : Yes
39        \li XB360: Yes
40
41        @see NxBoxShape.setDimensions() NxBoxShape.getDimensions()
42        */
43        NxVec3  dimensions;                     
44
45        /**
46        \brief constructor sets to default.
47        */
48        NX_INLINE                                       NxBoxShapeDesc();       
49        /**
50        \brief (re)sets the structure to the default.   
51        */
52        NX_INLINE virtual       void    setToDefault();
53        /**
54        \brief Returns true if the descriptor is valid.
55
56        \return True if the current settings are valid
57        */
58        NX_INLINE virtual       bool    isValid() const;
59        };
60
61NX_INLINE NxBoxShapeDesc::NxBoxShapeDesc() : NxShapeDesc(NX_SHAPE_BOX)  //constructor sets to default
62        {
63        setToDefault();
64        }
65
66NX_INLINE void NxBoxShapeDesc::setToDefault()
67        {
68        NxShapeDesc::setToDefault();
69        dimensions.zero();
70        }
71
72NX_INLINE bool NxBoxShapeDesc::isValid() const
73        {
74        if(!dimensions.isFinite())                      return false;
75        if(dimensions.x<0.0f)                           return false;
76        if(dimensions.y<0.0f)                           return false;
77        if(dimensions.z<0.0f)                           return false;
78        return NxShapeDesc::isValid();
79        }
80
81/** @} */
82#endif
83
84
85//AGCOPYRIGHTBEGIN
86///////////////////////////////////////////////////////////////////////////
87// Copyright © 2005 AGEIA Technologies.
88// All rights reserved. www.ageia.com
89///////////////////////////////////////////////////////////////////////////
90//AGCOPYRIGHTEND
91
Note: See TracBrowser for help on using the repository browser.