Minor tweaks

This commit is contained in:
Wojtek Figat
2024-04-11 16:19:35 +02:00
parent 4e65b76b8c
commit 803249f126
2 changed files with 5 additions and 4 deletions

View File

@@ -400,13 +400,13 @@ void StaticModel::Draw(RenderContextBatch& renderContextBatch)
bool StaticModel::IntersectsItself(const Ray& ray, Real& distance, Vector3& normal)
{
bool result = false;
if (Model != nullptr && Model->IsLoaded())
{
Mesh* mesh;
result = Model->Intersects(ray, _transform, distance, normal, &mesh);
Matrix world;
GetLocalToWorldMatrix(world);
result = Model->Intersects(ray, world, distance, normal, &mesh);
}
return result;
}

View File

@@ -142,7 +142,8 @@ struct RectPack
template<class... Args>
void Free(Args&&...args)
{
ASSERT(IsUsed);
if (!IsUsed)
return;
IsUsed = false;
((NodeType*)this)->OnFree(Forward<Args>(args)...);
}