Disabled final model matrix caching for now, since it doesn't seem to work in all cases. (CP_Rocky2 pickup platforms and ceiling doens't get updated for some reason?!?)
This commit is contained in:
@@ -144,16 +144,16 @@ glm::mat4 TransformSystem::ModelMatrix(EntityID entityID, World* world)
|
||||
|
||||
glm::mat4 TransformSystem::ModelMatrix(EntityWrapper entity)
|
||||
{
|
||||
auto cacheIt = MatrixCache.find(entity);
|
||||
ComponentWrapper cTransform = entity["Transform"];
|
||||
bool isDirty = cTransform["Position"].Dirty(DirtySetType::Transform) || cTransform["Orientation"].Dirty(DirtySetType::Transform) || cTransform["Scale"].Dirty(DirtySetType::Transform);
|
||||
if (cacheIt != MatrixCache.end() && !isDirty && false) {
|
||||
return cacheIt->second;
|
||||
} else {
|
||||
//auto cacheIt = MatrixCache.find(entity);
|
||||
//ComponentWrapper cTransform = entity["Transform"];
|
||||
//bool isDirty = cTransform["Position"].Dirty(DirtySetType::Transform) || cTransform["Orientation"].Dirty(DirtySetType::Transform) || cTransform["Scale"].Dirty(DirtySetType::Transform);
|
||||
//if (cacheIt != MatrixCache.end() && !isDirty && false) {
|
||||
// return cacheIt->second;
|
||||
//} else {
|
||||
glm::mat4 matrix = glm::translate(AbsolutePosition(entity)) * glm::toMat4(AbsoluteOrientation(entity)) * glm::scale(AbsoluteScale(entity));
|
||||
MatrixCache[entity] = matrix;
|
||||
// MatrixCache[entity] = matrix;
|
||||
return matrix;
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
glm::vec3 TransformSystem::TransformPoint(const glm::vec3& point, const glm::mat4& matrix)
|
||||
|
||||
Reference in New Issue
Block a user