Refactor engine to support double-precision vectors

This commit is contained in:
Wojtek Figat
2022-06-13 00:40:32 +02:00
parent f82e370392
commit a881c90b2e
744 changed files with 19062 additions and 12467 deletions

View File

@@ -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;