16#ifndef BT_OBB_BOX_MINKOWSKI_H
17#define BT_OBB_BOX_MINKOWSKI_H
36 btVector3 halfExtents = getHalfExtentsWithoutMargin();
37 btVector3 margin(getMargin(), getMargin(), getMargin());
38 halfExtents += margin;
44 return m_implicitShapeDimensions;
49 btVector3 halfExtents = getHalfExtentsWithoutMargin();
50 btVector3 margin(getMargin(), getMargin(), getMargin());
51 halfExtents += margin;
54 btFsels(vec.
y(), halfExtents.
y(), -halfExtents.
y()),
55 btFsels(vec.
z(), halfExtents.
z(), -halfExtents.
z()));
60 const btVector3& halfExtents = getHalfExtentsWithoutMargin();
63 btFsels(vec.
y(), halfExtents.
y(), -halfExtents.
y()),
64 btFsels(vec.
z(), halfExtents.
z(), -halfExtents.
z()));
69 const btVector3& halfExtents = getHalfExtentsWithoutMargin();
71 for (
int i = 0; i < numVectors; i++)
75 btFsels(vec.
y(), halfExtents.
y(), -halfExtents.
y()),
76 btFsels(vec.
z(), halfExtents.
z(), -halfExtents.
z()));
85 btVector3 oldMargin(getMargin(), getMargin(), getMargin());
86 btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions + oldMargin;
89 btVector3 newMargin(getMargin(), getMargin(), getMargin());
90 m_implicitShapeDimensions = implicitShapeDimensionsWithMargin - newMargin;
94 btVector3 oldMargin(getMargin(), getMargin(), getMargin());
95 btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions + oldMargin;
96 btVector3 unScaledImplicitShapeDimensionsWithMargin = implicitShapeDimensionsWithMargin / m_localScaling;
100 m_implicitShapeDimensions = (unScaledImplicitShapeDimensionsWithMargin * m_localScaling) - oldMargin;
111 getPlaneEquation(plane, i);
113 planeSupport = localGetSupportingVertex(-planeNormal);
133 btVector3 halfExtents = getHalfExtentsWithMargin();
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));
143 btVector3 halfExtents = getHalfExtentsWithoutMargin();
232 getVertex(edgeVert0, pa);
233 getVertex(edgeVert1, pb);
238 btVector3 halfExtents = getHalfExtentsWithoutMargin();
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));
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
The btBoxShape is a box primitive around the origin, its sides axis aligned with length specified by ...
virtual void getPlane(btVector3 &planeNormal, btVector3 &planeSupport, int i) const
const btVector3 & getHalfExtentsWithoutMargin() const
btVector3 getHalfExtentsWithMargin() const
virtual const char * getName() const
virtual void getEdge(int i, btVector3 &pa, btVector3 &pb) const
virtual int getNumPreferredPenetrationDirections() const
virtual void getPlaneEquation(btVector4 &plane, int i) const
virtual void setLocalScaling(const btVector3 &scaling)
virtual void getVertex(int i, btVector3 &vtx) const
virtual void setMargin(btScalar collisionMargin)
BT_DECLARE_ALIGNED_ALLOCATOR()
virtual int getNumPlanes() const
virtual void getPreferredPenetrationDirection(int index, btVector3 &penetrationVector) const
virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3 *vectors, btVector3 *supportVerticesOut, int numVectors) const
virtual int getNumEdges() const
virtual int getNumVertices() const
virtual btVector3 localGetSupportingVertex(const btVector3 &vec) const
btVector3 localGetSupportingVertexWithoutMargin(const btVector3 &vec) const
virtual bool isInside(const btVector3 &pt, btScalar tolerance) const
virtual void setMargin(btScalar margin)
virtual void setLocalScaling(const btVector3 &scaling)
The btPolyhedralConvexShape is an internal interface class for polyhedral convex shapes.
btVector3 can be used to represent 3D points and vectors.
const btScalar & getZ() const
Return the z value.
const btScalar & z() const
Return the z value.
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
const btScalar & getY() const
Return the y value.
const btScalar & x() const
Return the x value.
const btScalar & getX() const
Return the x value.
const btScalar & y() const
Return the y value.
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z, const btScalar &_w)
Set x,y,z and zero w.