Blender V4.3
btTriangleIndexVertexMaterialArray.h
Go to the documentation of this file.
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
17
18#ifndef BT_MULTIMATERIAL_TRIANGLE_INDEX_VERTEX_ARRAY_H
19#define BT_MULTIMATERIAL_TRIANGLE_INDEX_VERTEX_ARRAY_H
20
22
25{
27 int m_numMaterials;
28 const unsigned char* m_materialBase;
36 const unsigned char* m_triangleMaterialsBase;
40};
41
43
51btTriangleIndexVertexMaterialArray : public btTriangleIndexVertexArray
52{
53protected:
54 MaterialArray m_materials;
55
56public:
58
62
63 btTriangleIndexVertexMaterialArray(int numTriangles, int* triangleIndexBase, int triangleIndexStride,
64 int numVertices, btScalar* vertexBase, int vertexStride,
65 int numMaterials, unsigned char* materialBase, int materialStride,
66 int* triangleMaterialsBase, int materialIndexStride);
67
69
71 {
72 m_materials.push_back(mat);
73 m_materials[m_materials.size() - 1].m_triangleType = triangleType;
74 }
75
76 virtual void getLockedMaterialBase(unsigned char** materialBase, int& numMaterials, PHY_ScalarType& materialType, int& materialStride,
77 unsigned char** triangleMaterialBase, int& numTriangles, int& triangleMaterialStride, PHY_ScalarType& triangleType, int subpart = 0);
78
79 virtual void getLockedReadOnlyMaterialBase(const unsigned char** materialBase, int& numMaterials, PHY_ScalarType& materialType, int& materialStride,
80 const unsigned char** triangleMaterialBase, int& numTriangles, int& triangleMaterialStride, PHY_ScalarType& triangleType, int subpart = 0);
81};
82
83#endif //BT_MULTIMATERIAL_TRIANGLE_INDEX_VERTEX_ARRAY_H
PHY_ScalarType
@ PHY_INTEGER
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition btScalar.h:314
#define ATTRIBUTE_ALIGNED16(a)
Definition btScalar.h:285
int numTriangles() const
int numVertices() const
BT_DECLARE_ALIGNED_ALLOCATOR()
btMaterialProperties
This file was created by Alex Silverman.
void addMaterialProperties(const btMaterialProperties &mat, PHY_ScalarType triangleType=PHY_INTEGER)
virtual ~btTriangleIndexVertexMaterialArray()
const unsigned char * m_materialBase
virtual void getLockedReadOnlyMaterialBase(const unsigned char **materialBase, int &numMaterials, PHY_ScalarType &materialType, int &materialStride, const unsigned char **triangleMaterialBase, int &numTriangles, int &triangleMaterialStride, PHY_ScalarType &triangleType, int subpart=0)
PHY_ScalarType m_materialType
const unsigned char * m_triangleMaterialsBase
btAlignedObjectArray< btMaterialProperties > MaterialArray
virtual void getLockedMaterialBase(unsigned char **materialBase, int &numMaterials, PHY_ScalarType &materialType, int &materialStride, unsigned char **triangleMaterialBase, int &numTriangles, int &triangleMaterialStride, PHY_ScalarType &triangleType, int subpart=0)
PHY_ScalarType m_triangleType
m_triangleType <========== Automatically set in addMaterialProperties
SIMD_FORCE_INLINE int size() const
return the number of elements in the array
SIMD_FORCE_INLINE void push_back(const T &_Val)