MCPcopy Create free account
hub / github.com/carbonengine/trinity / GetVertexPositionOffsetAndType

Function GetVertexPositionOffsetAndType

trinity/Utilities/GeometryUtils.cpp:11–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10#if WITH_GRANNY
11void GetVertexPositionOffsetAndType( granny_mesh* grannyMesh, unsigned int& positionOffset, Tr2VertexDefinition::DataType& positionType )
12{
13 positionOffset = 0;
14 positionType = Tr2VertexDefinition::DT_UNKNOWN_TYPE;
15
16 if( !grannyMesh )
17 {
18 return;
19 }
20
21 granny_data_type_definition* grannyVertexDecl = grannyMesh->PrimaryVertexData->VertexType;
22
23 if( !grannyVertexDecl )
24 {
25 return;
26 }
27
28 while( grannyVertexDecl->Type != GrannyEndMember )
29 {
30 if( !strcmp( grannyVertexDecl->Name, GrannyVertexPositionName ) )
31 {
32 positionType = ConvertGrannyTypeToDataType( *grannyVertexDecl );
33 return;
34 }
35
36 positionOffset += GrannyGetTotalTypeSize( grannyVertexDecl );
37 grannyVertexDecl++;
38 }
39
40 positionOffset = 0;
41}
42#endif
43
44void ConvertShort4ToVector3( const void* ptr, Vector3* dest )

Callers 2

ExtractAudioGeometryMethod · 0.85

Calls 1

Tested by

no test coverage detected