2 Physics Effects Copyright(C) 2010 Sony Computer Entertainment Inc.
\r
5 Physics Effects is open software; you can redistribute it and/or
\r
6 modify it under the terms of the BSD License.
\r
8 Physics Effects is distributed in the hope that it will be useful,
\r
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
\r
11 See the BSD License for more details.
\r
13 A copy of the BSD License is distributed with
\r
14 Physics Effects under the filename: physics_effects_license.txt
\r
17 #ifndef _SCE_PFX_COLLIDABLE_H
\r
18 #define _SCE_PFX_COLLIDABLE_H
\r
20 #include "pfx_shape.h"
\r
23 namespace PhysicsEffects {
\r
25 #define SCE_PFX_NUMPRIMS 64
\r
27 ///////////////////////////////////////////////////////////////////////////////
\r
28 // Collidable Object
\r
30 class SCE_PFX_ALIGNED(128) PfxCollidable
\r
32 friend class PfxShapeIterator;
\r
35 PfxShape *m_shapeBase;
\r
36 PfxUInt16 m_shapeIds[SCE_PFX_NUMPRIMS];
\r
37 PfxUInt8 m_numShapes;
\r
38 PfxUInt8 m_maxShapes;
\r
39 SCE_PFX_PADDING(1,2)
\r
40 PfxFloat m_center[3]; // AABB center (Local)
\r
41 PfxFloat m_half[3]; // AABB half (Local)
\r
42 PfxShape m_defShape;
\r
43 SCE_PFX_PADDING(2,32)
\r
45 inline PfxShape &getNewShape();
\r
48 inline void reset();
\r
49 inline void reset(PfxShape *base,PfxUInt16 *ids,int n=1);
\r
53 void addShape(const PfxShape &shape);
\r
55 inline PfxUInt32 getNumShapes() const;
\r
56 const PfxShape& getDefShape() const {return m_defShape;}
\r
57 PfxShape& getDefShape() {return m_defShape;}
\r
59 inline PfxUInt16 getShapeId(int i) const;
\r
61 inline const PfxShape& getShape(int i) const;
\r
62 inline PfxShape& getShape(int i);
\r
64 inline PfxVector3 getHalf() const;
\r
65 inline PfxVector3 getCenter() const;
\r
68 #include "pfx_collidable_implementation.h"
\r
70 } // namespace PhysicsEffects
\r
73 #endif // _SCE_PFX_COLLIDABLE_H
\r