Objects::GameObject
GameObject in Unified Engine
The GameObject
class represents individual entities within the Unified Engine
. It acts as the primary way to manage in-game items, characters, or other interactive entities. Every GameObject
in the engine can have a visual representation defined by its Mesh
, and it also can have various behaviors defined by components.
Class Components
Protected Members:
VAO
,VBO
,EBO
: Buffers used for storing vertex data for rendering theGameObject
.mesh
: Represents the shape and layout of the object.ModelMatrix
: Represents the object's position, rotation, and scale in 3D space.GenerateVAOBuffers()
: Function to initialize and bind vertex data to GPU buffers.NoShader
: A flag to check if the object has an associated shader.transformOld
: Stores the previous state of theGameObject
's transformation.
Public Members:
transform
: Represents the current position, rotation, and scale of theGameObject
.Name
: A name for theGameObject
.Tag
: A tag for additional categorization or identification.shader
: Points to theShaderObject
that theGameObject
uses for rendering.
Constructors & Destructor:
GameObject(Mesh _mesh, ShaderObject* _shader)
: Constructs aGameObject
with a specifiedMesh
andShaderObject
.GameObject(GameObject* _parent, Mesh _mesh, ShaderObject* _shader)
: Constructs aGameObject
with a parent, a specifiedMesh
, and aShaderObject
.~GameObject()
: Destructor for theGameObject
object.
Methods:
Update()
: Method to update theGameObject
's state each frame.Render()
: Method to render theGameObject
to the screen.
Last updated