Minor tweaks
This commit is contained in:
@@ -400,13 +400,13 @@ void StaticModel::Draw(RenderContextBatch& renderContextBatch)
|
|||||||
bool StaticModel::IntersectsItself(const Ray& ray, Real& distance, Vector3& normal)
|
bool StaticModel::IntersectsItself(const Ray& ray, Real& distance, Vector3& normal)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
if (Model != nullptr && Model->IsLoaded())
|
if (Model != nullptr && Model->IsLoaded())
|
||||||
{
|
{
|
||||||
Mesh* mesh;
|
Mesh* mesh;
|
||||||
result = Model->Intersects(ray, _transform, distance, normal, &mesh);
|
Matrix world;
|
||||||
|
GetLocalToWorldMatrix(world);
|
||||||
|
result = Model->Intersects(ray, world, distance, normal, &mesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -142,7 +142,8 @@ struct RectPack
|
|||||||
template<class... Args>
|
template<class... Args>
|
||||||
void Free(Args&&...args)
|
void Free(Args&&...args)
|
||||||
{
|
{
|
||||||
ASSERT(IsUsed);
|
if (!IsUsed)
|
||||||
|
return;
|
||||||
IsUsed = false;
|
IsUsed = false;
|
||||||
((NodeType*)this)->OnFree(Forward<Args>(args)...);
|
((NodeType*)this)->OnFree(Forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user