Removed obsolete btPoint3: use btVector3 instead
This commit is contained in:
@@ -19,7 +19,7 @@ subject to the following restrictions:
|
||||
#include "btPolyhedralConvexShape.h"
|
||||
#include "btCollisionMargin.h"
|
||||
#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
|
||||
#include "LinearMath/btPoint3.h"
|
||||
#include "LinearMath/btVector3.h"
|
||||
#include "LinearMath/btMinMax.h"
|
||||
|
||||
///The btBoxShape is a box primitive around the origin, its sides axis aligned with length specified by half extents, in local shape coordinates. When used as part of a btCollisionObject or btRigidBody it will be an oriented box in world space.
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
|
||||
virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const;
|
||||
|
||||
virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const
|
||||
virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const
|
||||
{
|
||||
//this plane might not be aligned...
|
||||
btVector4 plane ;
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const
|
||||
virtual void getEdge(int i,btVector3& pa,btVector3& pb) const
|
||||
//virtual void getEdge(int i,Edge& edge) const
|
||||
{
|
||||
int edgeVert0 = 0;
|
||||
@@ -261,7 +261,7 @@ public:
|
||||
|
||||
|
||||
|
||||
virtual bool isInside(const btPoint3& pt,btScalar tolerance) const
|
||||
virtual bool isInside(const btVector3& pt,btScalar tolerance) const
|
||||
{
|
||||
btVector3 halfExtents = getHalfExtentsWithoutMargin();
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
halfExtents[m_upAxis] = getRadius() + getHalfHeight();
|
||||
halfExtents += btVector3(getMargin(),getMargin(),getMargin());
|
||||
btMatrix3x3 abs_b = t.getBasis().absolute();
|
||||
btPoint3 center = t.getOrigin();
|
||||
btVector3 center = t.getOrigin();
|
||||
btVector3 extent = btVector3(abs_b[0].dot(halfExtents),abs_b[1].dot(halfExtents),abs_b[2].dot(halfExtents));
|
||||
|
||||
aabbMin = center - extent;
|
||||
|
||||
@@ -19,7 +19,6 @@ subject to the following restrictions:
|
||||
#include "LinearMath/btTransform.h"
|
||||
#include "LinearMath/btVector3.h"
|
||||
#include "LinearMath/btMatrix3x3.h"
|
||||
#include "LinearMath/btPoint3.h"
|
||||
#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" //for the shape types
|
||||
|
||||
///The btCollisionShape class provides an interface for collision shapes that can be shared among btCollisionObjects.
|
||||
|
||||
@@ -141,7 +141,7 @@ void btCompoundShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVect
|
||||
|
||||
btMatrix3x3 abs_b = trans.getBasis().absolute();
|
||||
|
||||
btPoint3 center = trans(localCenter);
|
||||
btVector3 center = trans(localCenter);
|
||||
|
||||
btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents),
|
||||
abs_b[1].dot(localHalfExtents),
|
||||
|
||||
@@ -14,7 +14,6 @@ subject to the following restrictions:
|
||||
*/
|
||||
|
||||
#include "btConeShape.h"
|
||||
#include "LinearMath/btPoint3.h"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ btConvexHullShape ::btConvexHullShape (const btScalar* points,int numPoints,int
|
||||
|
||||
for (int i=0;i<numPoints;i++)
|
||||
{
|
||||
btPoint3* point = (btPoint3*)(pointsBaseAddress + i*stride);
|
||||
btVector3* point = (btVector3*)(pointsBaseAddress + i*stride);
|
||||
m_points[i] = point[0];
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ void btConvexHullShape::setLocalScaling(const btVector3& scaling)
|
||||
recalcLocalAabb();
|
||||
}
|
||||
|
||||
void btConvexHullShape::addPoint(const btPoint3& point)
|
||||
void btConvexHullShape::addPoint(const btVector3& point)
|
||||
{
|
||||
m_points.push_back(point);
|
||||
recalcLocalAabb();
|
||||
@@ -70,7 +70,7 @@ btVector3 btConvexHullShape::localGetSupportingVertexWithoutMargin(const btVecto
|
||||
|
||||
for (int i=0;i<m_points.size();i++)
|
||||
{
|
||||
btPoint3 vtx = m_points[i] * m_localScaling;
|
||||
btVector3 vtx = m_points[i] * m_localScaling;
|
||||
|
||||
newDot = vec.dot(vtx);
|
||||
if (newDot > maxDot)
|
||||
@@ -94,7 +94,7 @@ void btConvexHullShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const
|
||||
}
|
||||
for (int i=0;i<m_points.size();i++)
|
||||
{
|
||||
btPoint3 vtx = m_points[i] * m_localScaling;
|
||||
btVector3 vtx = m_points[i] * m_localScaling;
|
||||
|
||||
for (int j=0;j<numVectors;j++)
|
||||
{
|
||||
@@ -153,7 +153,7 @@ int btConvexHullShape::getNumEdges() const
|
||||
return m_points.size();
|
||||
}
|
||||
|
||||
void btConvexHullShape::getEdge(int i,btPoint3& pa,btPoint3& pb) const
|
||||
void btConvexHullShape::getEdge(int i,btVector3& pa,btVector3& pb) const
|
||||
{
|
||||
|
||||
int index0 = i%m_points.size();
|
||||
@@ -162,7 +162,7 @@ void btConvexHullShape::getEdge(int i,btPoint3& pa,btPoint3& pb) const
|
||||
pb = m_points[index1]*m_localScaling;
|
||||
}
|
||||
|
||||
void btConvexHullShape::getVertex(int i,btPoint3& vtx) const
|
||||
void btConvexHullShape::getVertex(int i,btVector3& vtx) const
|
||||
{
|
||||
vtx = m_points[i]*m_localScaling;
|
||||
}
|
||||
@@ -172,14 +172,14 @@ int btConvexHullShape::getNumPlanes() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void btConvexHullShape::getPlane(btVector3& ,btPoint3& ,int ) const
|
||||
void btConvexHullShape::getPlane(btVector3& ,btVector3& ,int ) const
|
||||
{
|
||||
|
||||
btAssert(0);
|
||||
}
|
||||
|
||||
//not yet
|
||||
bool btConvexHullShape::isInside(const btPoint3& ,btScalar ) const
|
||||
bool btConvexHullShape::isInside(const btVector3& ,btScalar ) const
|
||||
{
|
||||
assert(0);
|
||||
return false;
|
||||
|
||||
@@ -24,7 +24,7 @@ subject to the following restrictions:
|
||||
///Bullet provides a general and fast collision detector for convex shapes based on GJK and EPA using localGetSupportingVertex.
|
||||
ATTRIBUTE_ALIGNED16(class) btConvexHullShape : public btPolyhedralConvexShape
|
||||
{
|
||||
btAlignedObjectArray<btPoint3> m_points;
|
||||
btAlignedObjectArray<btVector3> m_points;
|
||||
|
||||
public:
|
||||
BT_DECLARE_ALIGNED_ALLOCATOR();
|
||||
@@ -33,16 +33,16 @@ public:
|
||||
///this constructor optionally takes in a pointer to points. Each point is assumed to be 3 consecutive btScalar (x,y,z), the striding defines the number of bytes between each point, in memory.
|
||||
///It is easier to not pass any points in the constructor, and just add one point at a time, using addPoint.
|
||||
///btConvexHullShape make an internal copy of the points.
|
||||
btConvexHullShape(const btScalar* points=0,int numPoints=0, int stride=sizeof(btPoint3));
|
||||
btConvexHullShape(const btScalar* points=0,int numPoints=0, int stride=sizeof(btVector3));
|
||||
|
||||
void addPoint(const btPoint3& point);
|
||||
void addPoint(const btVector3& point);
|
||||
|
||||
btPoint3* getPoints()
|
||||
btVector3* getPoints()
|
||||
{
|
||||
return &m_points[0];
|
||||
}
|
||||
|
||||
const btPoint3* getPoints() const
|
||||
const btVector3* getPoints() const
|
||||
{
|
||||
return &m_points[0];
|
||||
}
|
||||
@@ -64,11 +64,11 @@ public:
|
||||
|
||||
virtual int getNumVertices() const;
|
||||
virtual int getNumEdges() const;
|
||||
virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const;
|
||||
virtual void getVertex(int i,btPoint3& vtx) const;
|
||||
virtual void getEdge(int i,btVector3& pa,btVector3& pb) const;
|
||||
virtual void getVertex(int i,btVector3& vtx) const;
|
||||
virtual int getNumPlanes() const;
|
||||
virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const;
|
||||
virtual bool isInside(const btPoint3& pt,btScalar tolerance) const;
|
||||
virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const;
|
||||
virtual bool isInside(const btVector3& pt,btScalar tolerance) const;
|
||||
|
||||
///in case we receive negative scaling
|
||||
virtual void setLocalScaling(const btVector3& scaling);
|
||||
|
||||
@@ -43,7 +43,7 @@ btVector3 btConvexPointCloudShape::localGetSupportingVertexWithoutMargin(const b
|
||||
|
||||
for (int i=0;i<m_numPoints;i++)
|
||||
{
|
||||
btPoint3 vtx = m_points[i] * m_localScaling;
|
||||
btVector3 vtx = m_points[i] * m_localScaling;
|
||||
|
||||
newDot = vec.dot(vtx);
|
||||
if (newDot > maxDot)
|
||||
@@ -67,7 +67,7 @@ void btConvexPointCloudShape::batchedUnitVectorGetSupportingVertexWithoutMargin(
|
||||
}
|
||||
for (int i=0;i<m_numPoints;i++)
|
||||
{
|
||||
btPoint3 vtx = m_points[i] * m_localScaling;
|
||||
btVector3 vtx = m_points[i] * m_localScaling;
|
||||
|
||||
for (int j=0;j<numVectors;j++)
|
||||
{
|
||||
@@ -126,12 +126,12 @@ int btConvexPointCloudShape::getNumEdges() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void btConvexPointCloudShape::getEdge(int i,btPoint3& pa,btPoint3& pb) const
|
||||
void btConvexPointCloudShape::getEdge(int i,btVector3& pa,btVector3& pb) const
|
||||
{
|
||||
btAssert (0);
|
||||
}
|
||||
|
||||
void btConvexPointCloudShape::getVertex(int i,btPoint3& vtx) const
|
||||
void btConvexPointCloudShape::getVertex(int i,btVector3& vtx) const
|
||||
{
|
||||
vtx = m_points[i]*m_localScaling;
|
||||
}
|
||||
@@ -141,14 +141,14 @@ int btConvexPointCloudShape::getNumPlanes() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void btConvexPointCloudShape::getPlane(btVector3& ,btPoint3& ,int ) const
|
||||
void btConvexPointCloudShape::getPlane(btVector3& ,btVector3& ,int ) const
|
||||
{
|
||||
|
||||
btAssert(0);
|
||||
}
|
||||
|
||||
//not yet
|
||||
bool btConvexPointCloudShape::isInside(const btPoint3& ,btScalar ) const
|
||||
bool btConvexPointCloudShape::isInside(const btVector3& ,btScalar ) const
|
||||
{
|
||||
assert(0);
|
||||
return false;
|
||||
|
||||
@@ -47,12 +47,12 @@ public:
|
||||
recalcLocalAabb();
|
||||
}
|
||||
|
||||
btPoint3* getPoints()
|
||||
btVector3* getPoints()
|
||||
{
|
||||
return m_points;
|
||||
}
|
||||
|
||||
const btPoint3* getPoints() const
|
||||
const btVector3* getPoints() const
|
||||
{
|
||||
return m_points;
|
||||
}
|
||||
@@ -74,11 +74,11 @@ public:
|
||||
|
||||
virtual int getNumVertices() const;
|
||||
virtual int getNumEdges() const;
|
||||
virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const;
|
||||
virtual void getVertex(int i,btPoint3& vtx) const;
|
||||
virtual void getEdge(int i,btVector3& pa,btVector3& pb) const;
|
||||
virtual void getVertex(int i,btVector3& vtx) const;
|
||||
virtual int getNumPlanes() const;
|
||||
virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const;
|
||||
virtual bool isInside(const btPoint3& pt,btScalar tolerance) const;
|
||||
virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const;
|
||||
virtual bool isInside(const btVector3& pt,btScalar tolerance) const;
|
||||
|
||||
///in case we receive negative scaling
|
||||
virtual void setLocalScaling(const btVector3& scaling);
|
||||
|
||||
@@ -41,7 +41,7 @@ static btVector3 convexHullSupport (const btVector3& localDir, const btVector3*
|
||||
|
||||
for (int i=0;i<numPoints;i++)
|
||||
{
|
||||
btPoint3 vtx = points[i];// * m_localScaling;
|
||||
btVector3 vtx = points[i];// * m_localScaling;
|
||||
|
||||
newDot = vec.dot(vtx);
|
||||
if (newDot > maxDot)
|
||||
@@ -210,7 +210,7 @@ btVector3 btConvexShape::localGetSupportVertexWithoutMarginNonVirtual (const btV
|
||||
case CONVEX_HULL_SHAPE_PROXYTYPE:
|
||||
{
|
||||
btConvexHullShape* convexHullShape = (btConvexHullShape*)this;
|
||||
btPoint3* points = convexHullShape->getPoints ();
|
||||
btVector3* points = convexHullShape->getPoints ();
|
||||
int numPoints = convexHullShape->getNumPoints ();
|
||||
return convexHullSupport (localDir, points, numPoints);
|
||||
}
|
||||
@@ -226,7 +226,7 @@ btVector3 btConvexShape::localGetSupportVertexWithoutMarginNonVirtual (const btV
|
||||
|
||||
// should never reach here
|
||||
btAssert (0);
|
||||
return btPoint3 (btScalar(0.0f), btScalar(0.0f), btScalar(0.0f));
|
||||
return btVector3 (btScalar(0.0f), btScalar(0.0f), btScalar(0.0f));
|
||||
}
|
||||
|
||||
btVector3 btConvexShape::localGetSupportVertexNonVirtual (const btVector3& localDir) const
|
||||
@@ -388,7 +388,7 @@ btVector3 btConvexShape::localGetSupportVertexNonVirtual (const btVector3& local
|
||||
case CONVEX_HULL_SHAPE_PROXYTYPE:
|
||||
{
|
||||
btConvexHullShape* convexHullShape = (btConvexHullShape*)this;
|
||||
btPoint3* points = convexHullShape->getPoints ();
|
||||
btVector3* points = convexHullShape->getPoints ();
|
||||
int numPoints = convexHullShape->getNumPoints ();
|
||||
return convexHullSupport (localDir, points, numPoints) + getMarginNonVirtual() * localDirNorm;
|
||||
}
|
||||
@@ -404,7 +404,7 @@ btVector3 btConvexShape::localGetSupportVertexNonVirtual (const btVector3& local
|
||||
|
||||
// should never reach here
|
||||
btAssert (0);
|
||||
return btPoint3 (btScalar(0.0f), btScalar(0.0f), btScalar(0.0f));
|
||||
return btVector3 (btScalar(0.0f), btScalar(0.0f), btScalar(0.0f));
|
||||
}
|
||||
|
||||
/* TODO: This should be bumped up to btCollisionShape () */
|
||||
@@ -488,7 +488,7 @@ void btConvexShape::getAabbNonVirtual (const btTransform& t, btVector3& aabbMin,
|
||||
btVector3 halfExtents = convexShape->getImplicitShapeDimensions();
|
||||
halfExtents += btVector3(margin,margin,margin);
|
||||
btMatrix3x3 abs_b = t.getBasis().absolute();
|
||||
btPoint3 center = t.getOrigin();
|
||||
btVector3 center = t.getOrigin();
|
||||
btVector3 extent = btVector3(abs_b[0].dot(halfExtents),abs_b[1].dot(halfExtents),abs_b[2].dot(halfExtents));
|
||||
|
||||
aabbMin = center - extent;
|
||||
@@ -523,7 +523,7 @@ void btConvexShape::getAabbNonVirtual (const btTransform& t, btVector3& aabbMin,
|
||||
halfExtents[m_upAxis] = capsuleShape->getRadius() + capsuleShape->getHalfHeight();
|
||||
halfExtents += btVector3(capsuleShape->getMarginNonVirtual(),capsuleShape->getMarginNonVirtual(),capsuleShape->getMarginNonVirtual());
|
||||
btMatrix3x3 abs_b = t.getBasis().absolute();
|
||||
btPoint3 center = t.getOrigin();
|
||||
btVector3 center = t.getOrigin();
|
||||
btVector3 extent = btVector3(abs_b[0].dot(halfExtents),abs_b[1].dot(halfExtents),abs_b[2].dot(halfExtents));
|
||||
aabbMin = center - extent;
|
||||
aabbMax = center + extent;
|
||||
|
||||
@@ -163,12 +163,12 @@ int btConvexTriangleMeshShape::getNumEdges() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void btConvexTriangleMeshShape::getEdge(int ,btPoint3& ,btPoint3& ) const
|
||||
void btConvexTriangleMeshShape::getEdge(int ,btVector3& ,btVector3& ) const
|
||||
{
|
||||
btAssert(0);
|
||||
}
|
||||
|
||||
void btConvexTriangleMeshShape::getVertex(int ,btPoint3& ) const
|
||||
void btConvexTriangleMeshShape::getVertex(int ,btVector3& ) const
|
||||
{
|
||||
btAssert(0);
|
||||
}
|
||||
@@ -178,13 +178,13 @@ int btConvexTriangleMeshShape::getNumPlanes() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void btConvexTriangleMeshShape::getPlane(btVector3& ,btPoint3& ,int ) const
|
||||
void btConvexTriangleMeshShape::getPlane(btVector3& ,btVector3& ,int ) const
|
||||
{
|
||||
btAssert(0);
|
||||
}
|
||||
|
||||
//not yet
|
||||
bool btConvexTriangleMeshShape::isInside(const btPoint3& ,btScalar ) const
|
||||
bool btConvexTriangleMeshShape::isInside(const btVector3& ,btScalar ) const
|
||||
{
|
||||
btAssert(0);
|
||||
return false;
|
||||
|
||||
@@ -34,11 +34,11 @@ public:
|
||||
|
||||
virtual int getNumVertices() const;
|
||||
virtual int getNumEdges() const;
|
||||
virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const;
|
||||
virtual void getVertex(int i,btPoint3& vtx) const;
|
||||
virtual void getEdge(int i,btVector3& pa,btVector3& pb) const;
|
||||
virtual void getVertex(int i,btVector3& vtx) const;
|
||||
virtual int getNumPlanes() const;
|
||||
virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const;
|
||||
virtual bool isInside(const btPoint3& pt,btScalar tolerance) const;
|
||||
virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const;
|
||||
virtual bool isInside(const btVector3& pt,btScalar tolerance) const;
|
||||
|
||||
|
||||
virtual void setLocalScaling(const btVector3& scaling);
|
||||
|
||||
@@ -13,7 +13,6 @@ subject to the following restrictions:
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "btCylinderShape.h"
|
||||
#include "LinearMath/btPoint3.h"
|
||||
|
||||
btCylinderShape::btCylinderShape (const btVector3& halfExtents)
|
||||
:btBoxShape(halfExtents),
|
||||
|
||||
@@ -95,7 +95,7 @@ void btHeightfieldTerrainShape::getAabb(const btTransform& t,btVector3& aabbMin,
|
||||
halfExtents += btVector3(getMargin(),getMargin(),getMargin());
|
||||
|
||||
btMatrix3x3 abs_b = t.getBasis().absolute();
|
||||
btPoint3 center = t.getOrigin();
|
||||
btVector3 center = t.getOrigin();
|
||||
btVector3 extent = btVector3(abs_b[0].dot(halfExtents),
|
||||
abs_b[1].dot(halfExtents),
|
||||
abs_b[2].dot(halfExtents));
|
||||
|
||||
@@ -16,7 +16,6 @@ subject to the following restrictions:
|
||||
#ifndef BU_SHAPE
|
||||
#define BU_SHAPE
|
||||
|
||||
#include "LinearMath/btPoint3.h"
|
||||
#include "LinearMath/btMatrix3x3.h"
|
||||
#include "LinearMath/btAabbUtil2.h"
|
||||
#include "btConvexInternalShape.h"
|
||||
@@ -75,13 +74,13 @@ public:
|
||||
|
||||
virtual int getNumVertices() const = 0 ;
|
||||
virtual int getNumEdges() const = 0;
|
||||
virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const = 0;
|
||||
virtual void getVertex(int i,btPoint3& vtx) const = 0;
|
||||
virtual void getEdge(int i,btVector3& pa,btVector3& pb) const = 0;
|
||||
virtual void getVertex(int i,btVector3& vtx) const = 0;
|
||||
virtual int getNumPlanes() const = 0;
|
||||
virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const = 0;
|
||||
virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const = 0;
|
||||
// virtual int getIndex(int i) const = 0 ;
|
||||
|
||||
virtual bool isInside(const btPoint3& pt,btScalar tolerance) const = 0;
|
||||
virtual bool isInside(const btVector3& pt,btScalar tolerance) const = 0;
|
||||
|
||||
/// optional Hull is for optional Separating Axis Test Hull collision detection, see Hull.cpp
|
||||
class Hull* m_optionalHull;
|
||||
|
||||
@@ -93,7 +93,7 @@ void btScaledBvhTriangleMeshShape::getAabb(const btTransform& trans,btVector3& a
|
||||
|
||||
btMatrix3x3 abs_b = trans.getBasis().absolute();
|
||||
|
||||
btPoint3 center = trans(localCenter);
|
||||
btVector3 center = trans(localCenter);
|
||||
|
||||
btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents),
|
||||
abs_b[1].dot(localHalfExtents),
|
||||
|
||||
@@ -22,14 +22,14 @@ m_numVertices(0)
|
||||
m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
|
||||
}
|
||||
|
||||
btBU_Simplex1to4::btBU_Simplex1to4(const btPoint3& pt0) : btPolyhedralConvexShape (),
|
||||
btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0) : btPolyhedralConvexShape (),
|
||||
m_numVertices(0)
|
||||
{
|
||||
m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
|
||||
addVertex(pt0);
|
||||
}
|
||||
|
||||
btBU_Simplex1to4::btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1) : btPolyhedralConvexShape (),
|
||||
btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1) : btPolyhedralConvexShape (),
|
||||
m_numVertices(0)
|
||||
{
|
||||
m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
|
||||
@@ -37,7 +37,7 @@ m_numVertices(0)
|
||||
addVertex(pt1);
|
||||
}
|
||||
|
||||
btBU_Simplex1to4::btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1,const btPoint3& pt2) : btPolyhedralConvexShape (),
|
||||
btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2) : btPolyhedralConvexShape (),
|
||||
m_numVertices(0)
|
||||
{
|
||||
m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
|
||||
@@ -46,7 +46,7 @@ m_numVertices(0)
|
||||
addVertex(pt2);
|
||||
}
|
||||
|
||||
btBU_Simplex1to4::btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1,const btPoint3& pt2,const btPoint3& pt3) : btPolyhedralConvexShape (),
|
||||
btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2,const btVector3& pt3) : btPolyhedralConvexShape (),
|
||||
m_numVertices(0)
|
||||
{
|
||||
m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
|
||||
@@ -60,7 +60,7 @@ m_numVertices(0)
|
||||
|
||||
|
||||
|
||||
void btBU_Simplex1to4::addVertex(const btPoint3& pt)
|
||||
void btBU_Simplex1to4::addVertex(const btVector3& pt)
|
||||
{
|
||||
m_vertices[m_numVertices++] = pt;
|
||||
|
||||
@@ -92,7 +92,7 @@ int btBU_Simplex1to4::getNumEdges() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void btBU_Simplex1to4::getEdge(int i,btPoint3& pa,btPoint3& pb) const
|
||||
void btBU_Simplex1to4::getEdge(int i,btVector3& pa,btVector3& pb) const
|
||||
{
|
||||
|
||||
switch (m_numVertices)
|
||||
@@ -156,7 +156,7 @@ void btBU_Simplex1to4::getEdge(int i,btPoint3& pa,btPoint3& pb) const
|
||||
|
||||
}
|
||||
|
||||
void btBU_Simplex1to4::getVertex(int i,btPoint3& vtx) const
|
||||
void btBU_Simplex1to4::getVertex(int i,btVector3& vtx) const
|
||||
{
|
||||
vtx = m_vertices[i];
|
||||
}
|
||||
@@ -183,7 +183,7 @@ int btBU_Simplex1to4::getNumPlanes() const
|
||||
}
|
||||
|
||||
|
||||
void btBU_Simplex1to4::getPlane(btVector3&, btPoint3& ,int ) const
|
||||
void btBU_Simplex1to4::getPlane(btVector3&, btVector3& ,int ) const
|
||||
{
|
||||
|
||||
}
|
||||
@@ -193,7 +193,7 @@ int btBU_Simplex1to4::getIndex(int ) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool btBU_Simplex1to4::isInside(const btPoint3& ,btScalar ) const
|
||||
bool btBU_Simplex1to4::isInside(const btVector3& ,btScalar ) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -27,15 +27,15 @@ class btBU_Simplex1to4 : public btPolyhedralConvexShape
|
||||
protected:
|
||||
|
||||
int m_numVertices;
|
||||
btPoint3 m_vertices[4];
|
||||
btVector3 m_vertices[4];
|
||||
|
||||
public:
|
||||
btBU_Simplex1to4();
|
||||
|
||||
btBU_Simplex1to4(const btPoint3& pt0);
|
||||
btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1);
|
||||
btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1,const btPoint3& pt2);
|
||||
btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1,const btPoint3& pt2,const btPoint3& pt3);
|
||||
btBU_Simplex1to4(const btVector3& pt0);
|
||||
btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1);
|
||||
btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2);
|
||||
btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2,const btVector3& pt3);
|
||||
|
||||
|
||||
void reset()
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
|
||||
|
||||
|
||||
void addVertex(const btPoint3& pt);
|
||||
void addVertex(const btVector3& pt);
|
||||
|
||||
//PolyhedralConvexShape interface
|
||||
|
||||
@@ -53,17 +53,17 @@ public:
|
||||
|
||||
virtual int getNumEdges() const;
|
||||
|
||||
virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const;
|
||||
virtual void getEdge(int i,btVector3& pa,btVector3& pb) const;
|
||||
|
||||
virtual void getVertex(int i,btPoint3& vtx) const;
|
||||
virtual void getVertex(int i,btVector3& vtx) const;
|
||||
|
||||
virtual int getNumPlanes() const;
|
||||
|
||||
virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i) const;
|
||||
virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i) const;
|
||||
|
||||
virtual int getIndex(int i) const;
|
||||
|
||||
virtual bool isInside(const btPoint3& pt,btScalar tolerance) const;
|
||||
virtual bool isInside(const btVector3& pt,btScalar tolerance) const;
|
||||
|
||||
|
||||
///getName is for debugging
|
||||
|
||||
@@ -53,7 +53,7 @@ void btTriangleMeshShape::getAabb(const btTransform& trans,btVector3& aabbMin,bt
|
||||
|
||||
btMatrix3x3 abs_b = trans.getBasis().absolute();
|
||||
|
||||
btPoint3 center = trans(localCenter);
|
||||
btVector3 center = trans(localCenter);
|
||||
|
||||
btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents),
|
||||
abs_b[1].dot(localHalfExtents),
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
return 3;
|
||||
}
|
||||
|
||||
virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const
|
||||
virtual void getEdge(int i,btVector3& pa,btVector3& pb) const
|
||||
{
|
||||
getVertex(i,pa);
|
||||
getVertex((i+1)%3,pb);
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i) const
|
||||
virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i) const
|
||||
{
|
||||
getPlaneEquation(i,planeNormal,planeSupport);
|
||||
}
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
normal.normalize();
|
||||
}
|
||||
|
||||
virtual void getPlaneEquation(int i, btVector3& planeNormal,btPoint3& planeSupport) const
|
||||
virtual void getPlaneEquation(int i, btVector3& planeNormal,btVector3& planeSupport) const
|
||||
{
|
||||
(void)i;
|
||||
calcNormal(planeNormal);
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
|
||||
}
|
||||
|
||||
virtual bool isInside(const btPoint3& pt,btScalar tolerance) const
|
||||
virtual bool isInside(const btVector3& pt,btScalar tolerance) const
|
||||
{
|
||||
btVector3 normal;
|
||||
calcNormal(normal);
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
int i;
|
||||
for (i=0;i<3;i++)
|
||||
{
|
||||
btPoint3 pa,pb;
|
||||
btVector3 pa,pb;
|
||||
getEdge(i,pa,pb);
|
||||
btVector3 edge = pb-pa;
|
||||
btVector3 edgeNormal = edge.cross(normal);
|
||||
|
||||
Reference in New Issue
Block a user