#include <mesh.h>
Collaboration diagram for Mesh::VertexDescription:

Public Member Functions | |
| const VertexAttribute & | getAttribute (VertexAttributeSemantic semantic) const |
| VertexDescription & | operator= (const VertexDescription &) |
| bool | validate () const |
| VertexDescription (const VertexDescription &desc) | |
| VertexDescription (uint32 _stride, uint32 _nAttributes, VertexAttribute *_attributes) | |
| ~VertexDescription () | |
Public Attributes | |
| VertexAttribute * | attributes |
| uint32 | nAttributes |
| uint32 | stride |
Private Member Functions | |
| void | buildSemanticMap () |
| void | clearSemanticMap () |
Private Attributes | |
| VertexAttribute | semanticMap [SemanticMax] |
|
||||||||||||||||
|
Definition at line 61 of file mesh.cpp. References attributes, buildSemanticMap(), and nAttributes. 00063 : 00064 stride(_stride), 00065 nAttributes(_nAttributes), 00066 attributes(NULL) 00067 { 00068 if (nAttributes != 0) 00069 { 00070 attributes = new VertexAttribute[nAttributes]; 00071 for (uint32 i = 0; i < nAttributes; i++) 00072 attributes[i] = _attributes[i]; 00073 buildSemanticMap(); 00074 } 00075 }
|
|
|
Definition at line 78 of file mesh.cpp. References attributes, buildSemanticMap(), and nAttributes. 00078 : 00079 stride(desc.stride), 00080 nAttributes(desc.nAttributes), 00081 attributes(NULL) 00082 { 00083 if (nAttributes != 0) 00084 { 00085 attributes = new VertexAttribute[nAttributes]; 00086 for (uint32 i = 0; i < nAttributes; i++) 00087 attributes[i] = desc.attributes[i]; 00088 buildSemanticMap(); 00089 } 00090 }
|
|
|
Definition at line 139 of file mesh.cpp. References attributes. 00140 {
00141 delete[] attributes;
00142 }
|
|
|
Definition at line 146 of file mesh.cpp. References attributes, nAttributes, Mesh::VertexAttribute::semantic, and semanticMap. Referenced by operator=(), and VertexDescription(). 00147 {
00148 for (uint32 i = 0; i < nAttributes; i++)
00149 semanticMap[attributes[i].semantic] = attributes[i];
00150 }
|
|
|
Definition at line 154 of file mesh.cpp. References semanticMap. Referenced by operator=(). 00155 {
00156 for (uint32 i = 0; i < SemanticMax; i++)
00157 semanticMap[i] = VertexAttribute();
00158 }
|
|
|
Definition at line 84 of file mesh.h. References semanticMap. Referenced by generateNormals(), generateTangents(), Mesh::getBoundingBox(), Mesh::pick(), and Mesh::transform(). 00085 {
00086 return semanticMap[semantic];
00087 }
|
|
|
Definition at line 94 of file mesh.cpp. References attributes, buildSemanticMap(), clearSemanticMap(), nAttributes, and stride. 00095 {
00096 if (nAttributes < desc.nAttributes)
00097 {
00098 if (attributes != NULL)
00099 delete[] attributes;
00100 attributes = new VertexAttribute[desc.nAttributes];
00101 }
00102
00103 nAttributes = desc.nAttributes;
00104 stride = desc.stride;
00105 for (uint32 i = 0; i < nAttributes; i++)
00106 attributes[i] = desc.attributes[i];
00107 clearSemanticMap();
00108 buildSemanticMap();
00109
00110 return *this;
00111 }
|
|
|
Definition at line 117 of file mesh.cpp. References attributes, Mesh::VertexAttribute::format, nAttributes, Mesh::VertexAttribute::offset, Mesh::VertexAttribute::semantic, stride, and VertexAttributeFormatSizes. 00118 {
00119 for (uint32 i = 0; i < nAttributes; i++)
00120 {
00121 VertexAttribute& attr = attributes[i];
00122
00123 // Validate the attribute
00124 if (attr.semantic >= SemanticMax || attr.format >= FormatMax)
00125 return false;
00126 if (attr.offset % 4 != 0)
00127 return false;
00128 if (attr.offset + VertexAttributeFormatSizes[attr.format] > stride)
00129 return false;
00130 // TODO: check for repetition of attributes
00131 // if (vertexAttributeMap[attr->semantic].format != InvalidFormat)
00132 // return false;
00133 }
00134
00135 return true;
00136 }
|
|
|
Definition at line 95 of file mesh.h. Referenced by buildSemanticMap(), generateNormals(), generateTangents(), operator=(), validate(), VertexDescription(), and ~VertexDescription(). |
|
|
Definition at line 94 of file mesh.h. Referenced by buildSemanticMap(), generateNormals(), generateTangents(), operator=(), validate(), and VertexDescription(). |
|
|
Definition at line 102 of file mesh.h. Referenced by buildSemanticMap(), clearSemanticMap(), and getAttribute(). |
|
|
Definition at line 93 of file mesh.h. Referenced by generateNormals(), generateTangents(), Mesh::getBoundingBox(), Mesh::getVertexStride(), mergeModelMeshes(), operator=(), Mesh::pick(), Mesh::render(), Mesh::transform(), uniquifyVertices(), and validate(). |
1.4.1