minor update manual
fix vehicle demo (heightfield is broken, when using very large scaling factor) add btConeShape serialization, see Issue 725 add btGearConstraint get/set, see Issue 685 and Issue 671
This commit is contained in:
@@ -57,6 +57,7 @@ typedef struct bInvalidHandle {
|
||||
class btCompoundShapeChildData;
|
||||
class btCompoundShapeData;
|
||||
class btCylinderShapeData;
|
||||
class btConeShapeData;
|
||||
class btCapsuleShapeData;
|
||||
class btTriangleInfoData;
|
||||
class btTriangleInfoMapData;
|
||||
@@ -425,6 +426,16 @@ typedef struct bInvalidHandle {
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btConeShapeData
|
||||
{
|
||||
public:
|
||||
btConvexInternalShapeData m_convexInternalShapeData;
|
||||
int m_upIndex;
|
||||
char m_padding[4];
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btCapsuleShapeData
|
||||
{
|
||||
@@ -689,13 +700,14 @@ typedef struct bInvalidHandle {
|
||||
int m_useReferenceFrameA;
|
||||
int m_angularOnly;
|
||||
int m_enableAngularMotor;
|
||||
float m_motorTargetVelocity;
|
||||
float m_maxMotorImpulse;
|
||||
float m_lowerLimit;
|
||||
float m_upperLimit;
|
||||
float m_limitSoftness;
|
||||
float m_biasFactor;
|
||||
float m_relaxationFactor;
|
||||
double m_motorTargetVelocity;
|
||||
double m_maxMotorImpulse;
|
||||
double m_lowerLimit;
|
||||
double m_upperLimit;
|
||||
double m_limitSoftness;
|
||||
double m_biasFactor;
|
||||
double m_relaxationFactor;
|
||||
char m_padding1[4];
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -199,6 +199,7 @@ btCollisionShape* btWorldImporter::convertCollisionShape( btCollisionShapeData*
|
||||
}
|
||||
|
||||
case CYLINDER_SHAPE_PROXYTYPE:
|
||||
case CONE_SHAPE_PROXYTYPE:
|
||||
case CAPSULE_SHAPE_PROXYTYPE:
|
||||
case BOX_SHAPE_PROXYTYPE:
|
||||
case SPHERE_SHAPE_PROXYTYPE:
|
||||
@@ -286,6 +287,38 @@ btCollisionShape* btWorldImporter::convertCollisionShape( btCollisionShapeData*
|
||||
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
case CONE_SHAPE_PROXYTYPE:
|
||||
{
|
||||
btConeShapeData* conData = (btConeShapeData*) shapeData;
|
||||
btVector3 halfExtents = implicitShapeDimensions;//+margin;
|
||||
switch (conData->m_upIndex)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
shape = createConeShapeX(halfExtents.getY(),halfExtents.getX());
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
shape = createConeShapeY(halfExtents.getX(),halfExtents.getY());
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
shape = createConeShapeZ(halfExtents.getX(),halfExtents.getZ());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
printf("unknown Cone up axis\n");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
case MULTI_SPHERE_SHAPE_PROXYTYPE:
|
||||
@@ -1077,6 +1110,27 @@ btCollisionShape* btWorldImporter::createCylinderShapeZ(btScalar radius,btScalar
|
||||
return shape;
|
||||
}
|
||||
|
||||
btCollisionShape* btWorldImporter::createConeShapeX(btScalar radius,btScalar height)
|
||||
{
|
||||
btConeShapeX* shape = new btConeShapeX(radius,height);
|
||||
m_allocatedCollisionShapes.push_back(shape);
|
||||
return shape;
|
||||
}
|
||||
|
||||
btCollisionShape* btWorldImporter::createConeShapeY(btScalar radius,btScalar height)
|
||||
{
|
||||
btConeShape* shape = new btConeShape(radius,height);
|
||||
m_allocatedCollisionShapes.push_back(shape);
|
||||
return shape;
|
||||
}
|
||||
|
||||
btCollisionShape* btWorldImporter::createConeShapeZ(btScalar radius,btScalar height)
|
||||
{
|
||||
btConeShapeZ* shape = new btConeShapeZ(radius,height);
|
||||
m_allocatedCollisionShapes.push_back(shape);
|
||||
return shape;
|
||||
}
|
||||
|
||||
btTriangleIndexVertexArray* btWorldImporter::createTriangleMeshContainer()
|
||||
{
|
||||
btTriangleIndexVertexArray* in = new btTriangleIndexVertexArray();
|
||||
|
||||
@@ -162,6 +162,9 @@ public:
|
||||
virtual btCollisionShape* createCylinderShapeX(btScalar radius,btScalar height);
|
||||
virtual btCollisionShape* createCylinderShapeY(btScalar radius,btScalar height);
|
||||
virtual btCollisionShape* createCylinderShapeZ(btScalar radius,btScalar height);
|
||||
virtual btCollisionShape* createConeShapeX(btScalar radius,btScalar height);
|
||||
virtual btCollisionShape* createConeShapeY(btScalar radius,btScalar height);
|
||||
virtual btCollisionShape* createConeShapeZ(btScalar radius,btScalar height);
|
||||
virtual class btTriangleIndexVertexArray* createTriangleMeshContainer();
|
||||
virtual btBvhTriangleMeshShape* createBvhTriangleMeshShape(btStridingMeshInterface* trimesh, btOptimizedBvh* bvh);
|
||||
virtual btCollisionShape* createConvexTriangleMeshShape(btStridingMeshInterface* trimesh);
|
||||
|
||||
@@ -133,6 +133,7 @@ typedef unsigned long uintptr_t;
|
||||
#include "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h"
|
||||
#include "BulletCollision/CollisionShapes/btCompoundShape.h"
|
||||
#include "BulletCollision/CollisionShapes/btCylinderShape.h"
|
||||
#include "BulletCollision/CollisionShapes/btConeShape.h"
|
||||
#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
|
||||
#include "BulletCollision/CollisionShapes/btTriangleInfoMap.h"
|
||||
#include "BulletCollision/Gimpact/btGImpactShape.h"
|
||||
@@ -176,6 +177,7 @@ char *includefiles[] = {
|
||||
"../../../src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h",
|
||||
"../../../src/BulletCollision/CollisionShapes/btCompoundShape.h",
|
||||
"../../../src/BulletCollision/CollisionShapes/btCylinderShape.h",
|
||||
"../../../src/BulletCollision/CollisionShapes/btConeShape.h",
|
||||
"../../../src/BulletCollision/CollisionShapes/btCapsuleShape.h",
|
||||
"../../../src/BulletCollision/CollisionShapes/btTriangleInfoMap.h",
|
||||
"../../../src/BulletCollision/Gimpact/btGImpactShape.h",
|
||||
|
||||
Reference in New Issue
Block a user