mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
bullet: Cleanup copying of shapes
- Fixed copy constructors - Dropped operator= from shapes Signed-off-by: deflected <deflected@users.noreply.github.com> Closes #283
This commit is contained in:
parent
733085e38e
commit
3a88308f45
@ -35,19 +35,11 @@ BulletBoxShape::
|
||||
BulletBoxShape(const BulletBoxShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_shape = copy._shape;
|
||||
_half_extents = copy._half_extents;
|
||||
}
|
||||
btVector3 btHalfExtents = LVecBase3_to_btVector3(_half_extents);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void BulletBoxShape::
|
||||
operator = (const BulletBoxShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_shape = copy._shape;
|
||||
_half_extents = copy._half_extents;
|
||||
_shape = new btBoxShape(btHalfExtents);
|
||||
_shape->setUserPointer(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -34,7 +34,6 @@ private:
|
||||
PUBLISHED:
|
||||
explicit BulletBoxShape(const LVecBase3 &halfExtents);
|
||||
BulletBoxShape(const BulletBoxShape ©);
|
||||
void operator = (const BulletBoxShape ©);
|
||||
INLINE ~BulletBoxShape();
|
||||
|
||||
LVecBase3 get_half_extents_without_margin() const;
|
||||
|
@ -18,7 +18,8 @@ INLINE BulletCapsuleShape::
|
||||
BulletCapsuleShape() :
|
||||
_shape(nullptr),
|
||||
_radius(0),
|
||||
_height(0) {
|
||||
_height(0),
|
||||
_up(X_up) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -21,7 +21,8 @@ TypeHandle BulletCapsuleShape::_type_handle;
|
||||
BulletCapsuleShape::
|
||||
BulletCapsuleShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up) :
|
||||
_radius(radius),
|
||||
_height(height) {
|
||||
_height(height),
|
||||
_up(up) {
|
||||
|
||||
switch (up) {
|
||||
case X_up:
|
||||
@ -49,24 +50,29 @@ BulletCapsuleShape::
|
||||
BulletCapsuleShape(const BulletCapsuleShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_shape = copy._shape;
|
||||
_radius = copy._radius;
|
||||
_height = copy._height;
|
||||
_up = copy._up;
|
||||
|
||||
switch (_up) {
|
||||
case X_up:
|
||||
_shape = new btCapsuleShapeX(_radius, _height);
|
||||
break;
|
||||
case Y_up:
|
||||
_shape = new btCapsuleShape(_radius, _height);
|
||||
break;
|
||||
case Z_up:
|
||||
_shape = new btCapsuleShapeZ(_radius, _height);
|
||||
break;
|
||||
default:
|
||||
bullet_cat.error() << "invalid up-axis:" << _up << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
nassertv(_shape);
|
||||
_shape->setUserPointer(this);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void BulletCapsuleShape::
|
||||
operator = (const BulletCapsuleShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_shape = copy._shape;
|
||||
_radius = copy._radius;
|
||||
_height = copy._height;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ -131,9 +137,9 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
||||
// parameters to serialize: radius, height, up
|
||||
_radius = scan.get_stdfloat();
|
||||
_height = scan.get_stdfloat();
|
||||
int up = (int) scan.get_int8();
|
||||
_up = (BulletUpAxis) scan.get_int8();
|
||||
|
||||
switch (up) {
|
||||
switch (_up) {
|
||||
case X_up:
|
||||
_shape = new btCapsuleShapeX(_radius, _height);
|
||||
break;
|
||||
@ -144,7 +150,7 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
||||
_shape = new btCapsuleShapeZ(_radius, _height);
|
||||
break;
|
||||
default:
|
||||
bullet_cat.error() << "invalid up-axis:" << up << endl;
|
||||
bullet_cat.error() << "invalid up-axis:" << _up << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,6 @@ private:
|
||||
PUBLISHED:
|
||||
explicit BulletCapsuleShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up=Z_up);
|
||||
BulletCapsuleShape(const BulletCapsuleShape ©);
|
||||
void operator = (const BulletCapsuleShape ©);
|
||||
INLINE ~BulletCapsuleShape();
|
||||
|
||||
INLINE PN_stdfloat get_radius() const;
|
||||
@ -50,6 +49,7 @@ private:
|
||||
btCapsuleShape *_shape;
|
||||
PN_stdfloat _radius;
|
||||
PN_stdfloat _height;
|
||||
BulletUpAxis _up;
|
||||
|
||||
public:
|
||||
static void register_with_read_factory();
|
||||
|
@ -18,7 +18,8 @@ INLINE BulletConeShape::
|
||||
BulletConeShape() :
|
||||
_shape(nullptr),
|
||||
_radius(0),
|
||||
_height(0) {
|
||||
_height(0),
|
||||
_up(X_up) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -21,7 +21,8 @@ TypeHandle BulletConeShape::_type_handle;
|
||||
BulletConeShape::
|
||||
BulletConeShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up) :
|
||||
_radius(radius),
|
||||
_height(height) {
|
||||
_height(height),
|
||||
_up(up) {
|
||||
|
||||
switch (up) {
|
||||
case X_up:
|
||||
@ -49,21 +50,27 @@ BulletConeShape::
|
||||
BulletConeShape(const BulletConeShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_shape = copy._shape;
|
||||
_up = copy._up;
|
||||
_radius = copy._radius;
|
||||
_height = copy._height;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void BulletConeShape::
|
||||
operator = (const BulletConeShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
switch (_up) {
|
||||
case X_up:
|
||||
_shape = new btConeShapeX((btScalar)_radius, (btScalar)_height);
|
||||
break;
|
||||
case Y_up:
|
||||
_shape = new btConeShape((btScalar)_radius, (btScalar)_height);
|
||||
break;
|
||||
case Z_up:
|
||||
_shape = new btConeShapeZ((btScalar)_radius, (btScalar)_height);
|
||||
break;
|
||||
default:
|
||||
bullet_cat.error() << "invalid up-axis:" << _up << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
_shape = copy._shape;
|
||||
_radius = copy._radius;
|
||||
_height = copy._height;
|
||||
nassertv(_shape);
|
||||
_shape->setUserPointer(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -95,7 +102,7 @@ write_datagram(BamWriter *manager, Datagram &dg) {
|
||||
// parameters to serialize: radius, height, upIndex
|
||||
dg.add_stdfloat(_radius);
|
||||
dg.add_stdfloat(_height);
|
||||
dg.add_int8((int8_t)_shape->getConeUpIndex());
|
||||
dg.add_int8((int8_t)_up);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -130,9 +137,9 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
||||
// parameters to serialize: radius, height, up
|
||||
_radius = scan.get_stdfloat();
|
||||
_height = scan.get_stdfloat();
|
||||
_up = (BulletUpAxis) scan.get_int8();
|
||||
|
||||
int up_index = (int) scan.get_int8();
|
||||
switch (up_index) {
|
||||
switch (_up) {
|
||||
case 0:
|
||||
_shape = new btConeShapeX((btScalar)_radius, (btScalar)_height);
|
||||
break;
|
||||
@ -143,7 +150,7 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
||||
_shape = new btConeShapeZ((btScalar)_radius, (btScalar)_height);
|
||||
break;
|
||||
default:
|
||||
bullet_cat.error() << "invalid up-axis:" << up_index << endl;
|
||||
bullet_cat.error() << "invalid up-axis:" << _up << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,6 @@ private:
|
||||
PUBLISHED:
|
||||
explicit BulletConeShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up=Z_up);
|
||||
BulletConeShape(const BulletConeShape ©);
|
||||
void operator = (const BulletConeShape ©);
|
||||
INLINE ~BulletConeShape();
|
||||
|
||||
INLINE PN_stdfloat get_radius() const;
|
||||
@ -47,6 +46,7 @@ private:
|
||||
btConeShape *_shape;
|
||||
PN_stdfloat _radius;
|
||||
PN_stdfloat _height;
|
||||
BulletUpAxis _up;
|
||||
|
||||
public:
|
||||
static void register_with_read_factory();
|
||||
|
@ -36,17 +36,13 @@ BulletConvexHullShape::
|
||||
BulletConvexHullShape(const BulletConvexHullShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_shape = copy._shape;
|
||||
}
|
||||
_shape = new btConvexHullShape(NULL, 0);
|
||||
_shape->setUserPointer(this);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void BulletConvexHullShape::
|
||||
operator = (const BulletConvexHullShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
for(int i = 0; i < copy._shape->getNumPoints(); i++)
|
||||
_shape->addPoint(copy._shape->getUnscaledPoints()[i], false);
|
||||
|
||||
_shape = copy._shape;
|
||||
_shape->recalcLocalAabb();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -117,6 +113,9 @@ add_geom(const Geom *geom, const TransformState *ts) {
|
||||
points.push_back(m.xform_point(reader.get_data3()));
|
||||
}
|
||||
|
||||
if (_shape)
|
||||
delete _shape;
|
||||
|
||||
// Create shape
|
||||
_shape = new btConvexHullShape(NULL, 0);
|
||||
_shape->setUserPointer(this);
|
||||
|
@ -30,7 +30,6 @@ class EXPCL_PANDABULLET BulletConvexHullShape : public BulletShape {
|
||||
PUBLISHED:
|
||||
BulletConvexHullShape();
|
||||
BulletConvexHullShape(const BulletConvexHullShape ©);
|
||||
void operator = (const BulletConvexHullShape ©);
|
||||
INLINE ~BulletConvexHullShape();
|
||||
|
||||
void add_point(const LPoint3 &p);
|
||||
|
@ -92,18 +92,13 @@ BulletConvexPointCloudShape(const BulletConvexPointCloudShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_scale = copy._scale;
|
||||
_shape = copy._shape;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void BulletConvexPointCloudShape::
|
||||
operator = (const BulletConvexPointCloudShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
btVector3 *btPoints = copy._shape->getUnscaledPoints();
|
||||
int numPoints = copy._shape->getNumPoints();
|
||||
btVector3 btScale = LVecBase3_to_btVector3(_scale);
|
||||
|
||||
_scale = copy._scale;
|
||||
_shape = copy._shape;
|
||||
_shape = new btConvexPointCloudShape(btPoints, numPoints, btScale);
|
||||
_shape->setUserPointer(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -34,7 +34,6 @@ PUBLISHED:
|
||||
explicit BulletConvexPointCloudShape(const PTA_LVecBase3 &points, LVecBase3 scale=LVecBase3(1.));
|
||||
explicit BulletConvexPointCloudShape(const Geom *geom, LVecBase3 scale=LVecBase3(1.));
|
||||
BulletConvexPointCloudShape(const BulletConvexPointCloudShape ©);
|
||||
void operator = (const BulletConvexPointCloudShape ©);
|
||||
INLINE ~BulletConvexPointCloudShape();
|
||||
|
||||
int get_num_points() const;
|
||||
|
@ -17,7 +17,8 @@
|
||||
INLINE BulletCylinderShape::
|
||||
BulletCylinderShape() :
|
||||
_half_extents(LVector3::zero()),
|
||||
_shape(nullptr) {
|
||||
_shape(nullptr),
|
||||
_up(X_up) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -20,7 +20,8 @@ TypeHandle BulletCylinderShape::_type_handle;
|
||||
*/
|
||||
BulletCylinderShape::
|
||||
BulletCylinderShape(const LVector3 &half_extents, BulletUpAxis up) :
|
||||
_half_extents(half_extents){
|
||||
_half_extents(half_extents),
|
||||
_up(up) {
|
||||
|
||||
btVector3 btHalfExtents = LVecBase3_to_btVector3(half_extents);
|
||||
|
||||
@ -47,7 +48,8 @@ BulletCylinderShape(const LVector3 &half_extents, BulletUpAxis up) :
|
||||
*
|
||||
*/
|
||||
BulletCylinderShape::
|
||||
BulletCylinderShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up) {
|
||||
BulletCylinderShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up) :
|
||||
_up(up) {
|
||||
|
||||
switch (up) {
|
||||
case X_up:
|
||||
@ -78,19 +80,28 @@ BulletCylinderShape::
|
||||
BulletCylinderShape(const BulletCylinderShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_shape = copy._shape;
|
||||
_up = copy._up;
|
||||
_half_extents = copy._half_extents;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void BulletCylinderShape::
|
||||
operator = (const BulletCylinderShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
btVector3 btHalfExtents = LVecBase3_to_btVector3(_half_extents);
|
||||
|
||||
_shape = copy._shape;
|
||||
_half_extents = copy._half_extents;
|
||||
switch (_up) {
|
||||
case X_up:
|
||||
_shape = new btCylinderShapeX(btHalfExtents);
|
||||
break;
|
||||
case Y_up:
|
||||
_shape = new btCylinderShape(btHalfExtents);
|
||||
break;
|
||||
case Z_up:
|
||||
_shape = new btCylinderShapeZ(btHalfExtents);
|
||||
break;
|
||||
default:
|
||||
bullet_cat.error() << "invalid up-axis:" << _up << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
nassertv(_shape);
|
||||
_shape->setUserPointer(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -185,11 +196,11 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
||||
|
||||
// parameters to serialize: radius, height, up
|
||||
_half_extents.read_datagram(scan);
|
||||
int up = (int) scan.get_int8();
|
||||
_up = (BulletUpAxis) scan.get_int8();
|
||||
|
||||
btVector3 btHalfExtents = LVecBase3_to_btVector3(_half_extents);
|
||||
|
||||
switch (up) {
|
||||
switch (_up) {
|
||||
case X_up:
|
||||
_shape = new btCylinderShapeX(btHalfExtents);
|
||||
break;
|
||||
@ -200,7 +211,7 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
||||
_shape = new btCylinderShapeZ(btHalfExtents);
|
||||
break;
|
||||
default:
|
||||
bullet_cat.error() << "invalid up-axis:" << up << endl;
|
||||
bullet_cat.error() << "invalid up-axis:" << _up << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,6 @@ PUBLISHED:
|
||||
explicit BulletCylinderShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up=Z_up);
|
||||
explicit BulletCylinderShape(const LVector3 &half_extents, BulletUpAxis up=Z_up);
|
||||
BulletCylinderShape(const BulletCylinderShape ©);
|
||||
void operator = (const BulletCylinderShape ©);
|
||||
INLINE ~BulletCylinderShape();
|
||||
|
||||
PN_stdfloat get_radius() const;
|
||||
@ -49,6 +48,7 @@ public:
|
||||
private:
|
||||
LVector3 _half_extents;
|
||||
btCylinderShape *_shape;
|
||||
BulletUpAxis _up;
|
||||
|
||||
public:
|
||||
static void register_with_read_factory();
|
||||
|
@ -112,7 +112,6 @@ BulletHeightfieldShape::
|
||||
BulletHeightfieldShape(const BulletHeightfieldShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_shape = copy._shape;
|
||||
_num_rows = copy._num_rows;
|
||||
_num_cols = copy._num_cols;
|
||||
_max_height = copy._max_height;
|
||||
@ -121,24 +120,14 @@ BulletHeightfieldShape(const BulletHeightfieldShape ©) {
|
||||
size_t size = (size_t)_num_rows * (size_t)_num_cols;
|
||||
_data = new btScalar[size];
|
||||
memcpy(_data, copy._data, size * sizeof(btScalar));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void BulletHeightfieldShape::
|
||||
operator = (const BulletHeightfieldShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_shape = copy._shape;
|
||||
_num_rows = copy._num_rows;
|
||||
_num_cols = copy._num_cols;
|
||||
_max_height = copy._max_height;
|
||||
_up = copy._up;
|
||||
|
||||
size_t size = (size_t)_num_rows * (size_t)_num_cols;
|
||||
_data = new btScalar[size];
|
||||
memcpy(_data, copy._data, size * sizeof(btScalar));
|
||||
_shape = new btHeightfieldTerrainShape(_num_rows,
|
||||
_num_cols,
|
||||
_data,
|
||||
_max_height,
|
||||
_up,
|
||||
true, false);
|
||||
_shape->setUserPointer(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -35,7 +35,6 @@ PUBLISHED:
|
||||
explicit BulletHeightfieldShape(const PNMImage &image, PN_stdfloat max_height, BulletUpAxis up=Z_up);
|
||||
explicit BulletHeightfieldShape(Texture *tex, PN_stdfloat max_height, BulletUpAxis up=Z_up);
|
||||
BulletHeightfieldShape(const BulletHeightfieldShape ©);
|
||||
void operator = (const BulletHeightfieldShape ©);
|
||||
INLINE ~BulletHeightfieldShape();
|
||||
|
||||
void set_use_diamond_subdivision(bool flag=true);
|
||||
|
@ -40,21 +40,14 @@ BulletMinkowskiSumShape::
|
||||
BulletMinkowskiSumShape(const BulletMinkowskiSumShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_shape = copy._shape;
|
||||
_shape_a = copy._shape_a;
|
||||
_shape_b = copy._shape_b;
|
||||
}
|
||||
|
||||
const btConvexShape *ptr_a = (const btConvexShape *)_shape_a->ptr();
|
||||
const btConvexShape *ptr_b = (const btConvexShape *)_shape_b->ptr();
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void BulletMinkowskiSumShape::
|
||||
operator = (const BulletMinkowskiSumShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_shape = copy._shape;
|
||||
_shape_a = copy._shape_a;
|
||||
_shape_b = copy._shape_b;
|
||||
_shape = new btMinkowskiSumShape(ptr_a, ptr_b);
|
||||
_shape->setUserPointer(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -33,7 +33,6 @@ private:
|
||||
PUBLISHED:
|
||||
explicit BulletMinkowskiSumShape(const BulletShape *shape_a, const BulletShape *shape_b);
|
||||
BulletMinkowskiSumShape(const BulletMinkowskiSumShape ©);
|
||||
void operator = (const BulletMinkowskiSumShape ©);
|
||||
INLINE ~BulletMinkowskiSumShape();
|
||||
|
||||
void set_transform_a(const TransformState *ts);
|
||||
|
@ -34,17 +34,11 @@ BulletPlaneShape::
|
||||
BulletPlaneShape(const BulletPlaneShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_shape = copy._shape;
|
||||
}
|
||||
btVector3 btNormal = copy._shape->getPlaneNormal();
|
||||
PN_stdfloat constant = (PN_stdfloat)_shape->getPlaneConstant();
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void BulletPlaneShape::
|
||||
operator = (const BulletPlaneShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_shape = copy._shape;
|
||||
_shape = new btStaticPlaneShape(btNormal, constant);
|
||||
_shape->setUserPointer(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -34,7 +34,6 @@ private:
|
||||
PUBLISHED:
|
||||
explicit BulletPlaneShape(const LVector3 &normal, PN_stdfloat constant);
|
||||
BulletPlaneShape(const BulletPlaneShape ©);
|
||||
void operator = (const BulletPlaneShape ©);
|
||||
INLINE ~BulletPlaneShape();
|
||||
|
||||
LVector3 get_plane_normal() const;
|
||||
|
@ -32,19 +32,10 @@ BulletSphereShape::
|
||||
BulletSphereShape(const BulletSphereShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_shape = copy._shape;
|
||||
_radius = copy._radius;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void BulletSphereShape::
|
||||
operator = (const BulletSphereShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_shape = copy._shape;
|
||||
_radius = copy._radius;
|
||||
_shape = new btSphereShape(_radius);
|
||||
_shape->setUserPointer(this);
|
||||
}
|
||||
|
||||
|
||||
|
@ -33,7 +33,6 @@ private:
|
||||
PUBLISHED:
|
||||
explicit BulletSphereShape(PN_stdfloat radius);
|
||||
BulletSphereShape(const BulletSphereShape ©);
|
||||
void operator = (const BulletSphereShape ©);
|
||||
INLINE ~BulletSphereShape();
|
||||
|
||||
INLINE PN_stdfloat get_radius() const;
|
||||
|
@ -86,21 +86,21 @@ BulletTriangleMeshShape::
|
||||
BulletTriangleMeshShape(const BulletTriangleMeshShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_bvh_shape = copy._bvh_shape;
|
||||
_gimpact_shape = copy._gimpact_shape;
|
||||
_mesh = copy._mesh;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void BulletTriangleMeshShape::
|
||||
operator = (const BulletTriangleMeshShape ©) {
|
||||
LightMutexHolder holder(BulletWorld::get_global_lock());
|
||||
|
||||
_bvh_shape = copy._bvh_shape;
|
||||
_gimpact_shape = copy._gimpact_shape;
|
||||
_dynamic = copy._dynamic;
|
||||
_compress = copy._compress;
|
||||
_bvh = copy._bvh;
|
||||
_mesh = copy._mesh;
|
||||
|
||||
if (_dynamic) {
|
||||
_gimpact_shape = new btGImpactMeshShape(_mesh->ptr());
|
||||
_gimpact_shape->updateBound();
|
||||
_gimpact_shape->setUserPointer(this);
|
||||
_bvh_shape = NULL;
|
||||
} else {
|
||||
_bvh_shape = new btBvhTriangleMeshShape(_mesh->ptr(), _compress, _bvh);
|
||||
_bvh_shape->setUserPointer(this);
|
||||
_gimpact_shape = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -33,7 +33,6 @@ private:
|
||||
PUBLISHED:
|
||||
explicit BulletTriangleMeshShape(BulletTriangleMesh *mesh, bool dynamic, bool compress=true, bool bvh=true);
|
||||
BulletTriangleMeshShape(const BulletTriangleMeshShape ©);
|
||||
void operator = (const BulletTriangleMeshShape ©);
|
||||
INLINE ~BulletTriangleMeshShape();
|
||||
|
||||
void refit_tree(const LPoint3 &aabb_min, const LPoint3 &aabb_max);
|
||||
|
Loading…
x
Reference in New Issue
Block a user