I have a List of Entities I want to update and than render. For updating:
Variable:
std::vector<Entity> entityList;
function:
void EntityController::update(){
for(Entity e : entityList){
e.update();
}
}
and the update function for the entity
void Entity::update(){
glm::mat4 trans = glm::mat4();
trans = glm::translate(trans, glm::vec3(50.0f,0.0f,50.0f));
trans = glm::scale(trans, glm::vec3(21.0,21.0,21.0));
modelMatrix = trans;
}
My problem here is, that the model matrix actually works. I can find all my information when I take a look at it (Debugging mode XCode), as long as I am in the class entity.
But When I am out of that class, the information in the model matrix is the identity matrix again. somehow he does not save, or update the information :S