MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / InitFromModelVertices

Method InitFromModelVertices

Source/Engine/Graphics/Models/ModelData.cpp:69–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69PRAGMA_DISABLE_DEPRECATION_WARNINGS
70void MeshData::InitFromModelVertices(ModelVertex19* vertices, uint32 verticesCount)
71{
72 Positions.Resize(verticesCount, false);
73 UVs.Resize(2);
74 UVs[0].Resize(verticesCount, false);
75 UVs[1].Resize(verticesCount, false);
76 Normals.Resize(verticesCount, false);
77 Tangents.Resize(verticesCount, false);
78 BitangentSigns.Resize(0);
79 Colors.Resize(0);
80 BlendIndices.Resize(0);
81 BlendWeights.Resize(0);
82 BlendShapes.Resize(0);
83
84 for (uint32 i = 0; i < verticesCount; i++)
85 {
86 Positions[i] = vertices->Position;
87 UVs[0][i] = vertices->TexCoord.ToFloat2();
88 UVs[1][i] = vertices->LightmapUVs.ToFloat2();
89 Normals[i] = vertices->Normal.ToFloat3() * 2.0f - 1.0f;
90 Tangents[i] = vertices->Tangent.ToFloat3() * 2.0f - 1.0f;
91 Colors[i] = Color(vertices->Color);
92
93 vertices++;
94 }
95}
96
97void MeshData::InitFromModelVertices(VB0ElementType18* vb0, VB1ElementType18* vb1, uint32 verticesCount)
98{

Callers

nothing calls this directly

Calls 4

ColorFunction · 0.70
ResizeMethod · 0.45
ToFloat2Method · 0.45
ToFloat3Method · 0.45

Tested by

no test coverage detected