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/btBvhTriangleMeshShape.h

    r5781 r7983  
    11/*
    22Bullet Continuous Collision Detection and Physics Library
    3 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
     3Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
    44
    55This software is provided 'as-is', without any express or implied warranty.
     
    2020#include "btOptimizedBvh.h"
    2121#include "LinearMath/btAlignedAllocator.h"
    22 
     22#include "btTriangleInfoMap.h"
    2323
    2424///The btBvhTriangleMeshShape is a static-triangle mesh shape with several optimizations, such as bounding volume hierarchy and cache friendly traversal for PlayStation 3 Cell SPU. It is recommended to enable useQuantizedAabbCompression for better memory usage.
     
    3030
    3131        btOptimizedBvh* m_bvh;
     32        btTriangleInfoMap*      m_triangleInfoMap;
     33
    3234        bool m_useQuantizedAabbCompression;
    3335        bool m_ownsBvh;
     
    3840        BT_DECLARE_ALIGNED_ALLOCATOR();
    3941
    40         btBvhTriangleMeshShape() : btTriangleMeshShape(0),m_bvh(0),m_ownsBvh(false) {m_shapeType = TRIANGLE_MESH_SHAPE_PROXYTYPE;};
     42        btBvhTriangleMeshShape() : btTriangleMeshShape(0),m_bvh(0),m_triangleInfoMap(0),m_ownsBvh(false) {m_shapeType = TRIANGLE_MESH_SHAPE_PROXYTYPE;};
    4143        btBvhTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression, bool buildBvh = true);
    4244
     
    7476        }
    7577
     78        void    setOptimizedBvh(btOptimizedBvh* bvh, const btVector3& localScaling=btVector3(1,1,1));
    7679
    77         void    setOptimizedBvh(btOptimizedBvh* bvh, const btVector3& localScaling=btVector3(1,1,1));
     80        void    buildOptimizedBvh();
    7881
    7982        bool    usesQuantizedAabbCompression() const
     
    8184                return  m_useQuantizedAabbCompression;
    8285        }
     86
     87        void    setTriangleInfoMap(btTriangleInfoMap* triangleInfoMap)
     88        {
     89                m_triangleInfoMap = triangleInfoMap;
     90        }
     91
     92        const btTriangleInfoMap*        getTriangleInfoMap() const
     93        {
     94                return m_triangleInfoMap;
     95        }
     96       
     97        btTriangleInfoMap*      getTriangleInfoMap()
     98        {
     99                return m_triangleInfoMap;
     100        }
     101
     102        virtual int     calculateSerializeBufferSize() const;
     103
     104        ///fills the dataBuffer and returns the struct name (and 0 on failure)
     105        virtual const char*     serialize(void* dataBuffer, btSerializer* serializer) const;
     106
     107        virtual void    serializeSingleBvh(btSerializer* serializer) const;
     108
     109        virtual void    serializeSingleTriangleInfoMap(btSerializer* serializer) const;
     110
     111};
     112
     113///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
     114struct  btTriangleMeshShapeData
     115{
     116        btCollisionShapeData    m_collisionShapeData;
     117
     118        btStridingMeshInterfaceData m_meshInterface;
     119
     120        btQuantizedBvhFloatData         *m_quantizedFloatBvh;
     121        btQuantizedBvhDoubleData        *m_quantizedDoubleBvh;
     122
     123        btTriangleInfoMapData   *m_triangleInfoMap;
     124       
     125        float   m_collisionMargin;
     126
     127        char m_pad3[4];
     128       
     129};
     130
     131
     132SIMD_FORCE_INLINE       int     btBvhTriangleMeshShape::calculateSerializeBufferSize() const
     133{
     134        return sizeof(btTriangleMeshShapeData);
    83135}
    84 ;
     136
     137
    85138
    86139#endif //BVH_TRIANGLE_MESH_SHAPE_H
Note: See TracChangeset for help on using the changeset viewer.