Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/archive/environment2/src/external/bullet/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h @ 10872

Last change on this file since 10872 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.7 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/// This file was created by Alex Silverman
17
18#ifndef BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
19#define BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
20
21#include "btBvhTriangleMeshShape.h"
22#include "btMaterial.h"
23
24///The BvhTriangleMaterialMeshShape extends the btBvhTriangleMeshShape. Its main contribution is the interface into a material array, which allows per-triangle friction and restitution.
25ATTRIBUTE_ALIGNED16(class) btMultimaterialTriangleMeshShape : public btBvhTriangleMeshShape
26{
27    btAlignedObjectArray <btMaterial*> m_materialList;
28    int ** m_triangleMaterials;
29
30public:
31
32        BT_DECLARE_ALIGNED_ALLOCATOR();
33
34    btMultimaterialTriangleMeshShape(): btBvhTriangleMeshShape() {m_shapeType = MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE;}
35    btMultimaterialTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression, bool buildBvh = true):
36        btBvhTriangleMeshShape(meshInterface, useQuantizedAabbCompression, buildBvh)
37        {
38            m_shapeType = MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE;
39
40            const unsigned char *vertexbase;
41            int numverts;
42            PHY_ScalarType type;
43            int stride;
44            const unsigned char *indexbase;
45            int indexstride;
46            int numfaces;
47            PHY_ScalarType indicestype;
48
49            //m_materialLookup = (int**)(btAlignedAlloc(sizeof(int*) * meshInterface->getNumSubParts(), 16));
50
51            for(int i = 0; i < meshInterface->getNumSubParts(); i++)
52            {
53                m_meshInterface->getLockedReadOnlyVertexIndexBase(
54                    &vertexbase,
55                    numverts,
56                    type,
57                    stride,
58                    &indexbase,
59                    indexstride,
60                    numfaces,
61                    indicestype,
62                    i);
63                //m_materialLookup[i] = (int*)(btAlignedAlloc(sizeof(int) * numfaces, 16));
64            }
65        }
66
67        ///optionally pass in a larger bvh aabb, used for quantization. This allows for deformations within this aabb
68        btMultimaterialTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression,const btVector3& bvhAabbMin,const btVector3& bvhAabbMax, bool buildBvh = true):
69        btBvhTriangleMeshShape(meshInterface, useQuantizedAabbCompression, bvhAabbMin, bvhAabbMax, buildBvh)
70        {
71            m_shapeType = MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE;
72
73            const unsigned char *vertexbase;
74            int numverts;
75            PHY_ScalarType type;
76            int stride;
77            const unsigned char *indexbase;
78            int indexstride;
79            int numfaces;
80            PHY_ScalarType indicestype;
81
82            //m_materialLookup = (int**)(btAlignedAlloc(sizeof(int*) * meshInterface->getNumSubParts(), 16));
83
84            for(int i = 0; i < meshInterface->getNumSubParts(); i++)
85            {
86                m_meshInterface->getLockedReadOnlyVertexIndexBase(
87                    &vertexbase,
88                    numverts,
89                    type,
90                    stride,
91                    &indexbase,
92                    indexstride,
93                    numfaces,
94                    indicestype,
95                    i);
96                //m_materialLookup[i] = (int*)(btAlignedAlloc(sizeof(int) * numfaces * 2, 16));
97            }
98        }
99       
100    virtual ~btMultimaterialTriangleMeshShape()
101    {
102/*
103        for(int i = 0; i < m_meshInterface->getNumSubParts(); i++)
104        {
105            btAlignedFree(m_materialValues[i]);
106            m_materialLookup[i] = NULL;
107        }
108        btAlignedFree(m_materialValues);
109        m_materialLookup = NULL;
110*/
111    }
112        //debugging
113        virtual const char*     getName()const {return "MULTIMATERIALTRIANGLEMESH";}
114
115    ///Obtains the material for a specific triangle
116    const btMaterial * getMaterialProperties(int partID, int triIndex);
117
118}
119;
120
121#endif //BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
Note: See TracBrowser for help on using the repository browser.