16#ifndef BT_OBB_BOX_MINKOWSKI_H
17#define BT_OBB_BOX_MINKOWSKI_H
38 halfExtents += margin;
51 halfExtents += margin;
54 btFsels(vec.y(), halfExtents.y(), -halfExtents.y()),
55 btFsels(vec.z(), halfExtents.z(), -halfExtents.z()));
63 btFsels(vec.y(), halfExtents.y(), -halfExtents.y()),
64 btFsels(vec.z(), halfExtents.z(), -halfExtents.z()));
71 for (
int i = 0; i < numVectors; i++)
73 const btVector3& vec = vectors[i];
74 supportVerticesOut[i].setValue(
btFsels(vec.x(), halfExtents.x(), -halfExtents.x()),
75 btFsels(vec.y(), halfExtents.y(), -halfExtents.y()),
76 btFsels(vec.z(), halfExtents.z(), -halfExtents.z()));
88 btConvexInternalShape::setMargin(collisionMargin);
96 btVector3 unScaledImplicitShapeDimensionsWithMargin = implicitShapeDimensionsWithMargin /
m_localScaling;
98 btConvexInternalShape::setLocalScaling(scaling);
103 virtual void getAabb(
const btTransform& t, btVector3& aabbMin, btVector3& aabbMax)
const;
107 virtual void getPlane(btVector3 & planeNormal, btVector3 & planeSupport,
int i)
const
112 planeNormal =
btVector3(plane.getX(), plane.getY(), plane.getZ());
136 halfExtents.x() * (1 - (i & 1)) - halfExtents.x() * (i & 1),
137 halfExtents.y() * (1 - ((i & 2) >> 1)) - halfExtents.y() * ((i & 2) >> 1),
138 halfExtents.z() * (1 - ((i & 4) >> 2)) - halfExtents.z() * ((i & 4) >> 2));
170 virtual void getEdge(
int i, btVector3& pa, btVector3& pb)
const
242 bool result = (pt.x() <= (halfExtents.x() + tolerance)) &&
243 (pt.x() >= (-halfExtents.x() - tolerance)) &&
244 (pt.y() <= (halfExtents.y() + tolerance)) &&
245 (pt.y() >= (-halfExtents.y() - tolerance)) &&
246 (pt.z() <= (halfExtents.z() + tolerance)) &&
247 (pt.z() >= (-halfExtents.z() - tolerance));
virtual void setLocalScaling(const btVector3 &scaling)
in case we receive negative scaling
SIMD_FORCE_INLINE btVector3 localGetSupportingVertexWithoutMargin(const btVector3 &vec) const
btConvexShape Interface
virtual bool isInside(const btVector3 &pt, btScalar tolerance) const
virtual btVector3 localGetSupportingVertex(const btVector3 &vec) const
virtual const char * getName() const
const btVector3 & getHalfExtentsWithoutMargin() const
btVector3 getHalfExtentsWithMargin() const
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
virtual int getNumVertices() const
virtual void getEdge(int i, btVector3 &pa, btVector3 &pb) const
virtual void getAabb(const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
getAabb's default implementation is brute force, expected derived classes to implement a fast dedicat...
virtual int getNumPlanes() const
virtual void getVertex(int i, btVector3 &vtx) const
virtual void setMargin(btScalar collisionMargin)
virtual void getPlane(btVector3 &planeNormal, btVector3 &planeSupport, int i) const
virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3 *vectors, btVector3 *supportVerticesOut, int numVectors) const
virtual int getNumEdges() const
virtual void getPreferredPenetrationDirection(int index, btVector3 &penetrationVector) const
virtual int getNumPreferredPenetrationDirections() const
btBoxShape(const btVector3 &boxHalfExtents)
virtual void getPlaneEquation(btVector4 &plane, int i) const
virtual btScalar getMargin() const =0
btVector3 m_implicitShapeDimensions
#define BT_DECLARE_ALIGNED_ALLOCATOR()
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define ATTRIBUTE_ALIGNED16(a)
#define SIMD_FORCE_INLINE
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...