Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 27, 2011, 7:43:24 AM (14 years ago)
Author:
rgrieder
Message:

Updated Bullet Physics Engine from v2.74 to v2.77

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib/src/external/bullet/BulletCollision/CollisionShapes/btTetrahedronShape.cpp

    r5781 r7983  
    1 
    21/*
    32Bullet Continuous Collision Detection and Physics Library
    4 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
     3Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
    54
    65This software is provided 'as-is', without any express or implied warranty.
     
    14133. This notice may not be removed or altered from any source distribution.
    1514*/
     15
    1616#include "btTetrahedronShape.h"
    1717#include "LinearMath/btMatrix3x3.h"
    1818
    19 btBU_Simplex1to4::btBU_Simplex1to4() : btPolyhedralConvexShape (),
    20 m_numVertices(0)
    21 {
    22         m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
    23 }
    24 
    25 btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0) : btPolyhedralConvexShape (),
    26 m_numVertices(0)
    27 {
    28         m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
    29         addVertex(pt0);
    30 }
    31 
    32 btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1) : btPolyhedralConvexShape (),
     19btBU_Simplex1to4::btBU_Simplex1to4() : btPolyhedralConvexAabbCachingShape (),
     20m_numVertices(0)
     21{
     22        m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
     23}
     24
     25btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0) : btPolyhedralConvexAabbCachingShape (),
     26m_numVertices(0)
     27{
     28        m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
     29        addVertex(pt0);
     30}
     31
     32btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1) : btPolyhedralConvexAabbCachingShape (),
    3333m_numVertices(0)
    3434{
     
    3838}
    3939
    40 btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2) : btPolyhedralConvexShape (),
     40btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2) : btPolyhedralConvexAabbCachingShape (),
    4141m_numVertices(0)
    4242{
     
    4747}
    4848
    49 btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2,const btVector3& pt3) : btPolyhedralConvexShape (),
     49btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2,const btVector3& pt3) : btPolyhedralConvexAabbCachingShape (),
    5050m_numVertices(0)
    5151{
     
    5858
    5959
     60void btBU_Simplex1to4::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
     61{
     62#if 1
     63        btPolyhedralConvexAabbCachingShape::getAabb(t,aabbMin,aabbMax);
     64#else
     65        aabbMin.setValue(BT_LARGE_FLOAT,BT_LARGE_FLOAT,BT_LARGE_FLOAT);
     66        aabbMax.setValue(-BT_LARGE_FLOAT,-BT_LARGE_FLOAT,-BT_LARGE_FLOAT);
     67
     68        //just transform the vertices in worldspace, and take their AABB
     69        for (int i=0;i<m_numVertices;i++)
     70        {
     71                btVector3 worldVertex = t(m_vertices[i]);
     72                aabbMin.setMin(worldVertex);
     73                aabbMax.setMax(worldVertex);
     74        }
     75#endif
     76}
     77
     78
    6079
    6180
     
    6483{
    6584        m_vertices[m_numVertices++] = pt;
    66 
    6785        recalcLocalAabb();
    6886}
Note: See TracChangeset for help on using the changeset viewer.