16 #ifndef BT_OBB_BOX_MINKOWSKI_H
17 #define BT_OBB_BOX_MINKOWSKI_H
38 btVector3 halfExtents = getHalfExtentsWithoutMargin();
39 btVector3 margin(getMargin(),getMargin(),getMargin());
40 halfExtents += margin;
46 return m_implicitShapeDimensions;
52 btVector3 halfExtents = getHalfExtentsWithoutMargin();
53 btVector3 margin(getMargin(),getMargin(),getMargin());
54 halfExtents += margin;
57 btFsels(vec.
y(), halfExtents.
y(), -halfExtents.
y()),
58 btFsels(vec.
z(), halfExtents.
z(), -halfExtents.
z()));
63 const btVector3& halfExtents = getHalfExtentsWithoutMargin();
66 btFsels(vec.
y(), halfExtents.
y(), -halfExtents.
y()),
67 btFsels(vec.
z(), halfExtents.
z(), -halfExtents.
z()));
72 const btVector3& halfExtents = getHalfExtentsWithoutMargin();
74 for (
int i=0;i<numVectors;i++)
78 btFsels(vec.
y(), halfExtents.
y(), -halfExtents.
y()),
79 btFsels(vec.
z(), halfExtents.
z(), -halfExtents.
z()));
90 btVector3 oldMargin(getMargin(),getMargin(),getMargin());
91 btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
94 btVector3 newMargin(getMargin(),getMargin(),getMargin());
95 m_implicitShapeDimensions = implicitShapeDimensionsWithMargin - newMargin;
100 btVector3 oldMargin(getMargin(),getMargin(),getMargin());
101 btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
102 btVector3 unScaledImplicitShapeDimensionsWithMargin = implicitShapeDimensionsWithMargin / m_localScaling;
106 m_implicitShapeDimensions = (unScaledImplicitShapeDimensionsWithMargin * m_localScaling) - oldMargin;
120 getPlaneEquation(plane,i);
122 planeSupport = localGetSupportingVertex(-planeNormal);
144 btVector3 halfExtents = getHalfExtentsWithMargin();
147 halfExtents.
x() * (1-(i&1)) - halfExtents.
x() * (i&1),
148 halfExtents.
y() * (1-((i&2)>>1)) - halfExtents.
y() * ((i&2)>>1),
149 halfExtents.
z() * (1-((i&4)>>2)) - halfExtents.
z() * ((i&4)>>2));
155 btVector3 halfExtents = getHalfExtentsWithoutMargin();
246 getVertex(edgeVert0,pa );
247 getVertex(edgeVert1,pb );
256 btVector3 halfExtents = getHalfExtentsWithoutMargin();
260 bool result = (pt.
x() <= (halfExtents.
x()+tolerance)) &&
261 (pt.
x() >= (-halfExtents.
x()-tolerance)) &&
262 (pt.
y() <= (halfExtents.
y()+tolerance)) &&
263 (pt.
y() >= (-halfExtents.
y()-tolerance)) &&
264 (pt.
z() <= (halfExtents.
z()+tolerance)) &&
265 (pt.
z() >= (-halfExtents.
z()-tolerance));
312 #endif //BT_OBB_BOX_MINKOWSKI_H
virtual void getEdge(int i, btVector3 &pa, btVector3 &pb) const
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
btVector3 getHalfExtentsWithMargin() const
virtual void setMargin(btScalar collisionMargin)
virtual int getNumVertices() const
#define SIMD_FORCE_INLINE
virtual void getVertex(int i, btVector3 &vtx) const
virtual int getNumPreferredPenetrationDirections() const
const btVector3 & getHalfExtentsWithoutMargin() const
const btScalar & x() const
Return the x value.
const btScalar & getZ() const
Return the z value.
virtual const char * getName() const
virtual void setMargin(btScalar margin)
const btScalar & getY() const
Return the y value.
const btScalar & getX() const
Return the x value.
The btPolyhedralConvexShape is an internal interface class for polyhedral convex shapes.
virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3 *vectors, btVector3 *supportVerticesOut, int numVectors) const
virtual bool isInside(const btVector3 &pt, btScalar tolerance) const
virtual void setLocalScaling(const btVector3 &scaling)
const btScalar & y() const
Return the y value.
The btBoxShape is a box primitive around the origin, its sides axis aligned with length specified by ...
btVector3 can be used to represent 3D points and vectors.
#define ATTRIBUTE_ALIGNED16(a)
virtual void getPreferredPenetrationDirection(int index, btVector3 &penetrationVector) const
btVector3 localGetSupportingVertexWithoutMargin(const btVector3 &vec) const
#define BT_DECLARE_ALIGNED_ALLOCATOR()
virtual int getNumPlanes() const
virtual void getPlane(btVector3 &planeNormal, btVector3 &planeSupport, int i) const
virtual void setLocalScaling(const btVector3 &scaling)
virtual btVector3 localGetSupportingVertex(const btVector3 &vec) const
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
virtual int getNumEdges() const
virtual void getPlaneEquation(btVector4 &plane, int i) const
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z, const btScalar &_w)
Set x,y,z and zero w.
const btScalar & z() const
Return the z value.