Created
July 22, 2015 00:15
-
-
Save LordNed/e1e443fc185cad0b72e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SimpleMeshHeader | |
{ | |
public: | |
char[4] Magic; | |
public int SubMeshOffset; | |
public int NumSubMeshes; | |
public SimpleSubMesh* GetMesh(int index) | |
{ | |
return (SimpleSubMesh *)(this + SubMeshOffset) + (index * sizeof(SimpleSubMesh)); | |
} | |
} | |
public class SimpleSubMesh | |
{ | |
int NumVertices; | |
int VertexOffset; | |
public Vector3 GetVertex(int index) | |
{ | |
return (Vector3)((this + VertexOffset) + (index * sizeof(Vector3))); | |
} | |
public Vector3* GetVertices() | |
{ | |
return (Vector3 *)(this + VertexOffset); | |
} | |
} | |
void Main() | |
{ | |
char* pMeshFile = File.LoadFile(test); // Load mesh into a new char[file.Length]; | |
Vector3 firstVert = pMeshFile->GetMesh(0)->GetVertex(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment