MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / createStaticData

Method createStaticData

testbed/common/VisualContactPoint.cpp:60–75  ·  view source on GitHub ↗

Load and initialize the mesh for all the contact points

Source from the content-addressed store, hash-verified

58
59// Load and initialize the mesh for all the contact points
60void VisualContactPoint::createStaticData(const std::string& meshFolderPath) {
61
62 if (mStaticDataCreated) return;
63
64 // Load the mesh from a file
65 openglframework::MeshReaderWriter::loadMeshFromFile(meshFolderPath + "sphere.obj", mMesh);
66
67 // Calculate the normals of the mesh
68 mMesh.calculateNormals();
69
70 mMesh.scaleVertices(VISUAL_CONTACT_POINT_RADIUS);
71
72 createVBOAndVAO();
73
74 mStaticDataCreated = true;
75}
76
77// Destroy the mesh for the contact points
78void VisualContactPoint::destroyStaticData() {

Callers

nothing calls this directly

Calls 2

calculateNormalsMethod · 0.80
scaleVerticesMethod · 0.80

Tested by

no test coverage detected