MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / initVertexBufferPointers

Method initVertexBufferPointers

Engine/source/ts/tsShape.cpp:737–774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

735}
736
737void TSShape::initVertexBufferPointers()
738{
739 if (mBasicVertexFormat.vertexSize == -1)
740 return;
741 AssertFatal(mVertexSize == mBasicVertexFormat.vertexSize, "vertex size mismatch");
742
743 for (Vector<TSMesh*>::iterator iter = meshes.begin(); iter != meshes.end(); iter++)
744 {
745 TSMesh *mesh = *iter;
746 if (mesh &&
747 (mesh->getMeshType() == TSMesh::StandardMeshType ||
748 mesh->getMeshType() == TSMesh::SkinMeshType))
749 {
750 // Set buffer
751 AssertFatal(mesh->mNumVerts == 0 || mesh->mNumVerts >= mesh->vertsPerFrame, "invalid verts per frame");
752 if (mesh->mVertSize > 0 && !mesh->mVertexData.isReady())
753 {
754 U32 boneOffset = 0;
755 U32 texCoordOffset = 0;
756 AssertFatal(mesh->mVertSize == mVertexFormat.getSizeInBytes(), "mismatch in format size");
757
758 if (mBasicVertexFormat.boneOffset >= 0)
759 {
760 boneOffset = mBasicVertexFormat.boneOffset;
761 }
762
763 if (mBasicVertexFormat.texCoordOffset >= 0)
764 {
765 texCoordOffset = mBasicVertexFormat.texCoordOffset;
766 }
767
768 // Initialize the vertex data
769 mesh->mVertexData.set(mShapeVertexData.base + mesh->mVertOffset, mesh->mVertSize, mesh->mNumVerts, texCoordOffset, boneOffset, false);
770 mesh->mVertexData.setReady(true);
771 }
772 }
773 }
774}
775
776void TSShape::initVertexFeatures()
777{

Callers

nothing calls this directly

Calls 7

getMeshTypeMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
isReadyMethod · 0.45
getSizeInBytesMethod · 0.45
setMethod · 0.45
setReadyMethod · 0.45

Tested by

no test coverage detected