Fix compilation

This commit is contained in:
Wojtek Figat
2021-02-16 11:23:47 +01:00
parent 537dde594d
commit 3658611e0f
2 changed files with 2 additions and 19 deletions

View File

@@ -35,16 +35,12 @@ void SplineCollider::SetPreTransform(const Transform& value)
UpdateGeometry();
}
#if USE_EDITOR
void SplineCollider::ExtractGeometry(Array<Vector3>& vertexBuffer, Array<int32>& 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;
}

View File

@@ -42,8 +42,6 @@ public:
/// </summary>
API_PROPERTY() void SetPreTransform(const Transform& value);
#if USE_EDITOR
/// <summary>
/// Extracts the collision data geometry into list of triangles.
/// </summary>
@@ -51,8 +49,6 @@ public:
/// <param name="indexBuffer">The output index buffer.</param>
void ExtractGeometry(Array<Vector3>& vertexBuffer, Array<int32>& indexBuffer) const;
#endif
private:
void OnCollisionDataChanged();