The Socrates Gameboy Advance Development Engine
The SGADE is a development library for the Nintendo Gameboy
Advance. It's free for all uses and is distributed without guarantees.
For more information visit
the SGADE page.
Files | |
| file | SoMesh.c |
| file | SoMesh.h |
| file | SoMeshCube.c |
Data Structures | |
| struct | SoMesh |
| Mesh definition. More... | |
Defines | |
| #define | SO_MESH_MAX_NUM_VERTICES |
| Defines the maximum number of vertices a mesh can contain. | |
Functions | |
| void | SoMeshSetTexture (SoMesh *a_This, SoImage *a_Texture) |
| Sets the texture of the mesh. | |
| SoImage * | SoMeshGetTexture (SoMesh *a_This) |
| Returns the texture this mesh is using. | |
| u32 | SoMeshGetNumVertices (SoMesh *a_This) |
| Returns the number of vertices in the mesh. | |
| u32 | SoMeshGetNumPolygons (SoMesh *a_This) |
| Returs the number of polygons in the mesh. | |
| SoVector3 * | SoMeshGetVertex (SoMesh *a_This, u32 a_Index) |
| Returns a single vertex of the mesh. | |
| SoPolygon * | SoMeshGetPolygon (SoMesh *a_This, u32 a_Index) |
| Returns a single vertex of the mesh. | |
| SoTransform * | SoMeshGetTransform (SoMesh *a_This) |
| Returns the transform of the mesh. | |
| void | SoMeshMakeDefaultCube (SoMesh *a_This) |
| Makes the mesh equal to a default cube. | |
This module represents 3D meshes. A mesh is an object consisting of several polygons, ready to be rendered by a camera.
|
|
Defines the maximum number of vertices a mesh can contain.
If this is not enough, you might want to increase it, but remember this is a GBA we're talking about. You might even want to scale it down a bit if you only use fairly simple meshes. This value is used by the camera module to know the maximum size for the vertex buffers. |
|
|
Returs the number of polygons in the mesh.
|
|
|
Returns the number of vertices in the mesh.
If you receive a value of 0, then you've got a problem. Or you got a mesh with nothing in it. Or maybe you got some sort of disease, or maybe you got a whole lot of money,or maybe I should shut up now and leave the humour out of this reference. Sorry, couldn't resist. I mean, documenting these self-evident is pretty annoying anyway, but done for the sake of consistency. |
|
||||||||||||
|
Returns a single vertex of the mesh.
In release mode, no checks are made whether the given a_Index is a valid index. In debug mode (when SO_DEBUG is defined) this is asserted (using the SO_ASSERT macro). |
|
|
Returns the texture this mesh is using.
|
|
|
Returns the transform of the mesh.
If you want to transform (translate, rotate, scale) a mesh, use this method to obtain the transform, and manipulate that transform. |
|
||||||||||||
|
Returns a single vertex of the mesh.
In release mode, no checks are made whether the given a_Index is a valid index. In debug mode (when SO_DEBUG is defined) this is asserted (using the SO_ASSERT macro). |
|
|
Makes the mesh equal to a default cube.
Check the documentation of the SoMeshCube.c file for more information on this default cube. Mainly used for testing purposes. |
|
||||||||||||
|
Sets the texture of the mesh.
|