Blender  V3.3
btMultimaterialTriangleMeshShape.h
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org
4 
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10 
11 1. 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.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15 
17 
18 #ifndef BT_BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
19 #define BT_BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
20 
21 #include "btBvhTriangleMeshShape.h"
22 #include "btMaterial.h"
23 
27 {
29 
30 public:
32 
33  btMultimaterialTriangleMeshShape(btStridingMeshInterface * meshInterface, bool useQuantizedAabbCompression, bool buildBvh = true) : btBvhTriangleMeshShape(meshInterface, useQuantizedAabbCompression, buildBvh)
34  {
36 
37  const unsigned char *vertexbase;
38  int numverts;
40  int stride;
41  const unsigned char *indexbase;
42  int indexstride;
43  int numfaces;
44  PHY_ScalarType indicestype;
45 
46  //m_materialLookup = (int**)(btAlignedAlloc(sizeof(int*) * meshInterface->getNumSubParts(), 16));
47 
48  for (int i = 0; i < meshInterface->getNumSubParts(); i++)
49  {
50  m_meshInterface->getLockedReadOnlyVertexIndexBase(
51  &vertexbase,
52  numverts,
53  type,
54  stride,
55  &indexbase,
56  indexstride,
57  numfaces,
58  indicestype,
59  i);
60  //m_materialLookup[i] = (int*)(btAlignedAlloc(sizeof(int) * numfaces, 16));
61  }
62  }
63 
65  btMultimaterialTriangleMeshShape(btStridingMeshInterface * meshInterface, bool useQuantizedAabbCompression, const btVector3 &bvhAabbMin, const btVector3 &bvhAabbMax, bool buildBvh = true) : btBvhTriangleMeshShape(meshInterface, useQuantizedAabbCompression, bvhAabbMin, bvhAabbMax, buildBvh)
66  {
68 
69  const unsigned char *vertexbase;
70  int numverts;
72  int stride;
73  const unsigned char *indexbase;
74  int indexstride;
75  int numfaces;
76  PHY_ScalarType indicestype;
77 
78  //m_materialLookup = (int**)(btAlignedAlloc(sizeof(int*) * meshInterface->getNumSubParts(), 16));
79 
80  for (int i = 0; i < meshInterface->getNumSubParts(); i++)
81  {
82  m_meshInterface->getLockedReadOnlyVertexIndexBase(
83  &vertexbase,
84  numverts,
85  type,
86  stride,
87  &indexbase,
88  indexstride,
89  numfaces,
90  indicestype,
91  i);
92  //m_materialLookup[i] = (int*)(btAlignedAlloc(sizeof(int) * numfaces * 2, 16));
93  }
94  }
95 
97  {
98  /*
99  for(int i = 0; i < m_meshInterface->getNumSubParts(); i++)
100  {
101  btAlignedFree(m_materialValues[i]);
102  m_materialLookup[i] = NULL;
103  }
104  btAlignedFree(m_materialValues);
105  m_materialLookup = NULL;
106 */
107  }
108  //debugging
109  virtual const char *getName() const { return "MULTIMATERIALTRIANGLEMESH"; }
110 
112  const btMaterial *getMaterialProperties(int partID, int triIndex);
113 };
114 
115 #endif //BT_BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei stride
@ MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE
Multimaterial mesh.
btBvhTriangleMeshShape(btStridingMeshInterface *meshInterface, bool useQuantizedAabbCompression, bool buildBvh=true)
PHY_ScalarType
BT_DECLARE_ALIGNED_ALLOCATOR()
virtual const char * getName() const
virtual ~btMultimaterialTriangleMeshShape()
const btMaterial * getMaterialProperties(int partID, int triIndex)
Obtains the material for a specific triangle.
btMultimaterialTriangleMeshShape(btStridingMeshInterface *meshInterface, bool useQuantizedAabbCompression, bool buildBvh=true)
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:285
btStridingMeshInterface
btStridingMeshInterface * m_meshInterface
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
Definition: btVector3.h:82
This file was created by Alex Silverman.
Definition: btMaterial.h:23