Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btConeShape.h @ 8351

Last change on this file since 8351 was 8351, checked in by rgrieder, 13 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: 3.2 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 CONE_MINKOWSKI_H
17#define CONE_MINKOWSKI_H
18
19#include "btConvexInternalShape.h"
20#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
21
22///The btConeShape implements a cone shape primitive, centered around the origin and aligned with the Y axis. The btConeShapeX is aligned around the X axis and btConeShapeZ around the Z axis.
23class btConeShape : public btConvexInternalShape
24
25{
26
27        btScalar m_sinAngle;
28        btScalar m_radius;
29        btScalar m_height;
30        int             m_coneIndices[3];
31        btVector3 coneLocalSupport(const btVector3& v) const;
32
33
34public:
35        btConeShape (btScalar radius,btScalar height);
36       
37        virtual btVector3       localGetSupportingVertex(const btVector3& vec) const;
38        virtual btVector3       localGetSupportingVertexWithoutMargin(const btVector3& vec) const;
39        virtual void    batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
40
41        btScalar getRadius() const { return m_radius;}
42        btScalar getHeight() const { return m_height;}
43
44
45        virtual void    calculateLocalInertia(btScalar mass,btVector3& inertia) const
46        {
47                btTransform identity;
48                identity.setIdentity();
49                btVector3 aabbMin,aabbMax;
50                getAabb(identity,aabbMin,aabbMax);
51
52                btVector3 halfExtents = (aabbMax-aabbMin)*btScalar(0.5);
53
54                btScalar margin = getMargin();
55
56                btScalar lx=btScalar(2.)*(halfExtents.x()+margin);
57                btScalar ly=btScalar(2.)*(halfExtents.y()+margin);
58                btScalar lz=btScalar(2.)*(halfExtents.z()+margin);
59                const btScalar x2 = lx*lx;
60                const btScalar y2 = ly*ly;
61                const btScalar z2 = lz*lz;
62                const btScalar scaledmass = mass * btScalar(0.08333333);
63
64                inertia = scaledmass * (btVector3(y2+z2,x2+z2,x2+y2));
65
66//              inertia.x() = scaledmass * (y2+z2);
67//              inertia.y() = scaledmass * (x2+z2);
68//              inertia.z() = scaledmass * (x2+y2);
69        }
70
71
72                virtual const char*     getName()const 
73                {
74                        return "Cone";
75                }
76               
77                ///choose upAxis index
78                void    setConeUpIndex(int upIndex);
79               
80                int     getConeUpIndex() const
81                {
82                        return m_coneIndices[1];
83                }
84};
85
86///btConeShape implements a Cone shape, around the X axis
87class btConeShapeX : public btConeShape
88{
89        public:
90                btConeShapeX(btScalar radius,btScalar height);
91};
92
93///btConeShapeZ implements a Cone shape, around the Z axis
94class btConeShapeZ : public btConeShape
95{
96        public:
97                btConeShapeZ(btScalar radius,btScalar height);
98};
99#endif //CONE_MINKOWSKI_H
100
Note: See TracBrowser for help on using the repository browser.