MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / initVertexFeatures

Method initVertexFeatures

Engine/source/ts/tsShape.cpp:769–932  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

767}
768
769void TSShape::initVertexFeatures()
770{
771
772 if (!needsBufferUpdate())
773 {
774 // Init format from basic format
775 mVertexFormat.clear();
776 mBasicVertexFormat.getFormat(mVertexFormat);
777 mVertexSize = mVertexFormat.getSizeInBytes();
778
779 initVertexBufferPointers();
780
781 for (Vector<TSMesh*>::iterator iter = meshes.begin(); iter != meshes.end(); iter++)
782 {
783 TSMesh *mesh = *iter;
784 if (mesh &&
785 (mesh->getMeshType() == TSMesh::SkinMeshType))
786 {
787 static_cast<TSSkinMesh*>(mesh)->createSkinBatchData();
788 }
789 }
790
791 // Make sure VBO is init'd
792 initVertexBuffers();
793 return;
794 }
795
796 // Cleanout VBO
797 mShapeVertexBuffer = NULL;
798
799 // Make sure mesh has verts stored in mesh data, we're recreating the buffer
800 TSBasicVertexFormat basicFormat;
801
802 initVertexBufferPointers();
803
804 for (Vector<TSMesh*>::iterator iter = meshes.begin(); iter != meshes.end(); iter++)
805 {
806 TSMesh *mesh = *iter;
807 if (mesh &&
808 (mesh->getMeshType() == TSMesh::StandardMeshType ||
809 mesh->getMeshType() == TSMesh::SkinMeshType))
810 {
811 // Make sure we have everything in the vert lists
812 mesh->makeEditable();
813
814 // We need the skin batching data here to determine bone counts
815 if (mesh->getMeshType() == TSMesh::SkinMeshType)
816 {
817 static_cast<TSSkinMesh*>(mesh)->createSkinBatchData();
818 }
819
820 basicFormat.addMeshRequirements(mesh);
821 }
822 }
823
824 mVertexFormat.clear();
825 mBasicVertexFormat = basicFormat;
826 mBasicVertexFormat.getFormat(mVertexFormat);

Callers

nothing calls this directly

Calls 15

warnfFunction · 0.85
getMeshTypeMethod · 0.80
createSkinBatchDataMethod · 0.80
addMeshRequirementsMethod · 0.80
getNumVertsMethod · 0.80
convertToVertexDataMethod · 0.80
vertMethod · 0.80
dMalloc_alignedFunction · 0.50
clearMethod · 0.45
getFormatMethod · 0.45
getSizeInBytesMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected