Refactor engine to support double-precision vectors
This commit is contained in:
@@ -73,7 +73,7 @@ void MeshCollider::DrawPhysicsDebug(RenderView& view)
|
||||
return;
|
||||
if (view.Mode == ViewMode::PhysicsColliders && !GetIsTrigger())
|
||||
{
|
||||
Array<Vector3>* vertexBuffer;
|
||||
Array<Float3>* vertexBuffer;
|
||||
Array<int32>* indexBuffer;
|
||||
CollisionData->GetDebugTriangles(vertexBuffer, indexBuffer);
|
||||
DebugDraw::DrawTriangles(*vertexBuffer, *indexBuffer, _transform.GetWorld(), _staticActor ? Color::CornflowerBlue : Color::Orchid, 0, true);
|
||||
@@ -90,7 +90,7 @@ void MeshCollider::OnDebugDrawSelected()
|
||||
if (CollisionData && CollisionData->IsLoaded())
|
||||
{
|
||||
const auto& debugLines = CollisionData->GetDebugLines();
|
||||
DEBUG_DRAW_LINES(Span<Vector3>(debugLines.Get(), debugLines.Count()), _transform.GetWorld(), Color::GreenYellow, 0, false);
|
||||
DEBUG_DRAW_LINES(Span<Float3>(debugLines.Get(), debugLines.Count()), _transform.GetWorld(), Color::GreenYellow, 0, false);
|
||||
}
|
||||
|
||||
// Base
|
||||
@@ -99,7 +99,7 @@ void MeshCollider::OnDebugDrawSelected()
|
||||
|
||||
#endif
|
||||
|
||||
bool MeshCollider::IntersectsItself(const Ray& ray, float& distance, Vector3& normal)
|
||||
bool MeshCollider::IntersectsItself(const Ray& ray, Real& distance, Vector3& normal)
|
||||
{
|
||||
// Use detailed hit
|
||||
if (_shape)
|
||||
@@ -149,9 +149,9 @@ void MeshCollider::UpdateBounds()
|
||||
void MeshCollider::GetGeometry(CollisionShape& collision)
|
||||
{
|
||||
// Prepare scale
|
||||
Vector3 scale = _cachedScale;
|
||||
Float3 scale = _cachedScale;
|
||||
const float minSize = 0.001f;
|
||||
scale = Vector3::Max(scale.GetNegative(), minSize);
|
||||
scale = Float3::Max(scale.GetAbsolute(), minSize);
|
||||
|
||||
// Setup shape (based on type)
|
||||
CollisionDataType type = CollisionDataType::None;
|
||||
|
||||
Reference in New Issue
Block a user