42 glm::mat4 model = glm::mat4(1.0f);
46 model = glm::translate(model,
m_owner->position);
47 model = glm::rotate(model, glm::radians(
m_owner->rotation.y), {0, 1, 0});
48 model = glm::scale(model,
m_owner->scale);
51 glUniformMatrix4fv(glGetUniformLocation(shader->
GetID(),
"model"), 1, GL_FALSE,
53 glm::value_ptr(model));
float dt
Definition Main.cpp:10
#define ANVIL_API
Definition ACore.h:6
Represents an entity in the game engine with position, rotation, scale and components.
Definition AEntity.h:16
Represents a mesh object in the ANVIL engine with vertices, indices, and texture support.
Definition AMesh.h:19
uint32_t GetID() const
Definition AShader.h:15
The IComponent class is an abstract base class that defines the interface for all components in the A...
Definition IComponent.h:12
AEntity * m_owner
Pointer to the entity that owns this component. This allows the component to access its parent entity...
Definition IComponent.h:40
void OnRender(AShader *shader) override
Definition MeshComponent.h:36
void OnInit(AEntity *owner) override
Definition MeshComponent.h:19
void OnUpdate(float dt) override
Definition MeshComponent.h:27
MeshComponent(AMesh *mesh)
Definition MeshComponent.h:12