From 62593f8b9906dbe690ea8cb80197dab2eb2cda29 Mon Sep 17 00:00:00 2001 From: ejcoumans Date: Mon, 3 Jul 2006 22:41:19 +0000 Subject: [PATCH] refactoring of TriangleMeshShape, introduced ConcaveShape, which allows for StaticPlaneShape and future landscape/heightfield shape --- Bullet/BroadphaseCollision/BroadphaseProxy.h | 3 + Bullet/BroadphaseCollision/Dispatcher.h | 2 +- .../ConvexConcaveCollisionAlgorithm.cpp | 17 ++-- Bullet/CollisionShapes/BoxShape.h | 12 --- Bullet/CollisionShapes/CollisionShape.h | 8 +- Bullet/CollisionShapes/ConcaveShape.cpp | 28 ++++++ Bullet/CollisionShapes/ConcaveShape.h | 51 ++++++++++ Bullet/CollisionShapes/EmptyShape.h | 18 +--- Bullet/CollisionShapes/StaticPlaneShape.cpp | 98 +++++++++++++++++++ Bullet/CollisionShapes/StaticPlaneShape.h | 61 ++++++++++++ Bullet/CollisionShapes/TriangleMeshShape.cpp | 3 +- Bullet/CollisionShapes/TriangleMeshShape.h | 24 +---- Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp | 6 +- LinearMath/SimdTransformUtil.h | 7 ++ 14 files changed, 277 insertions(+), 61 deletions(-) create mode 100644 Bullet/CollisionShapes/ConcaveShape.cpp create mode 100644 Bullet/CollisionShapes/ConcaveShape.h create mode 100644 Bullet/CollisionShapes/StaticPlaneShape.cpp create mode 100644 Bullet/CollisionShapes/StaticPlaneShape.h diff --git a/Bullet/BroadphaseCollision/BroadphaseProxy.h b/Bullet/BroadphaseCollision/BroadphaseProxy.h index 86f6d078b..35b2dc866 100644 --- a/Bullet/BroadphaseCollision/BroadphaseProxy.h +++ b/Bullet/BroadphaseCollision/BroadphaseProxy.h @@ -43,6 +43,9 @@ CONCAVE_SHAPES_START_HERE, //keep all the convex shapetype below here, for the check IsConvexShape in broadphase proxy! TRIANGLE_MESH_SHAPE_PROXYTYPE, EMPTY_SHAPE_PROXYTYPE, + STATIC_PLANE_PROXYTYPE, +CONCAVE_SHAPES_END_HERE, + COMPOUND_SHAPE_PROXYTYPE, MAX_BROADPHASE_COLLISION_TYPES diff --git a/Bullet/BroadphaseCollision/Dispatcher.h b/Bullet/BroadphaseCollision/Dispatcher.h index 06af72e30..5edfbbdd3 100644 --- a/Bullet/BroadphaseCollision/Dispatcher.h +++ b/Bullet/BroadphaseCollision/Dispatcher.h @@ -87,7 +87,7 @@ public: virtual void ReleaseManifoldResult(ManifoldResult*)=0; - virtual void DispatchAllCollisionPairs(class BroadphasePair* pairs,int numPairs,DispatcherInfo& dispatchInfo)=0; + virtual void DispatchAllCollisionPairs(struct BroadphasePair* pairs,int numPairs,DispatcherInfo& dispatchInfo)=0; virtual int GetNumManifolds() const = 0; diff --git a/Bullet/CollisionDispatch/ConvexConcaveCollisionAlgorithm.cpp b/Bullet/CollisionDispatch/ConvexConcaveCollisionAlgorithm.cpp index 5816d7616..9d79813cb 100644 --- a/Bullet/CollisionDispatch/ConvexConcaveCollisionAlgorithm.cpp +++ b/Bullet/CollisionDispatch/ConvexConcaveCollisionAlgorithm.cpp @@ -19,11 +19,10 @@ subject to the following restrictions: #include "CollisionShapes/MultiSphereShape.h" #include "ConvexConvexAlgorithm.h" #include "BroadphaseCollision/BroadphaseProxy.h" -#include "CollisionShapes/TriangleShape.h" +#include "CollisionShapes/ConcaveShape.h" #include "CollisionDispatch/ManifoldResult.h" #include "NarrowPhaseCollision/RaycastCallback.h" -#include "CollisionShapes/TriangleMeshShape.h" - +#include "CollisionShapes/TriangleShape.h" ConvexConcaveCollisionAlgorithm::ConvexConcaveCollisionAlgorithm( const CollisionAlgorithmConstructionInfo& ci,BroadphaseProxy* proxy0,BroadphaseProxy* proxy1) : CollisionAlgorithm(ci),m_convex(*proxy0),m_concave(*proxy1), @@ -142,7 +141,7 @@ void ConvexConcaveCollisionAlgorithm::ProcessCollision (BroadphaseProxy* ,Broadp CollisionObject* convexBody = static_cast(m_convex.m_clientObject); CollisionObject* triBody = static_cast(m_concave.m_clientObject); - if (triBody->m_collisionShape->GetShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE) + if (triBody->m_collisionShape->IsConcave()) { if (!m_dispatcher->NeedsCollision(m_convex,m_concave)) @@ -151,11 +150,11 @@ void ConvexConcaveCollisionAlgorithm::ProcessCollision (BroadphaseProxy* ,Broadp CollisionObject* triOb = static_cast(m_concave.m_clientObject); - TriangleMeshShape* triangleMesh = static_cast( triOb->m_collisionShape); + ConcaveShape* concaveShape = static_cast( triOb->m_collisionShape); if (convexBody->m_collisionShape->IsConvex()) { - float collisionMarginTriangle = triangleMesh->GetMargin(); + float collisionMarginTriangle = concaveShape->GetMargin(); m_ConvexTriangleCallback.SetTimeStepAndCounters(collisionMarginTriangle,dispatchInfo); @@ -165,7 +164,7 @@ void ConvexConcaveCollisionAlgorithm::ProcessCollision (BroadphaseProxy* ,Broadp m_ConvexTriangleCallback.m_manifoldPtr->SetBodies(m_convex.m_clientObject,m_concave.m_clientObject); - triangleMesh->ProcessAllTriangles( &m_ConvexTriangleCallback,m_ConvexTriangleCallback.GetAabbMin(),m_ConvexTriangleCallback.GetAabbMax()); + concaveShape->ProcessAllTriangles( &m_ConvexTriangleCallback,m_ConvexTriangleCallback.GetAabbMin(),m_ConvexTriangleCallback.GetAabbMax()); } @@ -210,12 +209,12 @@ float ConvexConcaveCollisionAlgorithm::CalculateTimeOfImpact(BroadphaseProxy* ,B SimdVector3 aabbMin (-1e30f,-1e30f,-1e30f); SimdVector3 aabbMax (SIMD_INFINITY,SIMD_INFINITY,SIMD_INFINITY); - if (triBody->m_collisionShape->GetShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE) + if (triBody->m_collisionShape->IsConcave()) { CollisionObject* concavebody = (CollisionObject* )m_concave.m_clientObject; - TriangleMeshShape* triangleMesh = (TriangleMeshShape*) concavebody->m_collisionShape; + ConcaveShape* triangleMesh = (ConcaveShape*) concavebody->m_collisionShape; if (triangleMesh) { diff --git a/Bullet/CollisionShapes/BoxShape.h b/Bullet/CollisionShapes/BoxShape.h index f47f98211..67ce82078 100644 --- a/Bullet/CollisionShapes/BoxShape.h +++ b/Bullet/CollisionShapes/BoxShape.h @@ -48,24 +48,12 @@ public: { SimdVector3 halfExtents = GetHalfExtents(); - SimdVector3 margin(GetMargin(),GetMargin(),GetMargin()); - halfExtents -= margin; SimdVector3 supVertex; supVertex = SimdPoint3(vec.x() < SimdScalar(0.0f) ? -halfExtents.x() : halfExtents.x(), vec.y() < SimdScalar(0.0f) ? -halfExtents.y() : halfExtents.y(), vec.z() < SimdScalar(0.0f) ? -halfExtents.z() : halfExtents.z()); - if ( GetMargin()!=0.f ) - { - SimdVector3 vecnorm = vec; - if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON)) - { - vecnorm.setValue(-1.f,-1.f,-1.f); - } - vecnorm.normalize(); - supVertex+= GetMargin() * vecnorm; - } return supVertex; } diff --git a/Bullet/CollisionShapes/CollisionShape.h b/Bullet/CollisionShapes/CollisionShape.h index 0c0f6984f..57bf97874 100644 --- a/Bullet/CollisionShapes/CollisionShape.h +++ b/Bullet/CollisionShapes/CollisionShape.h @@ -59,9 +59,13 @@ public: } bool IsConcave() const { - return (GetShapeType() > CONCAVE_SHAPES_START_HERE); + return ((GetShapeType() > CONCAVE_SHAPES_START_HERE) && + (GetShapeType() < CONCAVE_SHAPES_END_HERE)); + } + bool IsCompound() const + { + return (GetShapeType() == COMPOUND_SHAPE_PROXYTYPE); } - virtual void setLocalScaling(const SimdVector3& scaling) =0; virtual const SimdVector3& getLocalScaling() const =0; diff --git a/Bullet/CollisionShapes/ConcaveShape.cpp b/Bullet/CollisionShapes/ConcaveShape.cpp new file mode 100644 index 000000000..c060a4df5 --- /dev/null +++ b/Bullet/CollisionShapes/ConcaveShape.cpp @@ -0,0 +1,28 @@ + +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "ConcaveShape.h" + +ConcaveShape::ConcaveShape() : m_collisionMargin(0.f) +{ + +} + +ConcaveShape::~ConcaveShape() +{ + +} diff --git a/Bullet/CollisionShapes/ConcaveShape.h b/Bullet/CollisionShapes/ConcaveShape.h new file mode 100644 index 000000000..d6c589dd8 --- /dev/null +++ b/Bullet/CollisionShapes/ConcaveShape.h @@ -0,0 +1,51 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef CONCAVE_SHAPE_H +#define CONCAVE_SHAPE_H + +#include "CollisionShapes/CollisionShape.h" +#include "BroadphaseCollision/BroadphaseProxy.h" // for the types + +#include "TriangleCallback.h" + + +///Concave shape proves an interface concave shapes that can produce triangles that overlapping a given AABB. +///Static triangle mesh, infinite plane, height field/landscapes are example that implement this interface. +class ConcaveShape : public CollisionShape +{ +protected: + float m_collisionMargin; + +public: + ConcaveShape(); + + virtual ~ConcaveShape(); + + virtual void ProcessAllTriangles(TriangleCallback* callback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const = 0; + + virtual float GetMargin() const { + return m_collisionMargin; + } + virtual void SetMargin(float collisionMargin) + { + m_collisionMargin = collisionMargin; + } + + + +}; + +#endif //CONCAVE_SHAPE_H diff --git a/Bullet/CollisionShapes/EmptyShape.h b/Bullet/CollisionShapes/EmptyShape.h index d4b83663a..4407a22ac 100644 --- a/Bullet/CollisionShapes/EmptyShape.h +++ b/Bullet/CollisionShapes/EmptyShape.h @@ -16,7 +16,7 @@ subject to the following restrictions: #ifndef EMPTY_SHAPE_H #define EMPTY_SHAPE_H -#include "CollisionShape.h" +#include "ConcaveShape.h" #include "SimdVector3.h" #include "SimdTransform.h" @@ -27,8 +27,9 @@ subject to the following restrictions: -/// EmptyShape is a collision shape without actual collision detection. It can be replaced by another shape during runtime -class EmptyShape : public CollisionShape +/// EmptyShape is a collision shape without actual collision detection. +///It can be replaced by another shape during runtime +class EmptyShape : public ConcaveShape { public: EmptyShape(); @@ -53,22 +54,13 @@ public: virtual int GetShapeType() const { return EMPTY_SHAPE_PROXYTYPE;} - virtual void SetMargin(float margin) - { - m_collisionMargin = margin; - } - virtual float GetMargin() const - { - return m_collisionMargin; - } + virtual char* GetName()const { return "Empty"; } -private: - SimdScalar m_collisionMargin; protected: SimdVector3 m_localScaling; diff --git a/Bullet/CollisionShapes/StaticPlaneShape.cpp b/Bullet/CollisionShapes/StaticPlaneShape.cpp new file mode 100644 index 000000000..f0de6673b --- /dev/null +++ b/Bullet/CollisionShapes/StaticPlaneShape.cpp @@ -0,0 +1,98 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "StaticPlaneShape.h" + +#include "SimdTransformUtil.h" + + +StaticPlaneShape::StaticPlaneShape(const SimdVector3& planeNormal,SimdScalar planeConstant) +:m_planeNormal(planeNormal), +m_planeConstant(planeConstant), +m_localScaling(0.f,0.f,0.f) +{ +} + + +StaticPlaneShape::~StaticPlaneShape() +{ +} + + + +void StaticPlaneShape::GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const +{ + SimdVector3 infvec (1e30f,1e30f,1e30f); + + SimdVector3 center = m_planeNormal*m_planeConstant; + aabbMin = center + infvec*m_planeNormal; + aabbMax = aabbMin; + aabbMin.setMin(center - infvec*m_planeNormal); + aabbMax.setMax(center - infvec*m_planeNormal); + + aabbMin.setValue(-1e30f,-1e30f,-1e30f); + aabbMax.setValue(1e30f,1e30f,1e30f); + +} + + + + +void StaticPlaneShape::ProcessAllTriangles(TriangleCallback* callback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const +{ + + SimdVector3 halfExtents = (aabbMax - aabbMin) * 0.5f; + SimdScalar radius = halfExtents.length(); + SimdVector3 center = (aabbMax + aabbMin) * 0.5f; + + //this is where the triangles are generated, given AABB and plane equation (normal/constant) + + SimdVector3 tangentDir0,tangentDir1; + SimdPlaneSpace1(m_planeNormal,tangentDir0,tangentDir1); + + SimdVector3 supVertex0,supVertex1; + + SimdVector3 projectedCenter = center - (m_planeNormal.dot(center) - m_planeConstant)*m_planeNormal; + + SimdVector3 triangle[3]; + triangle[0] = projectedCenter + tangentDir0*radius + tangentDir1*radius; + triangle[1] = projectedCenter + tangentDir0*radius - tangentDir1*radius; + triangle[2] = projectedCenter - tangentDir0*radius - tangentDir1*radius; + + callback->ProcessTriangle(triangle,0,0); + + triangle[0] = projectedCenter - tangentDir0*radius - tangentDir1*radius; + triangle[1] = projectedCenter - tangentDir0*radius + tangentDir1*radius; + triangle[2] = projectedCenter + tangentDir0*radius + tangentDir1*radius; + + callback->ProcessTriangle(triangle,0,1); + +} + +void StaticPlaneShape::CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia) +{ + //moving concave objects not supported + + inertia.setValue(0.f,0.f,0.f); +} + +void StaticPlaneShape::setLocalScaling(const SimdVector3& scaling) +{ + m_localScaling = scaling; +} +const SimdVector3& StaticPlaneShape::getLocalScaling() const +{ + return m_localScaling; +} diff --git a/Bullet/CollisionShapes/StaticPlaneShape.h b/Bullet/CollisionShapes/StaticPlaneShape.h new file mode 100644 index 000000000..eaf8761c6 --- /dev/null +++ b/Bullet/CollisionShapes/StaticPlaneShape.h @@ -0,0 +1,61 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef STATIC_PLANE_SHAPE_H +#define STATIC_PLANE_SHAPE_H + +#include "CollisionShapes/ConcaveShape.h" + + +///StaticPlaneShape simulates an 'infinite' plane by dynamically reporting triangles approximated by intersection of the plane with the AABB. +///Assumed is that the other objects is not also infinite, so a reasonable sized AABB. +class StaticPlaneShape : public ConcaveShape +{ +protected: + SimdVector3 m_localAabbMin; + SimdVector3 m_localAabbMax; + + SimdVector3 m_planeNormal; + SimdVector3 m_localScaling; + SimdScalar m_planeConstant; + +public: + StaticPlaneShape(const SimdVector3& planeNormal,SimdScalar planeConstant); + + virtual ~StaticPlaneShape(); + + + virtual int GetShapeType() const + { + return STATIC_PLANE_PROXYTYPE; + } + + virtual void GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const; + + virtual void ProcessAllTriangles(TriangleCallback* callback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const; + + virtual void CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia); + + virtual void setLocalScaling(const SimdVector3& scaling); + virtual const SimdVector3& getLocalScaling() const; + + + //debugging + virtual char* GetName()const {return "STATICPLANE";} + + +}; + +#endif //STATIC_PLANE_SHAPE_H diff --git a/Bullet/CollisionShapes/TriangleMeshShape.cpp b/Bullet/CollisionShapes/TriangleMeshShape.cpp index 73b53cd02..f00ee280f 100644 --- a/Bullet/CollisionShapes/TriangleMeshShape.cpp +++ b/Bullet/CollisionShapes/TriangleMeshShape.cpp @@ -23,8 +23,7 @@ subject to the following restrictions: #include "stdio.h" TriangleMeshShape::TriangleMeshShape(StridingMeshInterface* meshInterface) -: m_meshInterface(meshInterface), -m_collisionMargin(CONVEX_DISTANCE_MARGIN) +: m_meshInterface(meshInterface) { RecalcLocalAabb(); } diff --git a/Bullet/CollisionShapes/TriangleMeshShape.h b/Bullet/CollisionShapes/TriangleMeshShape.h index ccbb4d75f..a6ee965da 100644 --- a/Bullet/CollisionShapes/TriangleMeshShape.h +++ b/Bullet/CollisionShapes/TriangleMeshShape.h @@ -16,30 +16,24 @@ subject to the following restrictions: #ifndef TRIANGLE_MESH_SHAPE_H #define TRIANGLE_MESH_SHAPE_H -#include "CollisionShapes/CollisionShape.h" -#include "BroadphaseCollision/BroadphaseProxy.h" // for the types - -#include "StridingMeshInterface.h" -#include "TriangleCallback.h" - +#include "CollisionShapes/ConcaveShape.h" +#include "CollisionShapes/StridingMeshInterface.h" ///Concave triangle mesh. Uses an interface to access the triangles to allow for sharing graphics/physics triangles. -class TriangleMeshShape : public CollisionShape +class TriangleMeshShape : public ConcaveShape { protected: StridingMeshInterface* m_meshInterface; SimdVector3 m_localAabbMin; SimdVector3 m_localAabbMax; - float m_collisionMargin; + public: TriangleMeshShape(StridingMeshInterface* meshInterface); virtual ~TriangleMeshShape(); - - virtual SimdVector3 LocalGetSupportingVertex(const SimdVector3& vec) const; virtual SimdVector3 LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const @@ -68,16 +62,6 @@ public: //debugging virtual char* GetName()const {return "TRIANGLEMESH";} - - virtual float GetMargin() const { - return m_collisionMargin; - } - virtual void SetMargin(float collisionMargin) - { - m_collisionMargin = collisionMargin; - } - - }; diff --git a/Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp b/Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp index 9a176af91..7e4a91f96 100644 --- a/Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp +++ b/Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp @@ -25,7 +25,7 @@ subject to the following restrictions: #include "CollisionShapes/BoxShape.h" #include "CollisionShapes/SphereShape.h" #include "CollisionShapes/ConeShape.h" - +#include "CollisionShapes/StaticPlaneShape.h" #include "CollisionShapes/Simplex1to4Shape.h" #include "CollisionShapes/EmptyShape.h" @@ -82,7 +82,7 @@ const int maxOverlap = 65535; #ifdef _DEBUG -const int numObjects = 120; +const int numObjects = 20; #else const int numObjects = 120; #endif @@ -112,6 +112,8 @@ CollisionShape* shapePtr[numShapes] = ///See http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=346 new BoxShape (SimdVector3(450,10,450)), + //new StaticPlaneShape(SimdVector3(0,1,0),10), + new BoxShape (SimdVector3(CUBE_HALF_EXTENTS,CUBE_HALF_EXTENTS,CUBE_HALF_EXTENTS)), new SphereShape (CUBE_HALF_EXTENTS- 0.05f), diff --git a/LinearMath/SimdTransformUtil.h b/LinearMath/SimdTransformUtil.h index 9f6619ab4..6bc0d2973 100644 --- a/LinearMath/SimdTransformUtil.h +++ b/LinearMath/SimdTransformUtil.h @@ -25,6 +25,13 @@ subject to the following restrictions: #define SimdRecipSqrt(x) ((float)(1.0f/SimdSqrt(float(x)))) /* reciprocal square root */ +inline SimdVector3 SimdAabbSupport(const SimdVector3& halfExtents,const SimdVector3& supportDir) +{ + return SimdVector3(supportDir.x() < SimdScalar(0.0f) ? -halfExtents.x() : halfExtents.x(), + supportDir.y() < SimdScalar(0.0f) ? -halfExtents.y() : halfExtents.y(), + supportDir.z() < SimdScalar(0.0f) ? -halfExtents.z() : halfExtents.z()); +} + inline void SimdPlaneSpace1 (const SimdVector3& n, SimdVector3& p, SimdVector3& q) {