MCPcopy Create free account
hub / github.com/Apress/Ray-Tracing-Gems-II / Clear

Method Clear

Chapter_27/Model/Model.cpp:35–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35void Model::Clear()
36{
37 m_VertexBuffer.Destroy();
38 m_IndexBuffer.Destroy();
39 m_VertexBufferDepth.Destroy();
40 m_IndexBufferDepth.Destroy();
41
42 delete [] m_pMesh;
43 m_pMesh = nullptr;
44 m_Header.meshCount = 0;
45
46 delete [] m_pMaterial;
47 m_pMaterial = nullptr;
48 m_Header.materialCount = 0;
49
50 delete [] m_pVertexData;
51 delete [] m_pIndexData;
52 delete [] m_pVertexDataDepth;
53 delete [] m_pIndexDataDepth;
54
55 m_pVertexData = nullptr;
56 m_Header.vertexDataByteSize = 0;
57 m_pIndexData = nullptr;
58 m_Header.indexDataByteSize = 0;
59 m_pVertexDataDepth = nullptr;
60 m_Header.vertexDataByteSizeDepth = 0;
61 m_pIndexDataDepth = nullptr;
62
63 ReleaseTextures();
64
65 m_Header.boundingBox.min = Vector3(0.0f);
66 m_Header.boundingBox.max = Vector3(0.0f);
67}
68
69// assuming at least 3 floats for position
70void Model::ComputeMeshBoundingBox(unsigned int meshIndex, BoundingBox &bbox) const

Callers 1

CleanupMethod · 0.45

Calls 2

Vector3Class · 0.85
DestroyMethod · 0.45

Tested by

no test coverage detected