Fixed transform updates to clear dirty flags appropriately #280
|
@ -107,6 +107,7 @@ namespace SHADE
|
|||
const SHVec3& RELATIVE_EXTENTS = box->GetRelativeExtents();
|
||||
|
||||
// Recompute world extents based on new scale and fixed relative extents
|
||||
|
||||
const SHVec3 WORLD_EXTENTS = RELATIVE_EXTENTS * (scale * 0.5f);
|
||||
box->SetWorldExtents(WORLD_EXTENTS);
|
||||
|
||||
|
@ -118,6 +119,7 @@ namespace SHADE
|
|||
const float RELATIVE_RADIUS = sphere->GetRelativeRadius();
|
||||
|
||||
// Recompute world radius based on new scale and fixed radius
|
||||
|
||||
const float MAX_SCALE = SHMath::Max({ scale.x, scale.y, scale.z });
|
||||
const float WORLD_RADIUS = RELATIVE_RADIUS * MAX_SCALE * 0.5f;
|
||||
sphere->SetWorldRadius(WORLD_RADIUS);
|
||||
|
|
|
@ -206,7 +206,7 @@ namespace SHADE
|
|||
}
|
||||
|
||||
// Set the half extents relative to world scale
|
||||
const SHVec3 WORLD_EXTENTS = correctedHalfExtents * COLLIDER->GetScale();
|
||||
const SHVec3 WORLD_EXTENTS = correctedHalfExtents * COLLIDER->GetScale() * 0.5f;
|
||||
|
||||
if (type != Type::BOX)
|
||||
{
|
||||
|
|
|
@ -309,12 +309,9 @@ namespace SHADE
|
|||
{
|
||||
colliderComponent->position = WORLD_POS;
|
||||
colliderComponent->orientation = WORLD_ROT;
|
||||
colliderComponent->scale = WORLD_SCL;
|
||||
|
||||
if (colliderComponent->scale != WORLD_SCL)
|
||||
{
|
||||
colliderComponent->scale = WORLD_SCL;
|
||||
colliderComponent->RecomputeCollisionShapes();
|
||||
}
|
||||
colliderComponent->RecomputeCollisionShapes();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue