-
Notifications
You must be signed in to change notification settings - Fork 2
ObjectGeometry
An object geometry holds all the necessary data to create an object (indices, vertex positions, UV coords, normals). This data is stored on the GPU using GPUBuffers (either GPUBuffer_uint, GPUBuffer_vec2 or GPUBuffer_vec3. You can create an object geometry from Lua, which lets you do some awesome stuff.
Class ObjectGeometry
Create a new geometry. Consider using an ObjectGeometryGroup for holding your geometries. Then, you can use the ResourceManager to track them. However, simply using an object geometry by its own is fine.
Get the object geometry's name.
GPUBuffer_uint& getIndexBuffer()
Get the index buffer. The number of elements in this buffer is equal to the amount of vertices in the mesh. Each value in this buffer holds an index to the other buffers (positions, UVs, normals). If you want to avoid this, just set the index buffer from 0 to n number of vertices, and fill in your other buffers as you wish (in the order of your vertices). The index buffer has 0-based indices!
GPUBuffer_vec3& getPositionBuffer()
Get the position buffer. This buffer holds all the vertex positions of the meshes, in pixels!. Keep in mind that they are indexed, check out getIndexBuffer().
GPUBuffer_vec2& getUVBuffer()
Get the UV buffer. This buffer holds the UV-coords (texcoords) of the mesh. Keep in mind it is indexed, check out getIndexBuffer().
GPUBuffer_vec3& getNormalBuffer()
Get the normal buffer. This buffer holds the normals; the vectors used for lighting effects. Keep in mind it is indexed, check out getIndexBuffer().
- Understanding the Lua API reference
- Tutorial
- Units
- Notes
- Lua API reference
- Callbacks
- Global
- Game
- Engine
- ResourceManager
- Shader
- Texture
- TextureType
- ObjectGeometryGroup
- ObjectGeometry
- Sound
- SoundType
- GPUBuffer_uint
- GPUBuffer_vec2
- GPUBuffer_vec3
- InputManager
- KeyCode
- EntityManager
- Entity
- PhysicsBody
- PhysicsBodyType
- Camera
- Object
- TexturedObject
- ShadedObject
- Light
- GraphicsManager
- Utils
- IVec2
- Vec2
- Vec3
- Vec4