diff --git a/Source/Engine/Physics/Colliders/SplineCollider.cpp b/Source/Engine/Physics/Colliders/SplineCollider.cpp index f003971ae..e44d986cc 100644 --- a/Source/Engine/Physics/Colliders/SplineCollider.cpp +++ b/Source/Engine/Physics/Colliders/SplineCollider.cpp @@ -35,16 +35,12 @@ void SplineCollider::SetPreTransform(const Transform& value) UpdateGeometry(); } -#if USE_EDITOR - void SplineCollider::ExtractGeometry(Array& vertexBuffer, Array& indexBuffer) const { vertexBuffer.Add(_vertexBuffer); indexBuffer.Add(_indexBuffer); } -#endif - void SplineCollider::OnCollisionDataChanged() { // This should not be called during physics simulation, if it happened use write lock on physx scene @@ -316,11 +312,9 @@ void SplineCollider::GetGeometry(PxGeometryHolder& geometry) return; } -#if USE_EDITOR - // Transform vertices back to world space for debug shapes drawing + // Transform vertices back to world space for debug shapes drawing and navmesh building for (int32 i = 0; i < _vertexBuffer.Count(); i++) _vertexBuffer[i] = colliderTransform.LocalToWorld(_vertexBuffer[i]); -#endif // Update bounds _box = P2C(_triangleMesh->getLocalBounds()); @@ -335,14 +329,7 @@ void SplineCollider::GetGeometry(PxGeometryHolder& geometry) triangleMesh.triangleMesh = _triangleMesh; geometry.storeAny(triangleMesh); -#if !USE_EDITOR - // Free memory for static splines (if editor collision preview is not needed) - if (IsTransformStatic()) - { - _vertexBuffer.Resize(0); - _indexBuffer.Resize(0); - } -#endif + // TODO: find a way of releasing _vertexBuffer and _indexBuffer for static colliders (note: ExtractGeometry usage for navmesh generation at runtime) return; } diff --git a/Source/Engine/Physics/Colliders/SplineCollider.h b/Source/Engine/Physics/Colliders/SplineCollider.h index 42cc25e09..c1cdab7b7 100644 --- a/Source/Engine/Physics/Colliders/SplineCollider.h +++ b/Source/Engine/Physics/Colliders/SplineCollider.h @@ -42,8 +42,6 @@ public: /// API_PROPERTY() void SetPreTransform(const Transform& value); -#if USE_EDITOR - /// /// Extracts the collision data geometry into list of triangles. /// @@ -51,8 +49,6 @@ public: /// The output index buffer. void ExtractGeometry(Array& vertexBuffer, Array& indexBuffer) const; -#endif - private: void OnCollisionDataChanged();