Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/archive/environment2/src/external/bullet/BulletCollision/CollisionShapes/btCollisionShape.h @ 10179

Last change on this file since 10179 was 8351, checked in by rgrieder, 14 years ago

Merged kicklib2 branch back to trunk (includes former branches ois_update, mac_osx and kicklib).

Notes for updating

Linux:
You don't need an extra package for CEGUILua and Tolua, it's already shipped with CEGUI.
However you do need to make sure that the OgreRenderer is installed too with CEGUI 0.7 (may be a separate package).
Also, Orxonox now recognises if you install the CgProgramManager (a separate package available on newer Ubuntu on Debian systems).

Windows:
Download the new dependency packages versioned 6.0 and use these. If you have problems with that or if you don't like the in game console problem mentioned below, you can download the new 4.3 version of the packages (only available for Visual Studio 2005/2008).

Key new features:

  • *Support for Mac OS X*
  • Visual Studio 2010 support
  • Bullet library update to 2.77
  • OIS library update to 1.3
  • Support for CEGUI 0.7 —> Support for Arch Linux and even SuSE
  • Improved install target
  • Compiles now with GCC 4.6
  • Ogre Cg Shader plugin activated for Linux if available
  • And of course lots of bug fixes

There are also some regressions:

  • No support for CEGUI 0.5, Ogre 1.4 and boost 1.35 - 1.39 any more
  • In game console is not working in main menu for CEGUI 0.7
  • Tolua (just the C lib, not the application) and CEGUILua libraries are no longer in our repository. —> You will need to get these as well when compiling Orxonox
  • And of course lots of new bugs we don't yet know about
  • Property svn:eol-style set to native
File size: 4.4 KB
Line 
1/*
2Bullet Continuous Collision Detection and Physics Library
3Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
4
5This software is provided 'as-is', without any express or implied warranty.
6In no event will the authors be held liable for any damages arising from the use of this software.
7Permission is granted to anyone to use this software for any purpose,
8including commercial applications, and to alter it and redistribute it freely,
9subject to the following restrictions:
10
111. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
122. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
133. This notice may not be removed or altered from any source distribution.
14*/
15
16#ifndef COLLISION_SHAPE_H
17#define COLLISION_SHAPE_H
18
19#include "LinearMath/btTransform.h"
20#include "LinearMath/btVector3.h"
21#include "LinearMath/btMatrix3x3.h"
22#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" //for the shape types
23class btSerializer;
24
25
26///The btCollisionShape class provides an interface for collision shapes that can be shared among btCollisionObjects.
27class btCollisionShape
28{
29protected:
30        int m_shapeType;
31        void* m_userPointer;
32
33public:
34
35        btCollisionShape() : m_shapeType (INVALID_SHAPE_PROXYTYPE), m_userPointer(0)
36        {
37        }
38
39        virtual ~btCollisionShape()
40        {
41        }
42
43        ///getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t.
44        virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const =0;
45
46        virtual void    getBoundingSphere(btVector3& center,btScalar& radius) const;
47
48        ///getAngularMotionDisc returns the maximus radius needed for Conservative Advancement to handle time-of-impact with rotations.
49        virtual btScalar        getAngularMotionDisc() const;
50
51        virtual btScalar        getContactBreakingThreshold(btScalar defaultContactThresholdFactor) const;
52
53
54        ///calculateTemporalAabb calculates the enclosing aabb for the moving object over interval [0..timeStep)
55        ///result is conservative
56        void calculateTemporalAabb(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep, btVector3& temporalAabbMin,btVector3& temporalAabbMax) const;
57
58
59
60        SIMD_FORCE_INLINE bool  isPolyhedral() const
61        {
62                return btBroadphaseProxy::isPolyhedral(getShapeType());
63        }
64
65        SIMD_FORCE_INLINE bool  isConvex2d() const
66        {
67                return btBroadphaseProxy::isConvex2d(getShapeType());
68        }
69
70        SIMD_FORCE_INLINE bool  isConvex() const
71        {
72                return btBroadphaseProxy::isConvex(getShapeType());
73        }
74        SIMD_FORCE_INLINE bool  isNonMoving() const
75        {
76                return btBroadphaseProxy::isNonMoving(getShapeType());
77        }
78        SIMD_FORCE_INLINE bool  isConcave() const
79        {
80                return btBroadphaseProxy::isConcave(getShapeType());
81        }
82        SIMD_FORCE_INLINE bool  isCompound() const
83        {
84                return btBroadphaseProxy::isCompound(getShapeType());
85        }
86
87        SIMD_FORCE_INLINE bool  isSoftBody() const
88        {
89                return btBroadphaseProxy::isSoftBody(getShapeType());
90        }
91
92        ///isInfinite is used to catch simulation error (aabb check)
93        SIMD_FORCE_INLINE bool isInfinite() const
94        {
95                return btBroadphaseProxy::isInfinite(getShapeType());
96        }
97
98#ifndef __SPU__
99        virtual void    setLocalScaling(const btVector3& scaling) =0;
100        virtual const btVector3& getLocalScaling() const =0;
101        virtual void    calculateLocalInertia(btScalar mass,btVector3& inertia) const = 0;
102
103
104//debugging support
105        virtual const char*     getName()const =0 ;
106#endif //__SPU__
107
108       
109        int             getShapeType() const { return m_shapeType; }
110        virtual void    setMargin(btScalar margin) = 0;
111        virtual btScalar        getMargin() const = 0;
112
113       
114        ///optional user data pointer
115        void    setUserPointer(void*  userPtr)
116        {
117                m_userPointer = userPtr;
118        }
119
120        void*   getUserPointer() const
121        {
122                return m_userPointer;
123        }
124
125        virtual int     calculateSerializeBufferSize() const;
126
127        ///fills the dataBuffer and returns the struct name (and 0 on failure)
128        virtual const char*     serialize(void* dataBuffer, btSerializer* serializer) const;
129
130        virtual void    serializeSingleShape(btSerializer* serializer) const;
131
132};     
133
134///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
135struct  btCollisionShapeData
136{
137        char    *m_name;
138        int             m_shapeType;
139        char    m_padding[4];
140};
141
142SIMD_FORCE_INLINE       int     btCollisionShape::calculateSerializeBufferSize() const
143{
144        return sizeof(btCollisionShapeData);
145}
146
147
148
149#endif //COLLISION_SHAPE_H
150
Note: See TracBrowser for help on using the repository browser.