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

Method initVertexFeatures

Engine/source/ts/tsShape.cpp:776–939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 15

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

Tested by

no test coverage detected