Bullet double precision support (experimental).
This commit is contained in:
parent
5b79b02b31
commit
db54994233
|
|
@ -50,10 +50,10 @@ needsCollision(btBroadphaseProxy* proxy0) const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletAllHitsRayResult::
|
||||
LPoint3 BulletAllHitsRayResult::
|
||||
get_from_pos() const {
|
||||
|
||||
return btVector3_to_LPoint3f(m_rayFromWorld);
|
||||
return btVector3_to_LPoint3(m_rayFromWorld);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -61,10 +61,10 @@ get_from_pos() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletAllHitsRayResult::
|
||||
LPoint3 BulletAllHitsRayResult::
|
||||
get_to_pos() const {
|
||||
|
||||
return btVector3_to_LPoint3f(m_rayToWorld);
|
||||
return btVector3_to_LPoint3(m_rayToWorld);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -83,10 +83,10 @@ has_hits() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletAllHitsRayResult::
|
||||
PN_stdfloat BulletAllHitsRayResult::
|
||||
get_closest_hit_fraction() const {
|
||||
|
||||
return m_closestHitFraction;
|
||||
return (PN_stdfloat)m_closestHitFraction;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -125,10 +125,10 @@ get_hit(int idx) const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletRayHit::
|
||||
PN_stdfloat BulletRayHit::
|
||||
get_hit_fraction() const {
|
||||
|
||||
return _fraction;
|
||||
return (PN_stdfloat)_fraction;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -147,10 +147,10 @@ get_node() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletRayHit::
|
||||
LPoint3 BulletRayHit::
|
||||
get_hit_pos() const {
|
||||
|
||||
return btVector3_to_LPoint3f(_pos);
|
||||
return btVector3_to_LPoint3(_pos);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -158,9 +158,9 @@ get_hit_pos() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVector3f BulletRayHit::
|
||||
LVector3 BulletRayHit::
|
||||
get_hit_normal() const {
|
||||
|
||||
return btVector3_to_LVector3f(_normal);
|
||||
return btVector3_to_LVector3(_normal);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@ PUBLISHED:
|
|||
INLINE static BulletRayHit empty();
|
||||
|
||||
PandaNode *get_node() const;
|
||||
LPoint3f get_hit_pos() const;
|
||||
LVector3f get_hit_normal() const;
|
||||
float get_hit_fraction() const;
|
||||
LPoint3 get_hit_pos() const;
|
||||
LVector3 get_hit_normal() const;
|
||||
PN_stdfloat get_hit_fraction() const;
|
||||
|
||||
private:
|
||||
btCollisionObject *_object;
|
||||
|
|
@ -56,11 +56,11 @@ struct EXPCL_PANDABULLET BulletAllHitsRayResult : public btCollisionWorld::AllHi
|
|||
PUBLISHED:
|
||||
INLINE static BulletAllHitsRayResult empty();
|
||||
|
||||
LPoint3f get_from_pos() const;
|
||||
LPoint3f get_to_pos() const;
|
||||
LPoint3 get_from_pos() const;
|
||||
LPoint3 get_to_pos() const;
|
||||
|
||||
bool has_hits() const;
|
||||
float get_closest_hit_fraction() const;
|
||||
PN_stdfloat get_closest_hit_fraction() const;
|
||||
|
||||
int get_num_hits() const;
|
||||
const BulletRayHit get_hit(int idx) const;
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ set_kinematic(bool value) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletBodyNode::
|
||||
INLINE PN_stdfloat BulletBodyNode::
|
||||
get_restitution() const {
|
||||
|
||||
return get_object()->getRestitution();
|
||||
|
|
@ -164,7 +164,7 @@ get_restitution() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletBodyNode::
|
||||
set_restitution(float restitution) {
|
||||
set_restitution(PN_stdfloat restitution) {
|
||||
|
||||
return get_object()->setRestitution(restitution);
|
||||
}
|
||||
|
|
@ -174,7 +174,7 @@ set_restitution(float restitution) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletBodyNode::
|
||||
INLINE PN_stdfloat BulletBodyNode::
|
||||
get_friction() const {
|
||||
|
||||
return get_object()->getFriction();
|
||||
|
|
@ -186,7 +186,7 @@ get_friction() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletBodyNode::
|
||||
set_friction(float friction) {
|
||||
set_friction(PN_stdfloat friction) {
|
||||
|
||||
return get_object()->setFriction(friction);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -318,10 +318,10 @@ is_identity(btTransform &trans) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletBodyNode::
|
||||
LPoint3 BulletBodyNode::
|
||||
get_shape_pos(int idx) const {
|
||||
|
||||
nassertr(idx >= 0 && idx < (int)_shapes.size(), LPoint3f::zero());
|
||||
nassertr(idx >= 0 && idx < (int)_shapes.size(), LPoint3::zero());
|
||||
return get_shape_mat(idx).get_row3(3);
|
||||
}
|
||||
|
||||
|
|
@ -330,17 +330,17 @@ get_shape_pos(int idx) const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LMatrix4f BulletBodyNode::
|
||||
LMatrix4 BulletBodyNode::
|
||||
get_shape_mat(int idx) const {
|
||||
|
||||
nassertr(idx >= 0 && idx < (int)_shapes.size(), LMatrix4f::ident_mat());
|
||||
nassertr(idx >= 0 && idx < (int)_shapes.size(), LMatrix4::ident_mat());
|
||||
|
||||
btCollisionShape *root = get_object()->getCollisionShape();
|
||||
if (root->getShapeType() == COMPOUND_SHAPE_PROXYTYPE) {
|
||||
btCompoundShape *compound = (btCompoundShape *)root;
|
||||
|
||||
btTransform trans = compound->getChildTransform(idx);
|
||||
return btTrans_to_LMatrix4f(trans);
|
||||
return btTrans_to_LMatrix4(trans);
|
||||
|
||||
// The above code assumes that shape's index in _shapes member
|
||||
// is the same as the shapes index within the compound. If it
|
||||
|
|
@ -351,13 +351,13 @@ get_shape_mat(int idx) const {
|
|||
for (int i=0; i<compound->getNumChildShapes(); i++) {
|
||||
if (compound->getChildShape(i) == shape) {
|
||||
btTransform trans = compound->getChildTransform(idx);
|
||||
return btTrans_to_LMatrix4f(trans);
|
||||
return btTrans_to_LMatrix4(trans);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
return LMatrix4f::ident_mat();
|
||||
return LMatrix4::ident_mat();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -379,7 +379,7 @@ shape_changed() {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletBodyNode::
|
||||
set_deactivation_time(float dt) {
|
||||
set_deactivation_time(PN_stdfloat dt) {
|
||||
|
||||
get_object()->setDeactivationTime(dt);
|
||||
}
|
||||
|
|
@ -389,7 +389,7 @@ set_deactivation_time(float dt) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletBodyNode::
|
||||
PN_stdfloat BulletBodyNode::
|
||||
get_deactivation_time() const {
|
||||
|
||||
return get_object()->getDeactivationTime();
|
||||
|
|
@ -479,10 +479,10 @@ check_collision_with(PandaNode *node) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVecBase3f BulletBodyNode::
|
||||
LVecBase3 BulletBodyNode::
|
||||
get_anisotropic_friction() const {
|
||||
|
||||
return btVector3_to_LVecBase3f(get_object()->getAnisotropicFriction());
|
||||
return btVector3_to_LVecBase3(get_object()->getAnisotropicFriction());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -491,10 +491,10 @@ get_anisotropic_friction() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletBodyNode::
|
||||
set_anisotropic_friction(const LVecBase3f &friction) {
|
||||
set_anisotropic_friction(const LVecBase3 &friction) {
|
||||
|
||||
nassertv(!friction.is_nan());
|
||||
get_object()->setAnisotropicFriction(LVecBase3f_to_btVector3(friction));
|
||||
get_object()->setAnisotropicFriction(LVecBase3_to_btVector3(friction));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -513,7 +513,7 @@ has_contact_response() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletBodyNode::
|
||||
PN_stdfloat BulletBodyNode::
|
||||
get_contact_processing_threshold() const {
|
||||
|
||||
return get_object()->getContactProcessingThreshold();
|
||||
|
|
@ -526,7 +526,7 @@ get_contact_processing_threshold() const {
|
|||
// contacts, if the distance is above this threshold.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletBodyNode::
|
||||
set_contact_processing_threshold(float threshold) {
|
||||
set_contact_processing_threshold(PN_stdfloat threshold) {
|
||||
|
||||
get_object()->setContactProcessingThreshold(threshold);
|
||||
}
|
||||
|
|
@ -536,7 +536,7 @@ set_contact_processing_threshold(float threshold) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletBodyNode::
|
||||
PN_stdfloat BulletBodyNode::
|
||||
get_ccd_swept_sphere_radius() const {
|
||||
|
||||
return get_object()->getCcdSweptSphereRadius();
|
||||
|
|
@ -548,7 +548,7 @@ get_ccd_swept_sphere_radius() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletBodyNode::
|
||||
set_ccd_swept_sphere_radius(float radius) {
|
||||
set_ccd_swept_sphere_radius(PN_stdfloat radius) {
|
||||
|
||||
return get_object()->setCcdSweptSphereRadius(radius);
|
||||
}
|
||||
|
|
@ -558,7 +558,7 @@ set_ccd_swept_sphere_radius(float radius) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletBodyNode::
|
||||
PN_stdfloat BulletBodyNode::
|
||||
get_ccd_motion_threshold() const {
|
||||
|
||||
return get_object()->getCcdMotionThreshold();
|
||||
|
|
@ -570,7 +570,7 @@ get_ccd_motion_threshold() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletBodyNode::
|
||||
set_ccd_motion_threshold(float threshold) {
|
||||
set_ccd_motion_threshold(PN_stdfloat threshold) {
|
||||
|
||||
return get_object()->setCcdMotionThreshold(threshold);
|
||||
}
|
||||
|
|
@ -621,9 +621,9 @@ add_shapes_from_collision_solids(CollisionNode *cnode) {
|
|||
}
|
||||
|
||||
for (int i=2; i < polygon->get_num_points(); i++ ) {
|
||||
LPoint3f p1 = polygon->get_point(0);
|
||||
LPoint3f p2 = polygon->get_point(i-1);
|
||||
LPoint3f p3 = polygon->get_point(i);
|
||||
LPoint3 p1 = polygon->get_point(0);
|
||||
LPoint3 p2 = polygon->get_point(i-1);
|
||||
LPoint3 p3 = polygon->get_point(i);
|
||||
|
||||
mesh->add_triangle(p1, p2, p3, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ PUBLISHED:
|
|||
INLINE BulletShape *get_shape(int idx) const;
|
||||
MAKE_SEQ(get_shapes, get_num_shapes, get_shape);
|
||||
|
||||
LPoint3f get_shape_pos(int idx) const;
|
||||
LMatrix4f get_shape_mat(int idx) const;
|
||||
LPoint3 get_shape_pos(int idx) const;
|
||||
LMatrix4 get_shape_mat(int idx) const;
|
||||
|
||||
void add_shapes_from_collision_solids(CollisionNode *cnode);
|
||||
|
||||
|
|
@ -68,15 +68,15 @@ PUBLISHED:
|
|||
|
||||
bool has_contact_response() const;
|
||||
|
||||
float get_contact_processing_threshold() const;
|
||||
void set_contact_processing_threshold(float threshold);
|
||||
PN_stdfloat get_contact_processing_threshold() const;
|
||||
void set_contact_processing_threshold(PN_stdfloat threshold);
|
||||
|
||||
// Deactivation
|
||||
bool is_active() const;
|
||||
void set_active(bool active, bool force=false);
|
||||
|
||||
void set_deactivation_time(float dt);
|
||||
float get_deactivation_time() const;
|
||||
void set_deactivation_time(PN_stdfloat dt);
|
||||
PN_stdfloat get_deactivation_time() const;
|
||||
|
||||
void set_deactivation_enabled(const bool enabled, const bool force=false);
|
||||
bool is_deactivation_enabled() const;
|
||||
|
|
@ -86,21 +86,21 @@ PUBLISHED:
|
|||
INLINE bool is_debug_enabled() const;
|
||||
|
||||
// Friction and Restitution
|
||||
INLINE float get_restitution() const;
|
||||
INLINE void set_restitution(float restitution);
|
||||
INLINE PN_stdfloat get_restitution() const;
|
||||
INLINE void set_restitution(PN_stdfloat restitution);
|
||||
|
||||
INLINE float get_friction() const;
|
||||
INLINE void set_friction(float friction);
|
||||
INLINE PN_stdfloat get_friction() const;
|
||||
INLINE void set_friction(PN_stdfloat friction);
|
||||
|
||||
INLINE bool has_anisotropic_friction() const;
|
||||
void set_anisotropic_friction(const LVecBase3f &friction);
|
||||
LVecBase3f get_anisotropic_friction() const;
|
||||
void set_anisotropic_friction(const LVecBase3 &friction);
|
||||
LVecBase3 get_anisotropic_friction() const;
|
||||
|
||||
// CCD
|
||||
float get_ccd_swept_sphere_radius() const;
|
||||
float get_ccd_motion_threshold() const;
|
||||
void set_ccd_swept_sphere_radius(float radius);
|
||||
void set_ccd_motion_threshold(float threshold);
|
||||
PN_stdfloat get_ccd_swept_sphere_radius() const;
|
||||
PN_stdfloat get_ccd_motion_threshold() const;
|
||||
void set_ccd_swept_sphere_radius(PN_stdfloat radius);
|
||||
void set_ccd_motion_threshold(PN_stdfloat threshold);
|
||||
|
||||
public:
|
||||
virtual btCollisionObject *get_object() const = 0;
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ TypeHandle BulletBoxShape::_type_handle;
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
BulletBoxShape::
|
||||
BulletBoxShape(const LVecBase3f &halfExtents) {
|
||||
BulletBoxShape(const LVecBase3 &halfExtents) {
|
||||
|
||||
btVector3 btHalfExtents = LVecBase3f_to_btVector3(halfExtents);
|
||||
btVector3 btHalfExtents = LVecBase3_to_btVector3(halfExtents);
|
||||
|
||||
_shape = new btBoxShape(btHalfExtents);
|
||||
_shape->setUserPointer(this);
|
||||
|
|
@ -47,10 +47,10 @@ ptr() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVecBase3f BulletBoxShape::
|
||||
LVecBase3 BulletBoxShape::
|
||||
get_half_extents_without_marging() const {
|
||||
|
||||
return btVector3_to_LVecBase3f(_shape->getHalfExtentsWithoutMargin());
|
||||
return btVector3_to_LVecBase3(_shape->getHalfExtentsWithoutMargin());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -58,10 +58,10 @@ get_half_extents_without_marging() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVecBase3f BulletBoxShape::
|
||||
LVecBase3 BulletBoxShape::
|
||||
get_half_extents_with_marging() const {
|
||||
|
||||
return btVector3_to_LVecBase3f(_shape->getHalfExtentsWithMargin());
|
||||
return btVector3_to_LVecBase3(_shape->getHalfExtentsWithMargin());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -72,10 +72,10 @@ get_half_extents_with_marging() const {
|
|||
BulletBoxShape *BulletBoxShape::
|
||||
make_from_solid(const CollisionBox *solid) {
|
||||
|
||||
LPoint3f p0 = solid->get_min();
|
||||
LPoint3f p1 = solid->get_max();
|
||||
LPoint3 p0 = solid->get_min();
|
||||
LPoint3 p1 = solid->get_max();
|
||||
|
||||
LVecBase3f extents(p1.get_x() - p0.get_x() / 2.0,
|
||||
LVecBase3 extents(p1.get_x() - p0.get_x() / 2.0,
|
||||
p1.get_y() - p0.get_y() / 2.0,
|
||||
p1.get_z() - p0.get_z() / 2.0);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@
|
|||
class EXPCL_PANDABULLET BulletBoxShape : public BulletShape {
|
||||
|
||||
PUBLISHED:
|
||||
BulletBoxShape(const LVecBase3f &halfExtents);
|
||||
BulletBoxShape(const LVecBase3 &halfExtents);
|
||||
INLINE ~BulletBoxShape();
|
||||
|
||||
LVecBase3f get_half_extents_without_marging() const;
|
||||
LVecBase3f get_half_extents_with_marging() const;
|
||||
LVecBase3 get_half_extents_without_marging() const;
|
||||
LVecBase3 get_half_extents_with_marging() const;
|
||||
|
||||
static BulletBoxShape *make_from_solid(const CollisionBox *solid);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ INLINE BulletCapsuleShape::
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletCapsuleShape::
|
||||
INLINE PN_stdfloat BulletCapsuleShape::
|
||||
get_radius() const {
|
||||
|
||||
return _shape->getRadius();
|
||||
return (PN_stdfloat)_shape->getRadius();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -39,9 +39,9 @@ get_radius() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletCapsuleShape::
|
||||
INLINE PN_stdfloat BulletCapsuleShape::
|
||||
get_half_height() const {
|
||||
|
||||
return _shape->getHalfHeight();
|
||||
return (PN_stdfloat)_shape->getHalfHeight();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ TypeHandle BulletCapsuleShape::_type_handle;
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
BulletCapsuleShape::
|
||||
BulletCapsuleShape(float radius, float height, BulletUpAxis up) {
|
||||
BulletCapsuleShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up) {
|
||||
|
||||
switch (up) {
|
||||
case X_up:
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@
|
|||
class EXPCL_PANDABULLET BulletCapsuleShape : public BulletShape {
|
||||
|
||||
PUBLISHED:
|
||||
BulletCapsuleShape(float radius, float height, BulletUpAxis up=Z_up);
|
||||
BulletCapsuleShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up=Z_up);
|
||||
INLINE ~BulletCapsuleShape();
|
||||
|
||||
INLINE float get_radius() const;
|
||||
INLINE float get_half_height() const;
|
||||
INLINE PN_stdfloat get_radius() const;
|
||||
INLINE PN_stdfloat get_half_height() const;
|
||||
|
||||
public:
|
||||
virtual btCollisionShape *ptr() const;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ TypeHandle BulletCharacterControllerNode::_type_handle;
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
BulletCharacterControllerNode::
|
||||
BulletCharacterControllerNode(BulletShape *shape, float step_height, const char *name) : PandaNode(name) {
|
||||
BulletCharacterControllerNode(BulletShape *shape, PN_stdfloat step_height, const char *name) : PandaNode(name) {
|
||||
|
||||
// Synchronised transform
|
||||
_sync = TransformState::make_identity();
|
||||
|
|
@ -177,7 +177,7 @@ safe_to_transform() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletCharacterControllerNode::
|
||||
set_linear_velocity(const LVector3f &velocity, bool is_local) {
|
||||
set_linear_velocity(const LVector3 &velocity, bool is_local) {
|
||||
|
||||
nassertv(!velocity.is_nan());
|
||||
|
||||
|
|
@ -191,7 +191,7 @@ set_linear_velocity(const LVector3f &velocity, bool is_local) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletCharacterControllerNode::
|
||||
set_angular_velocity(float omega) {
|
||||
set_angular_velocity(PN_stdfloat omega) {
|
||||
|
||||
_angular_velocity = omega;
|
||||
}
|
||||
|
|
@ -202,7 +202,7 @@ set_angular_velocity(float omega) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletCharacterControllerNode::
|
||||
sync_p2b(float dt) {
|
||||
sync_p2b(PN_stdfloat dt) {
|
||||
|
||||
// Synchronise global transform
|
||||
transform_changed();
|
||||
|
|
@ -222,10 +222,10 @@ sync_p2b(float dt) {
|
|||
if (_linear_velocity_is_local) {
|
||||
btTransform xform = _ghost->getWorldTransform();
|
||||
xform.setOrigin(btVector3(0.0f, 0.0f, 0.0f));
|
||||
v = xform(LVecBase3f_to_btVector3(_linear_velocity));
|
||||
v = xform(LVecBase3_to_btVector3(_linear_velocity));
|
||||
}
|
||||
else {
|
||||
v = LVecBase3f_to_btVector3(_linear_velocity);
|
||||
v = LVecBase3_to_btVector3(_linear_velocity);
|
||||
}
|
||||
|
||||
//_character->setVelocityForTimeInterval(v, dt);
|
||||
|
|
@ -243,13 +243,13 @@ void BulletCharacterControllerNode::
|
|||
sync_b2p() {
|
||||
|
||||
NodePath np = NodePath::any_path((PandaNode *)this);
|
||||
LVecBase3f scale = np.get_net_transform()->get_scale();
|
||||
LVecBase3 scale = np.get_net_transform()->get_scale();
|
||||
|
||||
btTransform trans = _ghost->getWorldTransform();
|
||||
CPT(TransformState) ts = btTrans_to_TransformState(trans, scale);
|
||||
|
||||
LMatrix4f m_sync = _sync->get_mat();
|
||||
LMatrix4f m_ts = ts->get_mat();
|
||||
LMatrix4 m_sync = _sync->get_mat();
|
||||
LMatrix4 m_ts = ts->get_mat();
|
||||
|
||||
if (!m_sync.almost_equal(m_ts)) {
|
||||
_sync = ts;
|
||||
|
|
@ -272,19 +272,19 @@ transform_changed() {
|
|||
NodePath np = NodePath::any_path((PandaNode *)this);
|
||||
CPT(TransformState) ts = np.get_net_transform();
|
||||
|
||||
LMatrix4f m_sync = _sync->get_mat();
|
||||
LMatrix4f m_ts = ts->get_mat();
|
||||
LMatrix4 m_sync = _sync->get_mat();
|
||||
LMatrix4 m_ts = ts->get_mat();
|
||||
|
||||
if (!m_sync.almost_equal(m_ts)) {
|
||||
_sync = ts;
|
||||
|
||||
// Get translation, heading and scale
|
||||
LPoint3f pos = ts->get_pos();
|
||||
float heading = ts->get_hpr().get_x();
|
||||
LVecBase3f scale = ts->get_scale();
|
||||
LPoint3 pos = ts->get_pos();
|
||||
PN_stdfloat heading = ts->get_hpr().get_x();
|
||||
LVecBase3 scale = ts->get_scale();
|
||||
|
||||
// Set translation
|
||||
_character->warp(LVecBase3f_to_btVector3(pos));
|
||||
_character->warp(LVecBase3_to_btVector3(pos));
|
||||
|
||||
// Set Heading
|
||||
btMatrix3x3 m = _ghost->getWorldTransform().getBasis();
|
||||
|
|
@ -349,9 +349,9 @@ do_jump() {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletCharacterControllerNode::
|
||||
set_fall_speed(float fall_speed) {
|
||||
set_fall_speed(PN_stdfloat fall_speed) {
|
||||
|
||||
_character->setFallSpeed(fall_speed);
|
||||
_character->setFallSpeed((btScalar)fall_speed);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -360,9 +360,9 @@ set_fall_speed(float fall_speed) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletCharacterControllerNode::
|
||||
set_jump_speed(float jump_speed) {
|
||||
set_jump_speed(PN_stdfloat jump_speed) {
|
||||
|
||||
_character->setJumpSpeed(jump_speed);
|
||||
_character->setJumpSpeed((btScalar)jump_speed);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -371,9 +371,9 @@ set_jump_speed(float jump_speed) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletCharacterControllerNode::
|
||||
set_max_jump_height(float max_jump_height) {
|
||||
set_max_jump_height(PN_stdfloat max_jump_height) {
|
||||
|
||||
_character->setMaxJumpHeight(max_jump_height);
|
||||
_character->setMaxJumpHeight((btScalar)max_jump_height);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -382,9 +382,9 @@ set_max_jump_height(float max_jump_height) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletCharacterControllerNode::
|
||||
set_max_slope(float max_slope) {
|
||||
set_max_slope(PN_stdfloat max_slope) {
|
||||
|
||||
_character->setMaxSlope(max_slope);
|
||||
_character->setMaxSlope((btScalar)max_slope);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -392,20 +392,20 @@ set_max_slope(float max_slope) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletCharacterControllerNode::
|
||||
PN_stdfloat BulletCharacterControllerNode::
|
||||
get_max_slope() const {
|
||||
|
||||
return _character->getMaxSlope();
|
||||
return (PN_stdfloat)_character->getMaxSlope();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: BulletCharacterControllerNode::get_gravity
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletCharacterControllerNode::
|
||||
PN_stdfloat BulletCharacterControllerNode::
|
||||
get_gravity() const {
|
||||
|
||||
return _character->getGravity();
|
||||
return (PN_stdfloat)_character->getGravity();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -413,9 +413,9 @@ get_gravity() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletCharacterControllerNode::
|
||||
set_gravity(float gravity) {
|
||||
set_gravity(PN_stdfloat gravity) {
|
||||
|
||||
_character->setGravity((btScalar) gravity);
|
||||
_character->setGravity((btScalar)gravity);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -34,22 +34,22 @@
|
|||
class EXPCL_PANDABULLET BulletCharacterControllerNode : public PandaNode {
|
||||
|
||||
PUBLISHED:
|
||||
BulletCharacterControllerNode(BulletShape *shape, float step_height, const char *name="character");
|
||||
BulletCharacterControllerNode(BulletShape *shape, PN_stdfloat step_height, const char *name="character");
|
||||
INLINE ~BulletCharacterControllerNode();
|
||||
|
||||
void set_linear_velocity(const LVector3f &velocity, bool is_local);
|
||||
void set_angular_velocity(float omega);
|
||||
void set_linear_velocity(const LVector3 &velocity, bool is_local);
|
||||
void set_angular_velocity(PN_stdfloat omega);
|
||||
|
||||
BulletShape *get_shape() const;
|
||||
|
||||
float get_gravity() const;
|
||||
float get_max_slope() const;
|
||||
PN_stdfloat get_gravity() const;
|
||||
PN_stdfloat get_max_slope() const;
|
||||
|
||||
void set_fall_speed(float fall_speed);
|
||||
void set_jump_speed(float jump_speed);
|
||||
void set_max_jump_height(float max_jump_height);
|
||||
void set_max_slope(float max_slope);
|
||||
void set_gravity(float gravity);
|
||||
void set_fall_speed(PN_stdfloat fall_speed);
|
||||
void set_jump_speed(PN_stdfloat jump_speed);
|
||||
void set_max_jump_height(PN_stdfloat max_jump_height);
|
||||
void set_max_slope(PN_stdfloat max_slope);
|
||||
void set_gravity(PN_stdfloat gravity);
|
||||
void set_use_ghost_sweep_test(bool value);
|
||||
|
||||
bool is_on_ground() const;
|
||||
|
|
@ -69,7 +69,7 @@ public:
|
|||
INLINE btPairCachingGhostObject *get_ghost() const;
|
||||
INLINE btKinematicCharacterController *get_character() const;
|
||||
|
||||
void sync_p2b(float dt);
|
||||
void sync_p2b(PN_stdfloat dt);
|
||||
void sync_b2p();
|
||||
|
||||
protected:
|
||||
|
|
@ -86,9 +86,9 @@ private:
|
|||
|
||||
PT(BulletShape) _shape;
|
||||
|
||||
LVector3f _linear_velocity;
|
||||
LVector3 _linear_velocity;
|
||||
bool _linear_velocity_is_local;
|
||||
float _angular_velocity;
|
||||
PN_stdfloat _angular_velocity;
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -61,10 +61,10 @@ has_hit() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletClosestHitRayResult::
|
||||
PN_stdfloat BulletClosestHitRayResult::
|
||||
get_hit_fraction() const {
|
||||
|
||||
return m_closestHitFraction;
|
||||
return (PN_stdfloat)m_closestHitFraction;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -84,10 +84,10 @@ get_node() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletClosestHitRayResult::
|
||||
LPoint3 BulletClosestHitRayResult::
|
||||
get_hit_pos() const {
|
||||
|
||||
return btVector3_to_LPoint3f(m_hitPointWorld);
|
||||
return btVector3_to_LPoint3(m_hitPointWorld);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -95,10 +95,10 @@ get_hit_pos() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVector3f BulletClosestHitRayResult::
|
||||
LVector3 BulletClosestHitRayResult::
|
||||
get_hit_normal() const {
|
||||
|
||||
return btVector3_to_LVector3f(m_hitNormalWorld);
|
||||
return btVector3_to_LVector3(m_hitNormalWorld);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -106,10 +106,10 @@ get_hit_normal() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletClosestHitRayResult::
|
||||
LPoint3 BulletClosestHitRayResult::
|
||||
get_from_pos() const {
|
||||
|
||||
return btVector3_to_LPoint3f(m_rayFromWorld);
|
||||
return btVector3_to_LPoint3(m_rayFromWorld);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -117,9 +117,9 @@ get_from_pos() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletClosestHitRayResult::
|
||||
LPoint3 BulletClosestHitRayResult::
|
||||
get_to_pos() const {
|
||||
|
||||
return btVector3_to_LPoint3f(m_rayToWorld);
|
||||
return btVector3_to_LPoint3(m_rayToWorld);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,15 +33,15 @@ struct EXPCL_PANDABULLET BulletClosestHitRayResult : public btCollisionWorld::Cl
|
|||
PUBLISHED:
|
||||
INLINE static BulletClosestHitRayResult empty();
|
||||
|
||||
LPoint3f get_from_pos() const;
|
||||
LPoint3f get_to_pos() const;
|
||||
LPoint3 get_from_pos() const;
|
||||
LPoint3 get_to_pos() const;
|
||||
|
||||
bool has_hit() const;
|
||||
|
||||
PandaNode *get_node() const;
|
||||
LPoint3f get_hit_pos() const;
|
||||
LVector3f get_hit_normal() const;
|
||||
float get_hit_fraction() const;
|
||||
LPoint3 get_hit_pos() const;
|
||||
LVector3 get_hit_normal() const;
|
||||
PN_stdfloat get_hit_fraction() const;
|
||||
|
||||
public:
|
||||
virtual bool needsCollision(btBroadphaseProxy* proxy0) const;
|
||||
|
|
|
|||
|
|
@ -61,10 +61,10 @@ has_hit() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletClosestHitSweepResult::
|
||||
PN_stdfloat BulletClosestHitSweepResult::
|
||||
get_hit_fraction() const {
|
||||
|
||||
return m_closestHitFraction;
|
||||
return (PN_stdfloat)m_closestHitFraction;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -84,10 +84,10 @@ get_node() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletClosestHitSweepResult::
|
||||
LPoint3 BulletClosestHitSweepResult::
|
||||
get_hit_pos() const {
|
||||
|
||||
return btVector3_to_LPoint3f(m_hitPointWorld);
|
||||
return btVector3_to_LPoint3(m_hitPointWorld);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -95,10 +95,10 @@ get_hit_pos() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVector3f BulletClosestHitSweepResult::
|
||||
LVector3 BulletClosestHitSweepResult::
|
||||
get_hit_normal() const {
|
||||
|
||||
return btVector3_to_LVector3f(m_hitNormalWorld);
|
||||
return btVector3_to_LVector3(m_hitNormalWorld);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -106,10 +106,10 @@ get_hit_normal() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletClosestHitSweepResult::
|
||||
LPoint3 BulletClosestHitSweepResult::
|
||||
get_from_pos() const {
|
||||
|
||||
return btVector3_to_LPoint3f(m_convexFromWorld);
|
||||
return btVector3_to_LPoint3(m_convexFromWorld);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -117,9 +117,9 @@ get_from_pos() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletClosestHitSweepResult::
|
||||
LPoint3 BulletClosestHitSweepResult::
|
||||
get_to_pos() const {
|
||||
|
||||
return btVector3_to_LPoint3f(m_convexToWorld);
|
||||
return btVector3_to_LPoint3(m_convexToWorld);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,15 +33,15 @@ struct EXPCL_PANDABULLET BulletClosestHitSweepResult : public btCollisionWorld::
|
|||
PUBLISHED:
|
||||
INLINE static BulletClosestHitSweepResult empty();
|
||||
|
||||
LPoint3f get_from_pos() const;
|
||||
LPoint3f get_to_pos() const;
|
||||
LPoint3 get_from_pos() const;
|
||||
LPoint3 get_to_pos() const;
|
||||
|
||||
bool has_hit() const;
|
||||
|
||||
PandaNode *get_node() const;
|
||||
LPoint3f get_hit_pos() const;
|
||||
LVector3f get_hit_normal() const;
|
||||
float get_hit_fraction() const;
|
||||
LPoint3 get_hit_pos() const;
|
||||
LVector3 get_hit_normal() const;
|
||||
PN_stdfloat get_hit_fraction() const;
|
||||
|
||||
public:
|
||||
virtual bool needsCollision(btBroadphaseProxy* proxy0) const;
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ INLINE BulletConeShape::
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletConeShape::
|
||||
INLINE PN_stdfloat BulletConeShape::
|
||||
get_radius() const {
|
||||
|
||||
return _shape->getRadius();
|
||||
return (PN_stdfloat)_shape->getRadius();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -39,9 +39,9 @@ get_radius() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletConeShape::
|
||||
INLINE PN_stdfloat BulletConeShape::
|
||||
get_height() const {
|
||||
|
||||
return _shape->getHeight();
|
||||
return (PN_stdfloat)_shape->getHeight();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,17 +22,17 @@ TypeHandle BulletConeShape::_type_handle;
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
BulletConeShape::
|
||||
BulletConeShape(float radius, float height, BulletUpAxis up) {
|
||||
BulletConeShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up) {
|
||||
|
||||
switch (up) {
|
||||
case X_up:
|
||||
_shape = new btConeShapeX(radius, height);
|
||||
_shape = new btConeShapeX((btScalar)radius, (btScalar)height);
|
||||
break;
|
||||
case Y_up:
|
||||
_shape = new btConeShape(radius, height);
|
||||
_shape = new btConeShape((btScalar)radius, (btScalar)height);
|
||||
break;
|
||||
case Z_up:
|
||||
_shape = new btConeShapeZ(radius, height);
|
||||
_shape = new btConeShapeZ((btScalar)radius, (btScalar)height);
|
||||
break;
|
||||
default:
|
||||
bullet_cat.error() << "invalid up-axis:" << up << endl;
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@
|
|||
class EXPCL_PANDABULLET BulletConeShape : public BulletShape {
|
||||
|
||||
PUBLISHED:
|
||||
BulletConeShape(float radius, float height, BulletUpAxis up=Z_up);
|
||||
BulletConeShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up=Z_up);
|
||||
INLINE ~BulletConeShape();
|
||||
|
||||
INLINE float get_radius() const;
|
||||
INLINE float get_height() const;
|
||||
INLINE PN_stdfloat get_radius() const;
|
||||
INLINE PN_stdfloat get_height() const;
|
||||
|
||||
public:
|
||||
virtual btCollisionShape *ptr() const;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ ptr() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletConeTwistConstraint::
|
||||
set_limit(int index, float value) {
|
||||
set_limit(int index, PN_stdfloat value) {
|
||||
|
||||
value = deg_2_rad(value);
|
||||
|
||||
|
|
@ -84,7 +84,7 @@ set_limit(int index, float value) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletConeTwistConstraint::
|
||||
set_limit(float swing1, float swing2, float twist, float softness, float bias, float relaxation) {
|
||||
set_limit(PN_stdfloat swing1, PN_stdfloat swing2, PN_stdfloat twist, PN_stdfloat softness, PN_stdfloat bias, PN_stdfloat relaxation) {
|
||||
|
||||
swing1 = deg_2_rad(swing1);
|
||||
swing2 = deg_2_rad(swing2);
|
||||
|
|
@ -99,7 +99,7 @@ set_limit(float swing1, float swing2, float twist, float softness, float bias, f
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletConeTwistConstraint::
|
||||
set_damping(float damping) {
|
||||
set_damping(PN_stdfloat damping) {
|
||||
|
||||
_constraint->setDamping(damping);
|
||||
}
|
||||
|
|
@ -109,7 +109,7 @@ set_damping(float damping) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletConeTwistConstraint::
|
||||
PN_stdfloat BulletConeTwistConstraint::
|
||||
get_fix_threshold() const {
|
||||
|
||||
return _constraint->getFixThresh();
|
||||
|
|
@ -121,7 +121,7 @@ get_fix_threshold() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletConeTwistConstraint::
|
||||
set_fix_threshold(float threshold) {
|
||||
set_fix_threshold(PN_stdfloat threshold) {
|
||||
|
||||
_constraint->setFixThresh(threshold);
|
||||
}
|
||||
|
|
@ -143,7 +143,7 @@ enable_motor(bool enable) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletConeTwistConstraint::
|
||||
set_max_motor_impulse(float max_impulse) {
|
||||
set_max_motor_impulse(PN_stdfloat max_impulse) {
|
||||
|
||||
_constraint->setMaxMotorImpulse(max_impulse);
|
||||
}
|
||||
|
|
@ -154,7 +154,7 @@ set_max_motor_impulse(float max_impulse) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletConeTwistConstraint::
|
||||
set_max_motor_impulse_normalized(float max_impulse) {
|
||||
set_max_motor_impulse_normalized(PN_stdfloat max_impulse) {
|
||||
|
||||
_constraint->setMaxMotorImpulseNormalized(max_impulse);
|
||||
}
|
||||
|
|
@ -165,9 +165,9 @@ set_max_motor_impulse_normalized(float max_impulse) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletConeTwistConstraint::
|
||||
set_motor_target(const LQuaternionf &quat) {
|
||||
set_motor_target(const LQuaternion &quat) {
|
||||
|
||||
_constraint->setMotorTarget(LQuaternionf_to_btQuat(quat));
|
||||
_constraint->setMotorTarget(LQuaternion_to_btQuat(quat));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -176,8 +176,8 @@ set_motor_target(const LQuaternionf &quat) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletConeTwistConstraint::
|
||||
set_motor_target_in_constraint_space(const LQuaternionf &quat) {
|
||||
set_motor_target_in_constraint_space(const LQuaternion &quat) {
|
||||
|
||||
_constraint->setMotorTargetInConstraintSpace(LQuaternionf_to_btQuat(quat));
|
||||
_constraint->setMotorTargetInConstraintSpace(LQuaternion_to_btQuat(quat));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,19 +40,19 @@ PUBLISHED:
|
|||
CPT(TransformState) frame_b);
|
||||
INLINE ~BulletConeTwistConstraint();
|
||||
|
||||
void set_limit(int index, float value);
|
||||
void set_limit(float swing1, float swing2, float twist, float softness=1.0f, float bias=0.3f, float relaxation=1.0f);
|
||||
void set_limit(int index, PN_stdfloat value);
|
||||
void set_limit(PN_stdfloat swing1, PN_stdfloat swing2, PN_stdfloat twist, PN_stdfloat softness=1.0f, PN_stdfloat bias=0.3f, PN_stdfloat relaxation=1.0f);
|
||||
|
||||
void set_damping(float damping);
|
||||
void set_damping(PN_stdfloat damping);
|
||||
|
||||
float get_fix_threshold() const;
|
||||
void set_fix_threshold(float threshold);
|
||||
PN_stdfloat get_fix_threshold() const;
|
||||
void set_fix_threshold(PN_stdfloat threshold);
|
||||
|
||||
void enable_motor(bool enable);
|
||||
void set_max_motor_impulse(float max_impulse);
|
||||
void set_max_motor_impulse_normalized(float max_impulse);
|
||||
void set_motor_target(const LQuaternionf &quat);
|
||||
void set_motor_target_in_constraint_space(const LQuaternionf &quat);
|
||||
void set_max_motor_impulse(PN_stdfloat max_impulse);
|
||||
void set_max_motor_impulse_normalized(PN_stdfloat max_impulse);
|
||||
void set_motor_target(const LQuaternion &quat);
|
||||
void set_motor_target_in_constraint_space(const LQuaternion &quat);
|
||||
|
||||
public:
|
||||
virtual btTypedConstraint *ptr() const;
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ enable_feedback(bool value) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletConstraint::
|
||||
PN_stdfloat BulletConstraint::
|
||||
get_applied_impulse() const {
|
||||
|
||||
return ptr()->getAppliedImpulse();
|
||||
return (PN_stdfloat)ptr()->getAppliedImpulse();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -45,9 +45,9 @@ get_applied_impulse() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletConstraint::
|
||||
set_debug_draw_size(float size) {
|
||||
set_debug_draw_size(PN_stdfloat size) {
|
||||
|
||||
ptr()->setDbgDrawSize(size);
|
||||
ptr()->setDbgDrawSize((btScalar)size);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -55,10 +55,10 @@ set_debug_draw_size(float size) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletConstraint::
|
||||
PN_stdfloat BulletConstraint::
|
||||
get_debug_draw_size() {
|
||||
|
||||
return ptr()->getDbgDrawSize();
|
||||
return (PN_stdfloat)ptr()->getDbgDrawSize();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ PUBLISHED:
|
|||
BulletRigidBodyNode *get_rigid_body_b();
|
||||
|
||||
void enable_feedback(bool value);
|
||||
void set_debug_draw_size(float size);
|
||||
void set_debug_draw_size(PN_stdfloat size);
|
||||
|
||||
float get_applied_impulse() const;
|
||||
float get_debug_draw_size();
|
||||
PN_stdfloat get_applied_impulse() const;
|
||||
PN_stdfloat get_debug_draw_size();
|
||||
|
||||
public:
|
||||
virtual btTypedConstraint *ptr() const = 0;
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ ptr() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletConvexHullShape::
|
||||
add_point(const LPoint3f &p) {
|
||||
add_point(const LPoint3 &p) {
|
||||
|
||||
_shape->addPoint(LVecBase3f_to_btVector3(p));
|
||||
_shape->addPoint(LVecBase3_to_btVector3(p));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -60,15 +60,15 @@ add_point(const LPoint3f &p) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletConvexHullShape::
|
||||
add_array(const PTA_LVecBase3f &points) {
|
||||
add_array(const PTA_LVecBase3 &points) {
|
||||
|
||||
_shape = new btConvexHullShape(NULL, 0);
|
||||
_shape->setUserPointer(this);
|
||||
|
||||
PTA_LVecBase3f::const_iterator it;
|
||||
PTA_LVecBase3::const_iterator it;
|
||||
for (it=points.begin(); it!=points.end(); it++) {
|
||||
LVecBase3f v = *it;
|
||||
_shape->addPoint(LVecBase3f_to_btVector3(v));
|
||||
LVecBase3 v = *it;
|
||||
_shape->addPoint(LVecBase3_to_btVector3(v));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -81,22 +81,22 @@ void BulletConvexHullShape::
|
|||
add_geom(const Geom *geom) {
|
||||
|
||||
// Collect points
|
||||
pvector<LPoint3f> points;
|
||||
pvector<LPoint3> points;
|
||||
|
||||
CPT(GeomVertexData) vdata = geom->get_vertex_data();
|
||||
GeomVertexReader reader = GeomVertexReader(vdata, InternalName::get_vertex());
|
||||
|
||||
while (!reader.is_at_end()) {
|
||||
points.push_back(reader.get_data3f());
|
||||
points.push_back(reader.get_data3());
|
||||
}
|
||||
|
||||
// Create shape
|
||||
_shape = new btConvexHullShape(NULL, 0);
|
||||
_shape->setUserPointer(this);
|
||||
|
||||
pvector<LPoint3f>::const_iterator it;
|
||||
pvector<LPoint3>::const_iterator it;
|
||||
for (it=points.begin(); it!=points.end(); it++) {
|
||||
_shape->addPoint(LVecBase3f_to_btVector3(*it));
|
||||
_shape->addPoint(LVecBase3_to_btVector3(*it));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ PUBLISHED:
|
|||
BulletConvexHullShape();
|
||||
INLINE ~BulletConvexHullShape();
|
||||
|
||||
void add_point(const LPoint3f &p);
|
||||
void add_array(const PTA_LVecBase3f &points);
|
||||
void add_point(const LPoint3 &p);
|
||||
void add_array(const PTA_LVecBase3 &points);
|
||||
void add_geom(const Geom *geom);
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -24,17 +24,17 @@ TypeHandle BulletConvexPointCloudShape::_type_handle;
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
BulletConvexPointCloudShape::
|
||||
BulletConvexPointCloudShape(const PTA_LVecBase3f &points, LVecBase3f scale) {
|
||||
BulletConvexPointCloudShape(const PTA_LVecBase3 &points, LVecBase3 scale) {
|
||||
|
||||
btVector3 btScale = LVecBase3f_to_btVector3(scale);
|
||||
btVector3 btScale = LVecBase3_to_btVector3(scale);
|
||||
|
||||
// Convert points
|
||||
btVector3 *btPoints = new btVector3[points.size()];
|
||||
|
||||
int i = 0;
|
||||
PTA_LVecBase3f::const_iterator it;
|
||||
PTA_LVecBase3::const_iterator it;
|
||||
for (it=points.begin(); it!=points.end(); it++) {
|
||||
btPoints[i] = LVecBase3f_to_btVector3(*it);
|
||||
btPoints[i] = LVecBase3_to_btVector3(*it);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
|
@ -60,27 +60,27 @@ ptr() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
BulletConvexPointCloudShape::
|
||||
BulletConvexPointCloudShape(const Geom *geom, LVecBase3f scale) {
|
||||
BulletConvexPointCloudShape(const Geom *geom, LVecBase3 scale) {
|
||||
|
||||
btVector3 btScale = LVecBase3f_to_btVector3(scale);
|
||||
btVector3 btScale = LVecBase3_to_btVector3(scale);
|
||||
|
||||
// Collect points
|
||||
pvector<LPoint3f> points;
|
||||
pvector<LPoint3> points;
|
||||
|
||||
CPT(GeomVertexData) vdata = geom->get_vertex_data();
|
||||
GeomVertexReader reader = GeomVertexReader(vdata, InternalName::get_vertex());
|
||||
|
||||
while (!reader.is_at_end()) {
|
||||
points.push_back(reader.get_data3f());
|
||||
points.push_back(reader.get_data3());
|
||||
}
|
||||
|
||||
// Convert points
|
||||
btVector3 *btPoints = new btVector3[points.size()];
|
||||
|
||||
int i = 0;
|
||||
pvector<LPoint3f>::const_iterator it;
|
||||
pvector<LPoint3>::const_iterator it;
|
||||
for (it=points.begin(); it!=points.end(); it++) {
|
||||
btPoints[i] = LVecBase3f_to_btVector3(*it);
|
||||
btPoints[i] = LVecBase3_to_btVector3(*it);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@
|
|||
class EXPCL_PANDABULLET BulletConvexPointCloudShape : public BulletShape {
|
||||
|
||||
PUBLISHED:
|
||||
BulletConvexPointCloudShape(const PTA_LVecBase3f &points, LVecBase3f scale=LVecBase3f(1.));
|
||||
BulletConvexPointCloudShape(const Geom *geom, LVecBase3f scale=LVecBase3f(1.));
|
||||
BulletConvexPointCloudShape(const PTA_LVecBase3 &points, LVecBase3 scale=LVecBase3(1.));
|
||||
BulletConvexPointCloudShape(const Geom *geom, LVecBase3 scale=LVecBase3(1.));
|
||||
INLINE ~BulletConvexPointCloudShape();
|
||||
|
||||
INLINE int get_num_points() const;
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ INLINE BulletCylinderShape::
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletCylinderShape::
|
||||
INLINE PN_stdfloat BulletCylinderShape::
|
||||
get_radius() const {
|
||||
|
||||
return _shape->getRadius();
|
||||
return (PN_stdfloat)_shape->getRadius();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -39,10 +39,10 @@ get_radius() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE LVecBase3f BulletCylinderShape::
|
||||
INLINE LVecBase3 BulletCylinderShape::
|
||||
get_half_extents_without_marging() const {
|
||||
|
||||
return btVector3_to_LVecBase3f(_shape->getHalfExtentsWithoutMargin());
|
||||
return btVector3_to_LVecBase3(_shape->getHalfExtentsWithoutMargin());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -50,9 +50,9 @@ get_half_extents_without_marging() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE LVecBase3f BulletCylinderShape::
|
||||
INLINE LVecBase3 BulletCylinderShape::
|
||||
get_half_extents_with_marging() const {
|
||||
|
||||
return btVector3_to_LVecBase3f(_shape->getHalfExtentsWithMargin());
|
||||
return btVector3_to_LVecBase3(_shape->getHalfExtentsWithMargin());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ TypeHandle BulletCylinderShape::_type_handle;
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
BulletCylinderShape::
|
||||
BulletCylinderShape(const LVector3f &half_extents, BulletUpAxis up) {
|
||||
BulletCylinderShape(const LVector3 &half_extents, BulletUpAxis up) {
|
||||
|
||||
btVector3 btHalfExtents = LVecBase3f_to_btVector3(half_extents);
|
||||
btVector3 btHalfExtents = LVecBase3_to_btVector3(half_extents);
|
||||
|
||||
switch (up) {
|
||||
case X_up:
|
||||
|
|
@ -50,7 +50,7 @@ BulletCylinderShape(const LVector3f &half_extents, BulletUpAxis up) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
BulletCylinderShape::
|
||||
BulletCylinderShape(float radius, float height, BulletUpAxis up) {
|
||||
BulletCylinderShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up) {
|
||||
|
||||
switch (up) {
|
||||
case X_up:
|
||||
|
|
|
|||
|
|
@ -28,13 +28,13 @@
|
|||
class EXPCL_PANDABULLET BulletCylinderShape : public BulletShape {
|
||||
|
||||
PUBLISHED:
|
||||
BulletCylinderShape(const LVector3f &half_extents, BulletUpAxis up=Z_up);
|
||||
BulletCylinderShape(float radius, float height, BulletUpAxis up=Z_up);
|
||||
BulletCylinderShape(const LVector3 &half_extents, BulletUpAxis up=Z_up);
|
||||
BulletCylinderShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up=Z_up);
|
||||
INLINE ~BulletCylinderShape();
|
||||
|
||||
INLINE float get_radius() const;
|
||||
INLINE LVecBase3f get_half_extents_without_marging() const;
|
||||
INLINE LVecBase3f get_half_extents_with_marging() const;
|
||||
INLINE PN_stdfloat get_radius() const;
|
||||
INLINE LVecBase3 get_half_extents_without_marging() const;
|
||||
INLINE LVecBase3 get_half_extents_with_marging() const;
|
||||
|
||||
public:
|
||||
virtual btCollisionShape *ptr() const;
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@ BulletDebugNode(const char *name) : GeomNode(name) {
|
|||
|
||||
// Draw something in oder to prevent getting optimized away
|
||||
GeomVertexWriter vwriter(_vdata, InternalName::get_vertex());
|
||||
vwriter.add_data3f(0.0, 0.0, 0.0);
|
||||
vwriter.add_data3f(0.0, 0.0, 0.0);
|
||||
vwriter.add_data3f(0.0, 0.0, 0.0);
|
||||
vwriter.add_data3(0.0, 0.0, 0.0);
|
||||
vwriter.add_data3(0.0, 0.0, 0.0);
|
||||
vwriter.add_data3(0.0, 0.0, 0.0);
|
||||
_prim_lines->add_next_vertices(2);
|
||||
_prim_lines->close_primitive();
|
||||
_prim_triangles->add_next_vertices(3);
|
||||
|
|
@ -208,7 +208,7 @@ sync_b2p(btDynamicsWorld *world) {
|
|||
|
||||
// Get inverse of this node's net transform
|
||||
NodePath np = NodePath::any_path((PandaNode *)this);
|
||||
LMatrix4f m = np.get_net_transform()->get_mat();
|
||||
LMatrix4 m = np.get_net_transform()->get_mat();
|
||||
m.invert_in_place();
|
||||
|
||||
// Render collected data
|
||||
|
|
@ -226,10 +226,10 @@ sync_b2p(btDynamicsWorld *world) {
|
|||
for (lit = _drawer._lines.begin(); lit != _drawer._lines.end(); lit++) {
|
||||
Line line = *lit;
|
||||
|
||||
vwriter.add_data3f(m.xform_point(line._p0));
|
||||
vwriter.add_data3f(m.xform_point(line._p1));
|
||||
cwriter.add_data4f(line._color);
|
||||
cwriter.add_data4f(line._color);
|
||||
vwriter.add_data3(m.xform_point(line._p0));
|
||||
vwriter.add_data3(m.xform_point(line._p1));
|
||||
cwriter.add_data4(line._color);
|
||||
cwriter.add_data4(line._color);
|
||||
|
||||
_prim_lines->add_vertex(v++);
|
||||
_prim_lines->add_vertex(v++);
|
||||
|
|
@ -239,12 +239,12 @@ sync_b2p(btDynamicsWorld *world) {
|
|||
for (tit = _drawer._triangles.begin(); tit != _drawer._triangles.end(); tit++) {
|
||||
Triangle tri = *tit;
|
||||
|
||||
vwriter.add_data3f(m.xform_point(tri._p0));
|
||||
vwriter.add_data3f(m.xform_point(tri._p1));
|
||||
vwriter.add_data3f(m.xform_point(tri._p2));
|
||||
cwriter.add_data4f(tri._color);
|
||||
cwriter.add_data4f(tri._color);
|
||||
cwriter.add_data4f(tri._color);
|
||||
vwriter.add_data3(m.xform_point(tri._p0));
|
||||
vwriter.add_data3(m.xform_point(tri._p1));
|
||||
vwriter.add_data3(m.xform_point(tri._p2));
|
||||
cwriter.add_data4(tri._color);
|
||||
cwriter.add_data4(tri._color);
|
||||
cwriter.add_data4(tri._color);
|
||||
|
||||
_prim_triangles->add_vertex(v++);
|
||||
_prim_triangles->add_vertex(v++);
|
||||
|
|
@ -301,9 +301,9 @@ reportErrorWarning(const char *warning) {
|
|||
void BulletDebugNode::DebugDraw::
|
||||
drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color) {
|
||||
|
||||
float r = color.getX();
|
||||
float g = color.getY();
|
||||
float b = color.getZ();
|
||||
PN_stdfloat r = color.getX();
|
||||
PN_stdfloat g = color.getY();
|
||||
PN_stdfloat b = color.getZ();
|
||||
|
||||
// Hack to get rid of triangle normals. The hack is based on the
|
||||
// assumption that only normals are drawn in yellow.
|
||||
|
|
@ -311,9 +311,9 @@ drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color) {
|
|||
|
||||
Line line;
|
||||
|
||||
line._p0 = LVecBase3f(from.getX(), from.getY(), from.getZ());
|
||||
line._p1 = LVecBase3f(to.getX(), to.getY(), to.getZ());
|
||||
line._color = LColorf(r, g, b, 1.0f);
|
||||
line._p0 = LVecBase3(from.getX(), from.getY(), from.getZ());
|
||||
line._p1 = LVecBase3(to.getX(), to.getY(), to.getZ());
|
||||
line._color = LColor(r, g, b, 1.0f);
|
||||
|
||||
_lines.push_back(line);
|
||||
}
|
||||
|
|
@ -326,16 +326,27 @@ drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color) {
|
|||
void BulletDebugNode::DebugDraw::
|
||||
drawTriangle(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2, const btVector3 &color, btScalar) {
|
||||
|
||||
float r = color.getX();
|
||||
float g = color.getY();
|
||||
float b = color.getZ();
|
||||
btScalar r = color.getX();
|
||||
btScalar g = color.getY();
|
||||
btScalar b = color.getZ();
|
||||
|
||||
Triangle tri;
|
||||
|
||||
tri._p0 = LVecBase3f(v0.getX(), v0.getY(), v0.getZ());
|
||||
tri._p1 = LVecBase3f(v1.getX(), v1.getY(), v1.getZ());
|
||||
tri._p2 = LVecBase3f(v2.getX(), v2.getY(), v2.getZ());
|
||||
tri._color = LColorf(r, g, b, 1.0f);
|
||||
tri._p0 = LVecBase3((PN_stdfloat)v0.getX(),
|
||||
(PN_stdfloat)v0.getY(),
|
||||
(PN_stdfloat)v0.getZ());
|
||||
|
||||
tri._p1 = LVecBase3((PN_stdfloat)v1.getX(),
|
||||
(PN_stdfloat)v1.getY(),
|
||||
(PN_stdfloat)v1.getZ());
|
||||
|
||||
tri._p2 = LVecBase3((PN_stdfloat)v2.getX(),
|
||||
(PN_stdfloat)v2.getY(),
|
||||
(PN_stdfloat)v2.getZ());
|
||||
|
||||
tri._color = LColor((PN_stdfloat)r,
|
||||
(PN_stdfloat)g,
|
||||
(PN_stdfloat)b, 1.0f);
|
||||
|
||||
_triangles.push_back(tri);
|
||||
|
||||
|
|
|
|||
|
|
@ -54,16 +54,16 @@ private:
|
|||
void sync_b2p(btDynamicsWorld *world);
|
||||
|
||||
struct Line {
|
||||
LVecBase3f _p0;
|
||||
LVecBase3f _p1;
|
||||
LColorf _color;
|
||||
LVecBase3 _p0;
|
||||
LVecBase3 _p1;
|
||||
LColor _color;
|
||||
};
|
||||
|
||||
struct Triangle {
|
||||
LVecBase3f _p0;
|
||||
LVecBase3f _p1;
|
||||
LVecBase3f _p2;
|
||||
LColorf _color;
|
||||
LVecBase3 _p0;
|
||||
LVecBase3 _p1;
|
||||
LVecBase3 _p2;
|
||||
LColor _color;
|
||||
};
|
||||
|
||||
class DebugDraw : public btIDebugDraw {
|
||||
|
|
|
|||
|
|
@ -70,14 +70,14 @@ ptr() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVector3f BulletGenericConstraint::
|
||||
LVector3 BulletGenericConstraint::
|
||||
get_axis(int axis) const {
|
||||
|
||||
nassertr(axis >= 0, LVector3f::zero());
|
||||
nassertr(axis <= 3, LVector3f::zero());
|
||||
nassertr(axis >= 0, LVector3::zero());
|
||||
nassertr(axis <= 3, LVector3::zero());
|
||||
|
||||
_constraint->buildJacobian();
|
||||
return btVector3_to_LVector3f(_constraint->getAxis(axis));
|
||||
return btVector3_to_LVector3(_constraint->getAxis(axis));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -85,7 +85,7 @@ get_axis(int axis) const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletGenericConstraint::
|
||||
PN_stdfloat BulletGenericConstraint::
|
||||
get_pivot(int axis) const {
|
||||
|
||||
nassertr(axis >= 0, 0.0f);
|
||||
|
|
@ -100,7 +100,7 @@ get_pivot(int axis) const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletGenericConstraint::
|
||||
PN_stdfloat BulletGenericConstraint::
|
||||
get_angle(int axis) const {
|
||||
|
||||
nassertr(axis >= 0, 0.0f);
|
||||
|
|
@ -116,7 +116,7 @@ get_angle(int axis) const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletGenericConstraint::
|
||||
set_linear_limit(int axis, float low, float high) {
|
||||
set_linear_limit(int axis, PN_stdfloat low, PN_stdfloat high) {
|
||||
|
||||
nassertv(axis >= 0);
|
||||
nassertv(axis <= 3);
|
||||
|
|
@ -131,7 +131,7 @@ set_linear_limit(int axis, float low, float high) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletGenericConstraint::
|
||||
set_angular_limit(int axis, float low, float high) {
|
||||
set_angular_limit(int axis, PN_stdfloat low, PN_stdfloat high) {
|
||||
|
||||
nassertv(axis >= 0);
|
||||
nassertv(axis <= 3);
|
||||
|
|
|
|||
|
|
@ -44,12 +44,12 @@ PUBLISHED:
|
|||
bool use_frame_a);
|
||||
INLINE ~BulletGenericConstraint();
|
||||
|
||||
void set_linear_limit(int axis, float low, float high);
|
||||
void set_angular_limit(int axis, float low, float high);
|
||||
void set_linear_limit(int axis, PN_stdfloat low, PN_stdfloat high);
|
||||
void set_angular_limit(int axis, PN_stdfloat low, PN_stdfloat high);
|
||||
|
||||
LVector3f get_axis(int axis) const;
|
||||
float get_pivot(int axis) const;
|
||||
float get_angle(int axis) const;
|
||||
LVector3 get_axis(int axis) const;
|
||||
PN_stdfloat get_pivot(int axis) const;
|
||||
PN_stdfloat get_angle(int axis) const;
|
||||
|
||||
public:
|
||||
virtual btTypedConstraint *ptr() const;
|
||||
|
|
|
|||
|
|
@ -92,8 +92,8 @@ transform_changed() {
|
|||
NodePath np = NodePath::any_path((PandaNode *)this);
|
||||
CPT(TransformState) ts = np.get_net_transform();
|
||||
|
||||
LMatrix4f m_sync = _sync->get_mat();
|
||||
LMatrix4f m_ts = ts->get_mat();
|
||||
LMatrix4 m_sync = _sync->get_mat();
|
||||
LMatrix4 m_ts = ts->get_mat();
|
||||
|
||||
if (!m_sync.almost_equal(m_ts)) {
|
||||
_sync = ts;
|
||||
|
|
@ -103,8 +103,8 @@ transform_changed() {
|
|||
_ghost->setInterpolationWorldTransform(trans);
|
||||
|
||||
if (ts->has_scale()) {
|
||||
LVecBase3f scale = ts->get_scale();
|
||||
if (!scale.almost_equal(LVecBase3f(1.0f, 1.0f, 1.0f))) {
|
||||
LVecBase3 scale = ts->get_scale();
|
||||
if (!scale.almost_equal(LVecBase3(1.0f, 1.0f, 1.0f))) {
|
||||
for (int i=0; i<get_num_shapes(); i++) {
|
||||
PT(BulletShape) shape = _shapes[i];
|
||||
shape->set_local_scale(scale);
|
||||
|
|
@ -134,13 +134,13 @@ void BulletGhostNode::
|
|||
sync_b2p() {
|
||||
|
||||
NodePath np = NodePath::any_path((PandaNode *)this);
|
||||
LVecBase3f scale = np.get_net_transform()->get_scale();
|
||||
LVecBase3 scale = np.get_net_transform()->get_scale();
|
||||
|
||||
btTransform trans = _ghost->getWorldTransform();
|
||||
CPT(TransformState) ts = btTrans_to_TransformState(trans, scale);
|
||||
|
||||
LMatrix4f m_sync = _sync->get_mat();
|
||||
LMatrix4f m_ts = ts->get_mat();
|
||||
LMatrix4 m_sync = _sync->get_mat();
|
||||
LMatrix4 m_ts = ts->get_mat();
|
||||
|
||||
if (!m_sync.almost_equal(m_ts)) {
|
||||
_sync = ts;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ TypeHandle BulletHeightfieldShape::_type_handle;
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
BulletHeightfieldShape::
|
||||
BulletHeightfieldShape(const PNMImage &image, float max_height, BulletUpAxis up) {
|
||||
BulletHeightfieldShape(const PNMImage &image, PN_stdfloat max_height, BulletUpAxis up) {
|
||||
|
||||
int num_rows = image.get_x_size();
|
||||
int num_columns = image.get_y_size();
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
class EXPCL_PANDABULLET BulletHeightfieldShape : public BulletShape {
|
||||
|
||||
PUBLISHED:
|
||||
BulletHeightfieldShape(const PNMImage &image, float max_height, BulletUpAxis up=Z_up);
|
||||
BulletHeightfieldShape(const PNMImage &image, PN_stdfloat max_height, BulletUpAxis up=Z_up);
|
||||
INLINE ~BulletHeightfieldShape();
|
||||
|
||||
void set_use_diamond_subdivision(bool flag=true);
|
||||
|
|
|
|||
|
|
@ -213,8 +213,8 @@ make_geom(BulletSoftBodyNode *node, const GeomVertexFormat *format, bool two_sid
|
|||
|
||||
v = trans.invXform(v);
|
||||
|
||||
vwriter.add_data3f(v.getX(), v.getY(), v.getZ());
|
||||
nwriter.add_data3f(n.getX(), n.getY(), n.getZ());
|
||||
vwriter.add_data3((PN_stdfloat)v.getX(), (PN_stdfloat)v.getY(), (PN_stdfloat)v.getZ());
|
||||
nwriter.add_data3((PN_stdfloat)n.getX(), (PN_stdfloat)n.getY(), (PN_stdfloat)n.getZ());
|
||||
fwriter.add_data1i(0);
|
||||
}
|
||||
|
||||
|
|
@ -223,8 +223,8 @@ make_geom(BulletSoftBodyNode *node, const GeomVertexFormat *format, bool two_sid
|
|||
btVector3 &v = nodes[j].m_x;
|
||||
btVector3 &n = nodes[j].m_n;
|
||||
|
||||
vwriter.add_data3f(v.getX(), v.getY(), v.getZ());
|
||||
nwriter.add_data3f(n.getX(), n.getY(), n.getZ());
|
||||
vwriter.add_data3((PN_stdfloat)v.getX(), (PN_stdfloat)v.getY(), (PN_stdfloat)v.getZ());
|
||||
nwriter.add_data3((PN_stdfloat)n.getX(), (PN_stdfloat)n.getY(), (PN_stdfloat)n.getZ());
|
||||
fwriter.add_data1i(1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,13 +29,13 @@ TypeHandle BulletHingeConstraint::_type_handle;
|
|||
////////////////////////////////////////////////////////////////////
|
||||
BulletHingeConstraint::
|
||||
BulletHingeConstraint(const BulletRigidBodyNode *node_a,
|
||||
const LPoint3f &pivot_a,
|
||||
const LVector3f &axis_a,
|
||||
const LPoint3 &pivot_a,
|
||||
const LVector3 &axis_a,
|
||||
bool use_frame_a) {
|
||||
|
||||
btRigidBody *ptr_a = btRigidBody::upcast(node_a->get_object());
|
||||
btVector3 pos_a = LVecBase3f_to_btVector3(pivot_a);
|
||||
btVector3 vec_a = LVecBase3f_to_btVector3(axis_a);
|
||||
btVector3 pos_a = LVecBase3_to_btVector3(pivot_a);
|
||||
btVector3 vec_a = LVecBase3_to_btVector3(axis_a);
|
||||
|
||||
_constraint = new btHingeConstraint(*ptr_a, pos_a, vec_a, use_frame_a);
|
||||
}
|
||||
|
|
@ -54,19 +54,19 @@ BulletHingeConstraint(const BulletRigidBodyNode *node_a,
|
|||
BulletHingeConstraint::
|
||||
BulletHingeConstraint(const BulletRigidBodyNode *node_a,
|
||||
const BulletRigidBodyNode *node_b,
|
||||
const LPoint3f &pivot_a,
|
||||
const LPoint3f &pivot_b,
|
||||
const LVector3f &axis_a,
|
||||
const LVector3f &axis_b,
|
||||
const LPoint3 &pivot_a,
|
||||
const LPoint3 &pivot_b,
|
||||
const LVector3 &axis_a,
|
||||
const LVector3 &axis_b,
|
||||
bool use_frame_a) {
|
||||
|
||||
btRigidBody *ptr_a = btRigidBody::upcast(node_a->get_object());
|
||||
btVector3 pos_a = LVecBase3f_to_btVector3(pivot_a);
|
||||
btVector3 vec_a = LVecBase3f_to_btVector3(axis_a);
|
||||
btVector3 pos_a = LVecBase3_to_btVector3(pivot_a);
|
||||
btVector3 vec_a = LVecBase3_to_btVector3(axis_a);
|
||||
|
||||
btRigidBody *ptr_b = btRigidBody::upcast(node_b->get_object());
|
||||
btVector3 pos_b = LVecBase3f_to_btVector3(pivot_b);
|
||||
btVector3 vec_b = LVecBase3f_to_btVector3(axis_b);
|
||||
btVector3 pos_b = LVecBase3_to_btVector3(pivot_b);
|
||||
btVector3 vec_b = LVecBase3_to_btVector3(axis_b);
|
||||
|
||||
_constraint = new btHingeConstraint(*ptr_a, *ptr_b, pos_a, pos_b, vec_a, vec_b, use_frame_a);
|
||||
}
|
||||
|
|
@ -111,7 +111,7 @@ get_angular_only() const {
|
|||
// degrees.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletHingeConstraint::
|
||||
set_limit(float low, float high, float softness, float bias, float relaxation) {
|
||||
set_limit(PN_stdfloat low, PN_stdfloat high, PN_stdfloat softness, PN_stdfloat bias, PN_stdfloat relaxation) {
|
||||
|
||||
low = deg_2_rad(low);
|
||||
high = deg_2_rad(high);
|
||||
|
|
@ -126,11 +126,11 @@ set_limit(float low, float high, float softness, float bias, float relaxation) {
|
|||
// coordinates.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletHingeConstraint::
|
||||
set_axis(const LVector3f &axis) {
|
||||
set_axis(const LVector3 &axis) {
|
||||
|
||||
nassertv(!axis.is_nan());
|
||||
|
||||
btVector3 v = LVecBase3f_to_btVector3(axis);
|
||||
btVector3 v = LVecBase3_to_btVector3(axis);
|
||||
_constraint->setAxis(v);
|
||||
}
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ set_axis(const LVector3f &axis) {
|
|||
// Access: Published
|
||||
// Description: Returns the lower angular limit in degrees.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletHingeConstraint::
|
||||
PN_stdfloat BulletHingeConstraint::
|
||||
get_lower_limit() const {
|
||||
|
||||
return rad_2_deg(_constraint->getLowerLimit());
|
||||
|
|
@ -150,7 +150,7 @@ get_lower_limit() const {
|
|||
// Access: Published
|
||||
// Description: Returns the upper angular limit in degrees.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletHingeConstraint::
|
||||
PN_stdfloat BulletHingeConstraint::
|
||||
get_upper_limit() const {
|
||||
|
||||
return rad_2_deg(_constraint->getUpperLimit());
|
||||
|
|
@ -162,7 +162,7 @@ get_upper_limit() const {
|
|||
// Description: Returns the angle between node_a and node_b in
|
||||
// degrees.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletHingeConstraint::
|
||||
PN_stdfloat BulletHingeConstraint::
|
||||
get_hinge_angle() {
|
||||
|
||||
return rad_2_deg(_constraint->getHingeAngle());
|
||||
|
|
@ -178,7 +178,7 @@ get_hinge_angle() {
|
|||
// velocity.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletHingeConstraint::
|
||||
enable_angular_motor(bool enable, float target_velocity, float max_impulse) {
|
||||
enable_angular_motor(bool enable, PN_stdfloat target_velocity, PN_stdfloat max_impulse) {
|
||||
|
||||
_constraint->enableAngularMotor(enable, target_velocity, max_impulse);
|
||||
}
|
||||
|
|
@ -201,7 +201,7 @@ enable_motor(bool enable) {
|
|||
// velocity set in enable_angular_motor.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletHingeConstraint::
|
||||
set_max_motor_impulse(float max_impulse) {
|
||||
set_max_motor_impulse(PN_stdfloat max_impulse) {
|
||||
|
||||
_constraint->setMaxMotorImpulse(max_impulse);
|
||||
}
|
||||
|
|
@ -212,9 +212,9 @@ set_max_motor_impulse(float max_impulse) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletHingeConstraint::
|
||||
set_motor_target(const LQuaternionf &quat, float dt) {
|
||||
set_motor_target(const LQuaternion &quat, PN_stdfloat dt) {
|
||||
|
||||
_constraint->setMotorTarget(LQuaternionf_to_btQuat(quat), dt);
|
||||
_constraint->setMotorTarget(LQuaternion_to_btQuat(quat), dt);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -223,7 +223,7 @@ set_motor_target(const LQuaternionf &quat, float dt) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletHingeConstraint::
|
||||
set_motor_target(float target_angle, float dt) {
|
||||
set_motor_target(PN_stdfloat target_angle, PN_stdfloat dt) {
|
||||
|
||||
_constraint->setMotorTarget(target_angle, dt);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,32 +37,32 @@ class EXPCL_PANDABULLET BulletHingeConstraint : public BulletConstraint {
|
|||
|
||||
PUBLISHED:
|
||||
BulletHingeConstraint(const BulletRigidBodyNode *node_a,
|
||||
const LPoint3f &pivot_a,
|
||||
const LVector3f &axis_a,
|
||||
const LPoint3 &pivot_a,
|
||||
const LVector3 &axis_a,
|
||||
bool use_frame_a=false);
|
||||
BulletHingeConstraint(const BulletRigidBodyNode *node_a,
|
||||
const BulletRigidBodyNode *node_b,
|
||||
const LPoint3f &pivot_a,
|
||||
const LPoint3f &pivot_b,
|
||||
const LVector3f &axis_a,
|
||||
const LVector3f &axis_b,
|
||||
const LPoint3 &pivot_a,
|
||||
const LPoint3 &pivot_b,
|
||||
const LVector3 &axis_a,
|
||||
const LVector3 &axis_b,
|
||||
bool use_frame_a=false);
|
||||
INLINE ~BulletHingeConstraint();
|
||||
|
||||
float get_hinge_angle();
|
||||
float get_lower_limit() const;
|
||||
float get_upper_limit() const;
|
||||
PN_stdfloat get_hinge_angle();
|
||||
PN_stdfloat get_lower_limit() const;
|
||||
PN_stdfloat get_upper_limit() const;
|
||||
bool get_angular_only() const;
|
||||
|
||||
void set_angular_only(bool value);
|
||||
void set_limit(float low, float high, float softness=0.9f, float bias=0.3f, float relaxation=1.0f);
|
||||
void set_axis(const LVector3f &axis);
|
||||
void set_limit(PN_stdfloat low, PN_stdfloat high, PN_stdfloat softness=0.9f, PN_stdfloat bias=0.3f, PN_stdfloat relaxation=1.0f);
|
||||
void set_axis(const LVector3 &axis);
|
||||
|
||||
void enable_angular_motor(bool enable, float target_velocity, float max_impulse);
|
||||
void enable_angular_motor(bool enable, PN_stdfloat target_velocity, PN_stdfloat max_impulse);
|
||||
void enable_motor(bool enable);
|
||||
void set_max_motor_impulse(float max_impulse);
|
||||
void set_motor_target(const LQuaternionf &quat, float dt);
|
||||
void set_motor_target(float target_angle, float dt);
|
||||
void set_max_motor_impulse(PN_stdfloat max_impulse);
|
||||
void set_motor_target(const LQuaternion &quat, PN_stdfloat dt);
|
||||
void set_motor_target(PN_stdfloat target_angle, PN_stdfloat dt);
|
||||
|
||||
public:
|
||||
virtual btTypedConstraint *ptr() const;
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@ get_lift_time() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletManifoldPoint::
|
||||
PN_stdfloat BulletManifoldPoint::
|
||||
get_distance() const {
|
||||
|
||||
return _pt.getDistance();
|
||||
return (PN_stdfloat)_pt.getDistance();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -51,10 +51,10 @@ get_distance() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletManifoldPoint::
|
||||
PN_stdfloat BulletManifoldPoint::
|
||||
get_applied_impulse() const {
|
||||
|
||||
return _pt.getAppliedImpulse();
|
||||
return (PN_stdfloat)_pt.getAppliedImpulse();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -62,10 +62,10 @@ get_applied_impulse() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletManifoldPoint::
|
||||
LPoint3 BulletManifoldPoint::
|
||||
get_position_world_on_a() const {
|
||||
|
||||
return btVector3_to_LPoint3f(_pt.getPositionWorldOnA());
|
||||
return btVector3_to_LPoint3(_pt.getPositionWorldOnA());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -73,10 +73,10 @@ get_position_world_on_a() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletManifoldPoint::
|
||||
LPoint3 BulletManifoldPoint::
|
||||
get_position_world_on_b() const {
|
||||
|
||||
return btVector3_to_LPoint3f(_pt.getPositionWorldOnB());
|
||||
return btVector3_to_LPoint3(_pt.getPositionWorldOnB());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -84,10 +84,10 @@ get_position_world_on_b() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletManifoldPoint::
|
||||
LPoint3 BulletManifoldPoint::
|
||||
get_local_point_a() const {
|
||||
|
||||
return btVector3_to_LPoint3f(_pt.m_localPointA);
|
||||
return btVector3_to_LPoint3(_pt.m_localPointA);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -95,9 +95,9 @@ get_local_point_a() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletManifoldPoint::
|
||||
LPoint3 BulletManifoldPoint::
|
||||
get_local_point_b() const {
|
||||
|
||||
return btVector3_to_LPoint3f(_pt.m_localPointB);
|
||||
return btVector3_to_LPoint3(_pt.m_localPointB);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,12 +32,12 @@ PUBLISHED:
|
|||
INLINE ~BulletManifoldPoint();
|
||||
|
||||
int get_lift_time() const;
|
||||
float get_distance() const;
|
||||
float get_applied_impulse() const;
|
||||
LPoint3f get_position_world_on_a() const;
|
||||
LPoint3f get_position_world_on_b() const;
|
||||
LPoint3f get_local_point_a() const;
|
||||
LPoint3f get_local_point_b() const;
|
||||
PN_stdfloat get_distance() const;
|
||||
PN_stdfloat get_applied_impulse() const;
|
||||
LPoint3 get_position_world_on_a() const;
|
||||
LPoint3 get_position_world_on_b() const;
|
||||
LPoint3 get_local_point_a() const;
|
||||
LPoint3 get_local_point_b() const;
|
||||
|
||||
public:
|
||||
BulletManifoldPoint(btManifoldPoint &pt);
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ BulletPersistentManifold(btPersistentManifold *manifold) : _manifold(manifold) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletPersistentManifold::
|
||||
PN_stdfloat BulletPersistentManifold::
|
||||
get_contact_breaking_threshold() const {
|
||||
|
||||
return _manifold->getContactBreakingThreshold();
|
||||
return (PN_stdfloat)_manifold->getContactBreakingThreshold();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -41,10 +41,10 @@ get_contact_breaking_threshold() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletPersistentManifold::
|
||||
PN_stdfloat BulletPersistentManifold::
|
||||
get_contact_processing_threshold() const {
|
||||
|
||||
return _manifold->getContactProcessingThreshold();
|
||||
return (PN_stdfloat)_manifold->getContactProcessingThreshold();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ PUBLISHED:
|
|||
BulletManifoldPoint *get_manifold_point(int idx) const;
|
||||
MAKE_SEQ(get_manifold_points, get_num_manifold_points, get_manifold_point);
|
||||
|
||||
float get_contact_breaking_threshold() const;
|
||||
float get_contact_processing_threshold() const;
|
||||
PN_stdfloat get_contact_breaking_threshold() const;
|
||||
PN_stdfloat get_contact_processing_threshold() const;
|
||||
|
||||
void clear_manifold();
|
||||
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ INLINE BulletPlaneShape::
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletPlaneShape::
|
||||
INLINE PN_stdfloat BulletPlaneShape::
|
||||
get_plane_constant() const {
|
||||
|
||||
return _shape->getPlaneConstant();
|
||||
return (PN_stdfloat)_shape->getPlaneConstant();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -39,9 +39,9 @@ get_plane_constant() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE LVector3f BulletPlaneShape::
|
||||
INLINE LVector3 BulletPlaneShape::
|
||||
get_plane_normal() const {
|
||||
|
||||
return btVector3_to_LVector3f(_shape->getPlaneNormal());
|
||||
return btVector3_to_LVector3(_shape->getPlaneNormal());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ TypeHandle BulletPlaneShape::_type_handle;
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
BulletPlaneShape::
|
||||
BulletPlaneShape(const LVector3f &normal, float constant) {
|
||||
BulletPlaneShape(const LVector3 &normal, PN_stdfloat constant) {
|
||||
|
||||
btVector3 btNormal = LVecBase3f_to_btVector3(normal);
|
||||
btVector3 btNormal = LVecBase3_to_btVector3(normal);
|
||||
|
||||
_shape = new btStaticPlaneShape(btNormal, constant);
|
||||
_shape->setUserPointer(this);
|
||||
|
|
@ -49,8 +49,8 @@ ptr() const {
|
|||
BulletPlaneShape *BulletPlaneShape::
|
||||
make_from_solid(const CollisionPlane *solid) {
|
||||
|
||||
LVector3f normal = solid->get_normal();
|
||||
float constant = solid->dist_to_plane(LPoint3f(0, 0, 0));
|
||||
LVector3 normal = solid->get_normal();
|
||||
PN_stdfloat constant = solid->dist_to_plane(LPoint3(0, 0, 0));
|
||||
|
||||
return new BulletPlaneShape(normal, constant);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@
|
|||
class EXPCL_PANDABULLET BulletPlaneShape : public BulletShape {
|
||||
|
||||
PUBLISHED:
|
||||
BulletPlaneShape(const LVector3f &normal, float constant);
|
||||
BulletPlaneShape(const LVector3 &normal, PN_stdfloat constant);
|
||||
INLINE ~BulletPlaneShape();
|
||||
|
||||
INLINE LVector3f get_plane_normal() const;
|
||||
INLINE float get_plane_constant() const;
|
||||
INLINE LVector3 get_plane_normal() const;
|
||||
INLINE PN_stdfloat get_plane_constant() const;
|
||||
|
||||
static BulletPlaneShape *make_from_solid(const CollisionPlane *solid);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ INLINE BulletRigidBodyNode::
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletRigidBodyNode::
|
||||
set_linear_damping(float value) {
|
||||
set_linear_damping(PN_stdfloat value) {
|
||||
|
||||
_rigid->setDamping(value, _rigid->getAngularDamping());
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ set_linear_damping(float value) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletRigidBodyNode::
|
||||
set_angular_damping(float value) {
|
||||
set_angular_damping(PN_stdfloat value) {
|
||||
|
||||
_rigid->setDamping(_rigid->getLinearDamping(), value);
|
||||
}
|
||||
|
|
@ -52,10 +52,10 @@ set_angular_damping(float value) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletRigidBodyNode::
|
||||
INLINE PN_stdfloat BulletRigidBodyNode::
|
||||
get_linear_damping() const {
|
||||
|
||||
return _rigid->getLinearDamping();
|
||||
return (PN_stdfloat)_rigid->getLinearDamping();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -63,9 +63,9 @@ get_linear_damping() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletRigidBodyNode::
|
||||
INLINE PN_stdfloat BulletRigidBodyNode::
|
||||
get_angular_damping() const {
|
||||
|
||||
return _rigid->getAngularDamping();
|
||||
return (PN_stdfloat)_rigid->getAngularDamping();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ shape_changed() {
|
|||
// zero can be considered an infinite mass.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletRigidBodyNode::
|
||||
set_mass(float mass) {
|
||||
set_mass(PN_stdfloat mass) {
|
||||
|
||||
btScalar bt_mass = mass;
|
||||
btVector3 bt_inertia(0.0, 0.0, 0.0);
|
||||
|
|
@ -119,7 +119,7 @@ set_mass(float mass) {
|
|||
// A value of zero means that the body is staic, i.e.
|
||||
// has an infinite mass.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletRigidBodyNode::
|
||||
PN_stdfloat BulletRigidBodyNode::
|
||||
get_mass() const {
|
||||
|
||||
btScalar inv_mass = _rigid->getInvMass();
|
||||
|
|
@ -145,7 +145,7 @@ get_mass() const {
|
|||
// (c) the scale of the body changed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletRigidBodyNode::
|
||||
set_inertia(const LVecBase3f &inertia) {
|
||||
set_inertia(const LVecBase3 &inertia) {
|
||||
|
||||
btVector3 inv_inertia(
|
||||
inertia.get_x() == 0.0 ? btScalar(0.0) : btScalar(1.0 / inertia.get_x()),
|
||||
|
|
@ -165,11 +165,11 @@ set_inertia(const LVecBase3f &inertia) {
|
|||
// value of zero means infinite inertia along this
|
||||
// direction.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVector3f BulletRigidBodyNode::
|
||||
LVector3 BulletRigidBodyNode::
|
||||
get_inertia() const {
|
||||
|
||||
btVector3 inv_inertia = _rigid->getInvInertiaDiagLocal();
|
||||
LVector3f inertia(
|
||||
LVector3 inertia(
|
||||
inv_inertia.x() == btScalar(0.0) ? 0.0 : 1.0 / inv_inertia.x(),
|
||||
inv_inertia.y() == btScalar(0.0) ? 0.0 : 1.0 / inv_inertia.y(),
|
||||
inv_inertia.z() == btScalar(0.0) ? 0.0 : 1.0 / inv_inertia.z()
|
||||
|
|
@ -184,13 +184,13 @@ get_inertia() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletRigidBodyNode::
|
||||
apply_force(const LVector3f &force, const LPoint3f &pos) {
|
||||
apply_force(const LVector3 &force, const LPoint3 &pos) {
|
||||
|
||||
nassertv_always(!force.is_nan());
|
||||
nassertv_always(!pos.is_nan());
|
||||
|
||||
_rigid->applyForce(LVecBase3f_to_btVector3(force),
|
||||
LVecBase3f_to_btVector3(pos));
|
||||
_rigid->applyForce(LVecBase3_to_btVector3(force),
|
||||
LVecBase3_to_btVector3(pos));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -199,11 +199,11 @@ apply_force(const LVector3f &force, const LPoint3f &pos) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletRigidBodyNode::
|
||||
apply_central_force(const LVector3f &force) {
|
||||
apply_central_force(const LVector3 &force) {
|
||||
|
||||
nassertv_always(!force.is_nan());
|
||||
|
||||
_rigid->applyCentralForce(LVecBase3f_to_btVector3(force));
|
||||
_rigid->applyCentralForce(LVecBase3_to_btVector3(force));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -212,11 +212,11 @@ apply_central_force(const LVector3f &force) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletRigidBodyNode::
|
||||
apply_torque(const LVector3f &torque) {
|
||||
apply_torque(const LVector3 &torque) {
|
||||
|
||||
nassertv_always(!torque.is_nan());
|
||||
|
||||
_rigid->applyTorque(LVecBase3f_to_btVector3(torque));
|
||||
_rigid->applyTorque(LVecBase3_to_btVector3(torque));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -225,11 +225,11 @@ apply_torque(const LVector3f &torque) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletRigidBodyNode::
|
||||
apply_torque_impulse(const LVector3f &torque) {
|
||||
apply_torque_impulse(const LVector3 &torque) {
|
||||
|
||||
nassertv_always(!torque.is_nan());
|
||||
|
||||
_rigid->applyTorqueImpulse(LVecBase3f_to_btVector3(torque));
|
||||
_rigid->applyTorqueImpulse(LVecBase3_to_btVector3(torque));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -238,13 +238,13 @@ apply_torque_impulse(const LVector3f &torque) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletRigidBodyNode::
|
||||
apply_impulse(const LVector3f &impulse, const LPoint3f &pos) {
|
||||
apply_impulse(const LVector3 &impulse, const LPoint3 &pos) {
|
||||
|
||||
nassertv_always(!impulse.is_nan());
|
||||
nassertv_always(!pos.is_nan());
|
||||
|
||||
_rigid->applyImpulse(LVecBase3f_to_btVector3(impulse),
|
||||
LVecBase3f_to_btVector3(pos));
|
||||
_rigid->applyImpulse(LVecBase3_to_btVector3(impulse),
|
||||
LVecBase3_to_btVector3(pos));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -253,11 +253,11 @@ apply_impulse(const LVector3f &impulse, const LPoint3f &pos) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletRigidBodyNode::
|
||||
apply_central_impulse(const LVector3f &impulse) {
|
||||
apply_central_impulse(const LVector3 &impulse) {
|
||||
|
||||
nassertv_always(!impulse.is_nan());
|
||||
|
||||
_rigid->applyCentralImpulse(LVecBase3f_to_btVector3(impulse));
|
||||
_rigid->applyCentralImpulse(LVecBase3_to_btVector3(impulse));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -273,8 +273,8 @@ transform_changed() {
|
|||
NodePath np = NodePath::any_path((PandaNode *)this);
|
||||
CPT(TransformState) ts = np.get_net_transform();
|
||||
|
||||
LMatrix4f m_sync = _sync->get_mat();
|
||||
LMatrix4f m_ts = ts->get_mat();
|
||||
LMatrix4 m_sync = _sync->get_mat();
|
||||
LMatrix4 m_ts = ts->get_mat();
|
||||
|
||||
if (!m_sync.almost_equal(m_ts)) {
|
||||
_sync = ts;
|
||||
|
|
@ -283,8 +283,8 @@ transform_changed() {
|
|||
_rigid->setCenterOfMassTransform(trans);
|
||||
|
||||
if (ts->has_scale()) {
|
||||
LVecBase3f scale = ts->get_scale();
|
||||
if (!scale.almost_equal(LVecBase3f(1.0f, 1.0f, 1.0f))) {
|
||||
LVecBase3 scale = ts->get_scale();
|
||||
if (!scale.almost_equal(LVecBase3(1.0f, 1.0f, 1.0f))) {
|
||||
for (int i=0; i<get_num_shapes(); i++) {
|
||||
PT(BulletShape) shape = _shapes[i];
|
||||
shape->set_local_scale(scale);
|
||||
|
|
@ -321,13 +321,13 @@ void BulletRigidBodyNode::
|
|||
sync_b2p() {
|
||||
|
||||
NodePath np = NodePath::any_path((PandaNode *)this);
|
||||
LVecBase3f scale = np.get_net_transform()->get_scale();
|
||||
LVecBase3 scale = np.get_net_transform()->get_scale();
|
||||
|
||||
btTransform trans = _rigid->getWorldTransform();
|
||||
CPT(TransformState) ts = btTrans_to_TransformState(trans, scale);
|
||||
|
||||
LMatrix4f m_sync = _sync->get_mat();
|
||||
LMatrix4f m_ts = ts->get_mat();
|
||||
LMatrix4 m_sync = _sync->get_mat();
|
||||
LMatrix4 m_ts = ts->get_mat();
|
||||
|
||||
if (!m_sync.almost_equal(m_ts)) {
|
||||
_sync = ts;
|
||||
|
|
@ -342,10 +342,10 @@ sync_b2p() {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVector3f BulletRigidBodyNode::
|
||||
LVector3 BulletRigidBodyNode::
|
||||
get_linear_velocity() const {
|
||||
|
||||
return btVector3_to_LVector3f(_rigid->getLinearVelocity());
|
||||
return btVector3_to_LVector3(_rigid->getLinearVelocity());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -353,10 +353,10 @@ get_linear_velocity() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVector3f BulletRigidBodyNode::
|
||||
LVector3 BulletRigidBodyNode::
|
||||
get_angular_velocity() const {
|
||||
|
||||
return btVector3_to_LVector3f(_rigid->getAngularVelocity());
|
||||
return btVector3_to_LVector3(_rigid->getAngularVelocity());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -365,11 +365,11 @@ get_angular_velocity() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletRigidBodyNode::
|
||||
set_linear_velocity(const LVector3f &velocity) {
|
||||
set_linear_velocity(const LVector3 &velocity) {
|
||||
|
||||
nassertv_always(!velocity.is_nan());
|
||||
|
||||
_rigid->setLinearVelocity(LVecBase3f_to_btVector3(velocity));
|
||||
_rigid->setLinearVelocity(LVecBase3_to_btVector3(velocity));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -378,11 +378,11 @@ set_linear_velocity(const LVector3f &velocity) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletRigidBodyNode::
|
||||
set_angular_velocity(const LVector3f &velocity) {
|
||||
set_angular_velocity(const LVector3 &velocity) {
|
||||
|
||||
nassertv_always(!velocity.is_nan());
|
||||
|
||||
_rigid->setAngularVelocity(LVecBase3f_to_btVector3(velocity));
|
||||
_rigid->setAngularVelocity(LVecBase3_to_btVector3(velocity));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -401,7 +401,7 @@ clear_forces() {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletRigidBodyNode::
|
||||
PN_stdfloat BulletRigidBodyNode::
|
||||
get_linear_sleep_threshold() const {
|
||||
|
||||
return _rigid->getLinearSleepingThreshold();
|
||||
|
|
@ -412,7 +412,7 @@ get_linear_sleep_threshold() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletRigidBodyNode::
|
||||
PN_stdfloat BulletRigidBodyNode::
|
||||
get_angular_sleep_threshold() const {
|
||||
|
||||
return _rigid->getAngularSleepingThreshold();
|
||||
|
|
@ -424,7 +424,7 @@ get_angular_sleep_threshold() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletRigidBodyNode::
|
||||
set_linear_sleep_threshold(float threshold) {
|
||||
set_linear_sleep_threshold(PN_stdfloat threshold) {
|
||||
|
||||
_rigid->setSleepingThresholds(_rigid->getLinearSleepingThreshold(), threshold);
|
||||
}
|
||||
|
|
@ -435,7 +435,7 @@ set_linear_sleep_threshold(float threshold) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletRigidBodyNode::
|
||||
set_angular_sleep_threshold(float threshold) {
|
||||
set_angular_sleep_threshold(PN_stdfloat threshold) {
|
||||
|
||||
_rigid->setSleepingThresholds(threshold, _rigid->getAngularSleepingThreshold());
|
||||
}
|
||||
|
|
@ -446,11 +446,11 @@ set_angular_sleep_threshold(float threshold) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletRigidBodyNode::
|
||||
set_gravity(const LVector3f &gravity) {
|
||||
set_gravity(const LVector3 &gravity) {
|
||||
|
||||
nassertv_always(!gravity.is_nan());
|
||||
|
||||
_rigid->setGravity(LVecBase3f_to_btVector3(gravity));
|
||||
_rigid->setGravity(LVecBase3_to_btVector3(gravity));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -458,10 +458,10 @@ set_gravity(const LVector3f &gravity) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVector3f BulletRigidBodyNode::
|
||||
LVector3 BulletRigidBodyNode::
|
||||
get_gravity() const {
|
||||
|
||||
return btVector3_to_LVector3f(_rigid->getGravity());
|
||||
return btVector3_to_LVector3(_rigid->getGravity());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -470,9 +470,9 @@ get_gravity() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletRigidBodyNode::
|
||||
set_linear_factor(const LVector3f &factor) {
|
||||
set_linear_factor(const LVector3 &factor) {
|
||||
|
||||
_rigid->setLinearFactor(LVecBase3f_to_btVector3(factor));
|
||||
_rigid->setLinearFactor(LVecBase3_to_btVector3(factor));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -481,9 +481,9 @@ set_linear_factor(const LVector3f &factor) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletRigidBodyNode::
|
||||
set_angular_factor(const LVector3f &factor) {
|
||||
set_angular_factor(const LVector3 &factor) {
|
||||
|
||||
_rigid->setAngularFactor(LVecBase3f_to_btVector3(factor));
|
||||
_rigid->setAngularFactor(LVecBase3_to_btVector3(factor));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -37,45 +37,45 @@ PUBLISHED:
|
|||
INLINE ~BulletRigidBodyNode();
|
||||
|
||||
// Mass & inertia
|
||||
void set_mass(float mass);
|
||||
float get_mass() const;
|
||||
void set_inertia(const LVecBase3f &inertia);
|
||||
LVector3f get_inertia() const;
|
||||
void set_mass(PN_stdfloat mass);
|
||||
PN_stdfloat get_mass() const;
|
||||
void set_inertia(const LVecBase3 &inertia);
|
||||
LVector3 get_inertia() const;
|
||||
|
||||
// Velocity
|
||||
LVector3f get_linear_velocity() const;
|
||||
LVector3f get_angular_velocity() const;
|
||||
void set_linear_velocity(const LVector3f &velocity);
|
||||
void set_angular_velocity(const LVector3f &velocity);
|
||||
LVector3 get_linear_velocity() const;
|
||||
LVector3 get_angular_velocity() const;
|
||||
void set_linear_velocity(const LVector3 &velocity);
|
||||
void set_angular_velocity(const LVector3 &velocity);
|
||||
|
||||
// Damping
|
||||
INLINE float get_linear_damping() const;
|
||||
INLINE float get_angular_damping() const;
|
||||
INLINE void set_linear_damping(float value);
|
||||
INLINE void set_angular_damping(float value);
|
||||
INLINE PN_stdfloat get_linear_damping() const;
|
||||
INLINE PN_stdfloat get_angular_damping() const;
|
||||
INLINE void set_linear_damping(PN_stdfloat value);
|
||||
INLINE void set_angular_damping(PN_stdfloat value);
|
||||
|
||||
// Forces
|
||||
void clear_forces();
|
||||
void apply_force(const LVector3f &force, const LPoint3f &pos);
|
||||
void apply_central_force(const LVector3f &force);
|
||||
void apply_impulse(const LVector3f &impulse, const LPoint3f &pos);
|
||||
void apply_central_impulse(const LVector3f &impulse);
|
||||
void apply_torque(const LVector3f &torque);
|
||||
void apply_torque_impulse(const LVector3f &torque);
|
||||
void apply_force(const LVector3 &force, const LPoint3 &pos);
|
||||
void apply_central_force(const LVector3 &force);
|
||||
void apply_impulse(const LVector3 &impulse, const LPoint3 &pos);
|
||||
void apply_central_impulse(const LVector3 &impulse);
|
||||
void apply_torque(const LVector3 &torque);
|
||||
void apply_torque_impulse(const LVector3 &torque);
|
||||
|
||||
// Deactivation thresholds
|
||||
float get_linear_sleep_threshold() const;
|
||||
float get_angular_sleep_threshold() const;
|
||||
void set_linear_sleep_threshold(float threshold);
|
||||
void set_angular_sleep_threshold(float threshold);
|
||||
PN_stdfloat get_linear_sleep_threshold() const;
|
||||
PN_stdfloat get_angular_sleep_threshold() const;
|
||||
void set_linear_sleep_threshold(PN_stdfloat threshold);
|
||||
void set_angular_sleep_threshold(PN_stdfloat threshold);
|
||||
|
||||
// Gravity
|
||||
void set_gravity(const LVector3f &gravity);
|
||||
LVector3f get_gravity() const;
|
||||
void set_gravity(const LVector3 &gravity);
|
||||
LVector3 get_gravity() const;
|
||||
|
||||
// Restrict movement
|
||||
void set_linear_factor(const LVector3f &factor);
|
||||
void set_angular_factor(const LVector3f &factor);
|
||||
void set_linear_factor(const LVector3 &factor);
|
||||
void set_angular_factor(const LVector3 &factor);
|
||||
|
||||
public:
|
||||
virtual btCollisionObject *get_object() const;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ get_name() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletShape::
|
||||
PN_stdfloat BulletShape::
|
||||
get_margin() const {
|
||||
|
||||
return ptr()->getMargin();
|
||||
|
|
@ -45,7 +45,7 @@ get_margin() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletShape::
|
||||
set_margin(float margin) {
|
||||
set_margin(PN_stdfloat margin) {
|
||||
|
||||
ptr()->setMargin(margin);
|
||||
}
|
||||
|
|
@ -55,10 +55,10 @@ set_margin(float margin) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVecBase3f BulletShape::
|
||||
LVecBase3 BulletShape::
|
||||
get_local_scale() const {
|
||||
|
||||
return btVector3_to_LVecBase3f(ptr()->getLocalScaling());
|
||||
return btVector3_to_LVecBase3(ptr()->getLocalScaling());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -67,9 +67,9 @@ get_local_scale() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletShape::
|
||||
set_local_scale(const LVecBase3f &scale) {
|
||||
set_local_scale(const LVecBase3 &scale) {
|
||||
|
||||
nassertv(!scale.is_nan());
|
||||
ptr()->setLocalScaling(LVecBase3f_to_btVector3(scale));
|
||||
ptr()->setLocalScaling(LVecBase3_to_btVector3(scale));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,16 +38,16 @@ PUBLISHED:
|
|||
INLINE bool is_non_moving() const;
|
||||
INLINE bool is_soft_body() const;
|
||||
|
||||
void set_margin(float margin);
|
||||
void set_margin(PN_stdfloat margin);
|
||||
const char *get_name() const;
|
||||
|
||||
float get_margin() const;
|
||||
PN_stdfloat get_margin() const;
|
||||
|
||||
public:
|
||||
virtual btCollisionShape *ptr() const = 0;
|
||||
|
||||
LVecBase3f get_local_scale() const;
|
||||
void set_local_scale(const LVecBase3f &scale);
|
||||
LVecBase3 get_local_scale() const;
|
||||
void set_local_scale(const LVecBase3 &scale);
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -72,10 +72,10 @@ ptr() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletSliderConstraint::
|
||||
PN_stdfloat BulletSliderConstraint::
|
||||
get_lower_linear_limit() const {
|
||||
|
||||
return _constraint->getLowerLinLimit();
|
||||
return (PN_stdfloat)_constraint->getLowerLinLimit();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -83,10 +83,10 @@ get_lower_linear_limit() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletSliderConstraint::
|
||||
PN_stdfloat BulletSliderConstraint::
|
||||
get_upper_linear_limit() const {
|
||||
|
||||
return _constraint->getUpperLinLimit();
|
||||
return (PN_stdfloat)_constraint->getUpperLinLimit();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -94,7 +94,7 @@ get_upper_linear_limit() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletSliderConstraint::
|
||||
PN_stdfloat BulletSliderConstraint::
|
||||
get_lower_angular_limit() const {
|
||||
|
||||
return rad_2_deg(_constraint->getLowerAngLimit());
|
||||
|
|
@ -105,7 +105,7 @@ get_lower_angular_limit() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletSliderConstraint::
|
||||
PN_stdfloat BulletSliderConstraint::
|
||||
get_upper_angular_limit() const {
|
||||
|
||||
return rad_2_deg(_constraint->getUpperAngLimit());
|
||||
|
|
@ -117,9 +117,9 @@ get_upper_angular_limit() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSliderConstraint::
|
||||
set_lower_linear_limit(float value) {
|
||||
set_lower_linear_limit(PN_stdfloat value) {
|
||||
|
||||
_constraint->setLowerLinLimit(value);
|
||||
_constraint->setLowerLinLimit((btScalar)value);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -128,9 +128,9 @@ set_lower_linear_limit(float value) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSliderConstraint::
|
||||
set_upper_linear_limit(float value) {
|
||||
set_upper_linear_limit(PN_stdfloat value) {
|
||||
|
||||
_constraint->setUpperLinLimit(value);
|
||||
_constraint->setUpperLinLimit((btScalar)value);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -139,9 +139,9 @@ set_upper_linear_limit(float value) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSliderConstraint::
|
||||
set_lower_angular_limit(float value) {
|
||||
set_lower_angular_limit(PN_stdfloat value) {
|
||||
|
||||
_constraint->setLowerAngLimit(deg_2_rad(value));
|
||||
_constraint->setLowerAngLimit((btScalar)deg_2_rad(value));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -150,9 +150,9 @@ set_lower_angular_limit(float value) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSliderConstraint::
|
||||
set_upper_angular_limit(float value) {
|
||||
set_upper_angular_limit(PN_stdfloat value) {
|
||||
|
||||
_constraint->setUpperAngLimit(deg_2_rad(value));
|
||||
_constraint->setUpperAngLimit((btScalar)deg_2_rad(value));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -160,10 +160,10 @@ set_upper_angular_limit(float value) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletSliderConstraint::
|
||||
PN_stdfloat BulletSliderConstraint::
|
||||
get_linear_pos() const {
|
||||
|
||||
return _constraint->getLinearPos();
|
||||
return (PN_stdfloat)_constraint->getLinearPos();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -171,10 +171,10 @@ get_linear_pos() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletSliderConstraint::
|
||||
PN_stdfloat BulletSliderConstraint::
|
||||
get_angular_pos() const {
|
||||
|
||||
return _constraint->getAngularPos();
|
||||
return (PN_stdfloat)_constraint->getAngularPos();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -194,9 +194,9 @@ set_powered_linear_motor(bool on) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSliderConstraint::
|
||||
set_target_linear_motor_velocity(float target_velocity) {
|
||||
set_target_linear_motor_velocity(PN_stdfloat target_velocity) {
|
||||
|
||||
_constraint->setTargetLinMotorVelocity(target_velocity);
|
||||
_constraint->setTargetLinMotorVelocity((btScalar)target_velocity);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -205,9 +205,9 @@ set_target_linear_motor_velocity(float target_velocity) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSliderConstraint::
|
||||
set_max_linear_motor_force(float max_force) {
|
||||
set_max_linear_motor_force(PN_stdfloat max_force) {
|
||||
|
||||
_constraint->setMaxLinMotorForce(max_force);
|
||||
_constraint->setMaxLinMotorForce((btScalar)max_force);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -226,10 +226,10 @@ get_powered_linear_motor() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletSliderConstraint::
|
||||
PN_stdfloat BulletSliderConstraint::
|
||||
get_target_linear_motor_velocity() const {
|
||||
|
||||
return _constraint->getTargetLinMotorVelocity();
|
||||
return (PN_stdfloat)_constraint->getTargetLinMotorVelocity();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -237,10 +237,10 @@ get_target_linear_motor_velocity() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletSliderConstraint::
|
||||
PN_stdfloat BulletSliderConstraint::
|
||||
get_max_linear_motor_force() const {
|
||||
|
||||
return _constraint->getMaxLinMotorForce();
|
||||
return (PN_stdfloat)_constraint->getMaxLinMotorForce();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -260,9 +260,9 @@ set_powered_angular_motor(bool on) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSliderConstraint::
|
||||
set_target_angular_motor_velocity(float target_velocity) {
|
||||
set_target_angular_motor_velocity(PN_stdfloat target_velocity) {
|
||||
|
||||
_constraint->setTargetAngMotorVelocity(target_velocity);
|
||||
_constraint->setTargetAngMotorVelocity((btScalar)target_velocity);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -271,9 +271,9 @@ set_target_angular_motor_velocity(float target_velocity) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSliderConstraint::
|
||||
set_max_angular_motor_force(float max_force) {
|
||||
set_max_angular_motor_force(PN_stdfloat max_force) {
|
||||
|
||||
_constraint->setMaxAngMotorForce(max_force);
|
||||
_constraint->setMaxAngMotorForce((btScalar)max_force);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -292,10 +292,10 @@ get_powered_angular_motor() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletSliderConstraint::
|
||||
PN_stdfloat BulletSliderConstraint::
|
||||
get_target_angular_motor_velocity() const {
|
||||
|
||||
return _constraint->getTargetAngMotorVelocity();
|
||||
return (PN_stdfloat)_constraint->getTargetAngMotorVelocity();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -303,9 +303,9 @@ get_target_angular_motor_velocity() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletSliderConstraint::
|
||||
PN_stdfloat BulletSliderConstraint::
|
||||
get_max_angular_motor_force() const {
|
||||
|
||||
return _constraint->getMaxAngMotorForce();
|
||||
return (PN_stdfloat)_constraint->getMaxAngMotorForce();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,34 +42,34 @@ PUBLISHED:
|
|||
bool use_frame_a);
|
||||
INLINE ~BulletSliderConstraint();
|
||||
|
||||
float get_linear_pos() const;
|
||||
float get_angular_pos() const;
|
||||
PN_stdfloat get_linear_pos() const;
|
||||
PN_stdfloat get_angular_pos() const;
|
||||
|
||||
// Limits
|
||||
float get_lower_linear_limit() const;
|
||||
float get_upper_linear_limit() const;
|
||||
float get_lower_angular_limit() const;
|
||||
float get_upper_angular_limit() const;
|
||||
void set_lower_linear_limit(float value);
|
||||
void set_upper_linear_limit(float value);
|
||||
void set_lower_angular_limit(float value);
|
||||
void set_upper_angular_limit(float value);
|
||||
PN_stdfloat get_lower_linear_limit() const;
|
||||
PN_stdfloat get_upper_linear_limit() const;
|
||||
PN_stdfloat get_lower_angular_limit() const;
|
||||
PN_stdfloat get_upper_angular_limit() const;
|
||||
void set_lower_linear_limit(PN_stdfloat value);
|
||||
void set_upper_linear_limit(PN_stdfloat value);
|
||||
void set_lower_angular_limit(PN_stdfloat value);
|
||||
void set_upper_angular_limit(PN_stdfloat value);
|
||||
|
||||
// Linear motor
|
||||
void set_powered_linear_motor(bool on);
|
||||
void set_target_linear_motor_velocity (float target_velocity);
|
||||
void set_max_linear_motor_force(float max_force);
|
||||
void set_target_linear_motor_velocity (PN_stdfloat target_velocity);
|
||||
void set_max_linear_motor_force(PN_stdfloat max_force);
|
||||
bool get_powered_linear_motor() const;
|
||||
float get_target_linear_motor_velocity() const;
|
||||
float get_max_linear_motor_force() const;
|
||||
PN_stdfloat get_target_linear_motor_velocity() const;
|
||||
PN_stdfloat get_max_linear_motor_force() const;
|
||||
|
||||
// Angular motor
|
||||
void set_powered_angular_motor(bool on);
|
||||
void set_target_angular_motor_velocity (float target_velocity);
|
||||
void set_max_angular_motor_force(float max_force);
|
||||
void set_target_angular_motor_velocity (PN_stdfloat target_velocity);
|
||||
void set_max_angular_motor_force(PN_stdfloat max_force);
|
||||
bool get_powered_angular_motor() const;
|
||||
float get_target_angular_motor_velocity() const;
|
||||
float get_max_angular_motor_force() const;
|
||||
PN_stdfloat get_target_angular_motor_velocity() const;
|
||||
PN_stdfloat get_max_angular_motor_force() const;
|
||||
|
||||
public:
|
||||
virtual btTypedConstraint *ptr() const;
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ INLINE BulletSoftBodyConfig::
|
|||
// Access: Published
|
||||
// Description: Getter for property kVCF.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_velocities_correction_factor() const {
|
||||
|
||||
return _cfg.kVCF;
|
||||
return (PN_stdfloat)_cfg.kVCF;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -39,9 +39,9 @@ get_velocities_correction_factor() const {
|
|||
// Description: Setter for property kVCF.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_velocities_correction_factor(float value) {
|
||||
set_velocities_correction_factor(PN_stdfloat value) {
|
||||
|
||||
_cfg.kVCF = value;
|
||||
_cfg.kVCF = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -49,10 +49,10 @@ set_velocities_correction_factor(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kDP.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_damping_coefficient() const {
|
||||
|
||||
return _cfg.kDP;
|
||||
return (PN_stdfloat)_cfg.kDP;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -61,9 +61,9 @@ get_damping_coefficient() const {
|
|||
// Description: Setter for property kDP.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_damping_coefficient(float value) {
|
||||
set_damping_coefficient(PN_stdfloat value) {
|
||||
|
||||
_cfg.kDP = value;
|
||||
_cfg.kDP = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -71,10 +71,10 @@ set_damping_coefficient(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kDG.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_drag_coefficient() const {
|
||||
|
||||
return _cfg.kDG;
|
||||
return (PN_stdfloat)_cfg.kDG;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -83,9 +83,9 @@ get_drag_coefficient() const {
|
|||
// Description: Setter for property kDG.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_drag_coefficient(float value) {
|
||||
set_drag_coefficient(PN_stdfloat value) {
|
||||
|
||||
_cfg.kDG = value;
|
||||
_cfg.kDG = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -93,10 +93,10 @@ set_drag_coefficient(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kLF.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_lift_coefficient() const {
|
||||
|
||||
return _cfg.kLF;
|
||||
return (PN_stdfloat)_cfg.kLF;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -105,9 +105,9 @@ get_lift_coefficient() const {
|
|||
// Description: Setter for property kLF.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_lift_coefficient(float value) {
|
||||
set_lift_coefficient(PN_stdfloat value) {
|
||||
|
||||
_cfg.kLF = value;
|
||||
_cfg.kLF = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -115,10 +115,10 @@ set_lift_coefficient(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kPR.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_pressure_coefficient() const {
|
||||
|
||||
return _cfg.kPR;
|
||||
return (PN_stdfloat)_cfg.kPR;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -127,9 +127,9 @@ get_pressure_coefficient() const {
|
|||
// Description: Setter for property kPR.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_pressure_coefficient(float value) {
|
||||
set_pressure_coefficient(PN_stdfloat value) {
|
||||
|
||||
_cfg.kPR = value;
|
||||
_cfg.kPR = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -137,10 +137,10 @@ set_pressure_coefficient(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kVC.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_volume_conversation_coefficient() const {
|
||||
|
||||
return _cfg.kVC;
|
||||
return (PN_stdfloat)_cfg.kVC;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -149,9 +149,9 @@ get_volume_conversation_coefficient() const {
|
|||
// Description: Setter for property kVC.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_volume_conversation_coefficient(float value) {
|
||||
set_volume_conversation_coefficient(PN_stdfloat value) {
|
||||
|
||||
_cfg.kVC = value;
|
||||
_cfg.kVC = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -159,10 +159,10 @@ set_volume_conversation_coefficient(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kDF.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_dynamic_friction_coefficient() const {
|
||||
|
||||
return _cfg.kDF;
|
||||
return (PN_stdfloat)_cfg.kDF;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -171,9 +171,9 @@ get_dynamic_friction_coefficient() const {
|
|||
// Description: Setter for property kDF.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_dynamic_friction_coefficient(float value) {
|
||||
set_dynamic_friction_coefficient(PN_stdfloat value) {
|
||||
|
||||
_cfg.kDF = value;
|
||||
_cfg.kDF = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -181,10 +181,10 @@ set_dynamic_friction_coefficient(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kMT.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_pose_matching_coefficient() const {
|
||||
|
||||
return _cfg.kMT;
|
||||
return (PN_stdfloat)_cfg.kMT;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -193,9 +193,9 @@ get_pose_matching_coefficient() const {
|
|||
// Description: Setter for property kMT.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_pose_matching_coefficient(float value) {
|
||||
set_pose_matching_coefficient(PN_stdfloat value) {
|
||||
|
||||
_cfg.kMT = value;
|
||||
_cfg.kMT = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -203,10 +203,10 @@ set_pose_matching_coefficient(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kCHR.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_rigid_contacts_hardness() const {
|
||||
|
||||
return _cfg.kCHR;
|
||||
return (PN_stdfloat)_cfg.kCHR;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -215,9 +215,9 @@ get_rigid_contacts_hardness() const {
|
|||
// Description: Setter for property kCHR.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_rigid_contacts_hardness(float value) {
|
||||
set_rigid_contacts_hardness(PN_stdfloat value) {
|
||||
|
||||
_cfg.kCHR = value;
|
||||
_cfg.kCHR = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -225,10 +225,10 @@ set_rigid_contacts_hardness(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kKHR.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_kinetic_contacts_hardness() const {
|
||||
|
||||
return _cfg.kKHR;
|
||||
return (PN_stdfloat)_cfg.kKHR;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -237,9 +237,9 @@ get_kinetic_contacts_hardness() const {
|
|||
// Description: Setter for property kKHR.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_kinetic_contacts_hardness(float value) {
|
||||
set_kinetic_contacts_hardness(PN_stdfloat value) {
|
||||
|
||||
_cfg.kKHR = value;
|
||||
_cfg.kKHR = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -247,10 +247,10 @@ set_kinetic_contacts_hardness(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kSHR.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_soft_contacts_hardness() const {
|
||||
|
||||
return _cfg.kSHR;
|
||||
return (PN_stdfloat)_cfg.kSHR;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -259,9 +259,9 @@ get_soft_contacts_hardness() const {
|
|||
// Description: Setter for property kSHR.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_soft_contacts_hardness(float value) {
|
||||
set_soft_contacts_hardness(PN_stdfloat value) {
|
||||
|
||||
_cfg.kSHR = value;
|
||||
_cfg.kSHR = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -269,10 +269,10 @@ set_soft_contacts_hardness(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kAHR.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_anchors_hardness() const {
|
||||
|
||||
return _cfg.kAHR;
|
||||
return (PN_stdfloat)_cfg.kAHR;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -281,9 +281,9 @@ get_anchors_hardness() const {
|
|||
// Description: Setter for property kAHR.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_anchors_hardness(float value) {
|
||||
set_anchors_hardness(PN_stdfloat value) {
|
||||
|
||||
_cfg.kAHR = value;
|
||||
_cfg.kAHR = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -291,10 +291,10 @@ set_anchors_hardness(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kSRHR_CL.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_soft_vs_rigid_hardness() const {
|
||||
|
||||
return _cfg.kSRHR_CL;
|
||||
return (PN_stdfloat)_cfg.kSRHR_CL;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -303,9 +303,9 @@ get_soft_vs_rigid_hardness() const {
|
|||
// Description: Setter for property kSRHR_CL.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_soft_vs_rigid_hardness(float value) {
|
||||
set_soft_vs_rigid_hardness(PN_stdfloat value) {
|
||||
|
||||
_cfg.kSRHR_CL = value;
|
||||
_cfg.kSRHR_CL = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -313,10 +313,10 @@ set_soft_vs_rigid_hardness(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kSKHR_CL.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_soft_vs_kinetic_hardness() const {
|
||||
|
||||
return _cfg.kSKHR_CL;
|
||||
return (PN_stdfloat)_cfg.kSKHR_CL;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -325,9 +325,9 @@ get_soft_vs_kinetic_hardness() const {
|
|||
// Description: Setter for property kSKHR_CL.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_soft_vs_kinetic_hardness(float value) {
|
||||
set_soft_vs_kinetic_hardness(PN_stdfloat value) {
|
||||
|
||||
_cfg.kSKHR_CL = value;
|
||||
_cfg.kSKHR_CL = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -335,10 +335,10 @@ set_soft_vs_kinetic_hardness(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kSSHR_CL.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_soft_vs_soft_hardness() const {
|
||||
|
||||
return _cfg.kSSHR_CL;
|
||||
return (PN_stdfloat)_cfg.kSSHR_CL;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -347,9 +347,9 @@ get_soft_vs_soft_hardness() const {
|
|||
// Description: Setter for property kSSHR_CL.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_soft_vs_soft_hardness(float value) {
|
||||
set_soft_vs_soft_hardness(PN_stdfloat value) {
|
||||
|
||||
_cfg.kSSHR_CL = value;
|
||||
_cfg.kSSHR_CL = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -357,10 +357,10 @@ set_soft_vs_soft_hardness(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kSR_SPLT_CL.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_soft_vs_rigid_impulse_split() const {
|
||||
|
||||
return _cfg.kSR_SPLT_CL;
|
||||
return (PN_stdfloat)_cfg.kSR_SPLT_CL;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -369,9 +369,9 @@ get_soft_vs_rigid_impulse_split() const {
|
|||
// Description: Setter for property kSR_SPLT_CL.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_soft_vs_rigid_impulse_split(float value) {
|
||||
set_soft_vs_rigid_impulse_split(PN_stdfloat value) {
|
||||
|
||||
_cfg.kSR_SPLT_CL = value;
|
||||
_cfg.kSR_SPLT_CL = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -379,10 +379,10 @@ set_soft_vs_rigid_impulse_split(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kSK_SPLT_CL.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_soft_vs_kinetic_impulse_split() const {
|
||||
|
||||
return _cfg.kSK_SPLT_CL;
|
||||
return (PN_stdfloat)_cfg.kSK_SPLT_CL;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -391,9 +391,9 @@ get_soft_vs_kinetic_impulse_split() const {
|
|||
// Description: Setter for property kSK_SPLT_CL.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_soft_vs_kinetic_impulse_split(float value) {
|
||||
set_soft_vs_kinetic_impulse_split(PN_stdfloat value) {
|
||||
|
||||
_cfg.kSK_SPLT_CL = value;
|
||||
_cfg.kSK_SPLT_CL = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -401,10 +401,10 @@ set_soft_vs_kinetic_impulse_split(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property kSS_SPLT_CL.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_soft_vs_soft_impulse_split() const {
|
||||
|
||||
return _cfg.kSS_SPLT_CL;
|
||||
return (PN_stdfloat)_cfg.kSS_SPLT_CL;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -413,9 +413,9 @@ get_soft_vs_soft_impulse_split() const {
|
|||
// Description: Setter for property kSS_SPLT_CL.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_soft_vs_soft_impulse_split(float value) {
|
||||
set_soft_vs_soft_impulse_split(PN_stdfloat value) {
|
||||
|
||||
_cfg.kSS_SPLT_CL = value;
|
||||
_cfg.kSS_SPLT_CL = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -423,10 +423,10 @@ set_soft_vs_soft_impulse_split(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property maxvolume.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_maxvolume() const {
|
||||
|
||||
return _cfg.maxvolume;
|
||||
return (PN_stdfloat)_cfg.maxvolume;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -435,9 +435,9 @@ get_maxvolume() const {
|
|||
// Description: Setter for property maxvolume.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_maxvolume(float value) {
|
||||
set_maxvolume(PN_stdfloat value) {
|
||||
|
||||
_cfg.maxvolume = value;
|
||||
_cfg.maxvolume = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -445,10 +445,10 @@ set_maxvolume(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for property timescale.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyConfig::
|
||||
INLINE PN_stdfloat BulletSoftBodyConfig::
|
||||
get_timescale() const {
|
||||
|
||||
return _cfg.timescale;
|
||||
return (PN_stdfloat)_cfg.timescale;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -457,9 +457,9 @@ get_timescale() const {
|
|||
// Description: Setter for property timescale.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyConfig::
|
||||
set_timescale(float value) {
|
||||
set_timescale(PN_stdfloat value) {
|
||||
|
||||
_cfg.timescale = value;
|
||||
_cfg.timescale = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -53,51 +53,51 @@ PUBLISHED:
|
|||
void set_aero_model(AeroModel value);
|
||||
AeroModel get_aero_model() const;
|
||||
|
||||
INLINE void set_velocities_correction_factor(float value);
|
||||
INLINE void set_damping_coefficient(float value);
|
||||
INLINE void set_drag_coefficient(float value);
|
||||
INLINE void set_lift_coefficient(float value);
|
||||
INLINE void set_pressure_coefficient(float value);
|
||||
INLINE void set_volume_conversation_coefficient(float value);
|
||||
INLINE void set_dynamic_friction_coefficient(float value);
|
||||
INLINE void set_pose_matching_coefficient(float value);
|
||||
INLINE void set_rigid_contacts_hardness(float value);
|
||||
INLINE void set_kinetic_contacts_hardness(float value);
|
||||
INLINE void set_soft_contacts_hardness(float value);
|
||||
INLINE void set_anchors_hardness(float value);
|
||||
INLINE void set_soft_vs_rigid_hardness(float value);
|
||||
INLINE void set_soft_vs_kinetic_hardness(float value);
|
||||
INLINE void set_soft_vs_soft_hardness(float value);
|
||||
INLINE void set_soft_vs_rigid_impulse_split(float value);
|
||||
INLINE void set_soft_vs_kinetic_impulse_split(float value);
|
||||
INLINE void set_soft_vs_soft_impulse_split(float value);
|
||||
INLINE void set_maxvolume(float value);
|
||||
INLINE void set_timescale(float value);
|
||||
INLINE void set_velocities_correction_factor(PN_stdfloat value);
|
||||
INLINE void set_damping_coefficient(PN_stdfloat value);
|
||||
INLINE void set_drag_coefficient(PN_stdfloat value);
|
||||
INLINE void set_lift_coefficient(PN_stdfloat value);
|
||||
INLINE void set_pressure_coefficient(PN_stdfloat value);
|
||||
INLINE void set_volume_conversation_coefficient(PN_stdfloat value);
|
||||
INLINE void set_dynamic_friction_coefficient(PN_stdfloat value);
|
||||
INLINE void set_pose_matching_coefficient(PN_stdfloat value);
|
||||
INLINE void set_rigid_contacts_hardness(PN_stdfloat value);
|
||||
INLINE void set_kinetic_contacts_hardness(PN_stdfloat value);
|
||||
INLINE void set_soft_contacts_hardness(PN_stdfloat value);
|
||||
INLINE void set_anchors_hardness(PN_stdfloat value);
|
||||
INLINE void set_soft_vs_rigid_hardness(PN_stdfloat value);
|
||||
INLINE void set_soft_vs_kinetic_hardness(PN_stdfloat value);
|
||||
INLINE void set_soft_vs_soft_hardness(PN_stdfloat value);
|
||||
INLINE void set_soft_vs_rigid_impulse_split(PN_stdfloat value);
|
||||
INLINE void set_soft_vs_kinetic_impulse_split(PN_stdfloat value);
|
||||
INLINE void set_soft_vs_soft_impulse_split(PN_stdfloat value);
|
||||
INLINE void set_maxvolume(PN_stdfloat value);
|
||||
INLINE void set_timescale(PN_stdfloat value);
|
||||
INLINE void set_positions_solver_iterations(int value);
|
||||
INLINE void set_velocities_solver_iterations(int value);
|
||||
INLINE void set_drift_solver_iterations( int value);
|
||||
INLINE void set_cluster_solver_iterations(int value);
|
||||
|
||||
INLINE float get_velocities_correction_factor() const;
|
||||
INLINE float get_damping_coefficient() const;
|
||||
INLINE float get_drag_coefficient() const;
|
||||
INLINE float get_lift_coefficient() const;
|
||||
INLINE float get_pressure_coefficient() const;
|
||||
INLINE float get_volume_conversation_coefficient() const;
|
||||
INLINE float get_dynamic_friction_coefficient() const;
|
||||
INLINE float get_pose_matching_coefficient() const;
|
||||
INLINE float get_rigid_contacts_hardness() const;
|
||||
INLINE float get_kinetic_contacts_hardness() const;
|
||||
INLINE float get_soft_contacts_hardness() const;
|
||||
INLINE float get_anchors_hardness() const;
|
||||
INLINE float get_soft_vs_rigid_hardness() const;
|
||||
INLINE float get_soft_vs_kinetic_hardness() const;
|
||||
INLINE float get_soft_vs_soft_hardness() const;
|
||||
INLINE float get_soft_vs_rigid_impulse_split() const;
|
||||
INLINE float get_soft_vs_kinetic_impulse_split() const;
|
||||
INLINE float get_soft_vs_soft_impulse_split() const;
|
||||
INLINE float get_maxvolume() const;
|
||||
INLINE float get_timescale() const;
|
||||
INLINE PN_stdfloat get_velocities_correction_factor() const;
|
||||
INLINE PN_stdfloat get_damping_coefficient() const;
|
||||
INLINE PN_stdfloat get_drag_coefficient() const;
|
||||
INLINE PN_stdfloat get_lift_coefficient() const;
|
||||
INLINE PN_stdfloat get_pressure_coefficient() const;
|
||||
INLINE PN_stdfloat get_volume_conversation_coefficient() const;
|
||||
INLINE PN_stdfloat get_dynamic_friction_coefficient() const;
|
||||
INLINE PN_stdfloat get_pose_matching_coefficient() const;
|
||||
INLINE PN_stdfloat get_rigid_contacts_hardness() const;
|
||||
INLINE PN_stdfloat get_kinetic_contacts_hardness() const;
|
||||
INLINE PN_stdfloat get_soft_contacts_hardness() const;
|
||||
INLINE PN_stdfloat get_anchors_hardness() const;
|
||||
INLINE PN_stdfloat get_soft_vs_rigid_hardness() const;
|
||||
INLINE PN_stdfloat get_soft_vs_kinetic_hardness() const;
|
||||
INLINE PN_stdfloat get_soft_vs_soft_hardness() const;
|
||||
INLINE PN_stdfloat get_soft_vs_rigid_impulse_split() const;
|
||||
INLINE PN_stdfloat get_soft_vs_kinetic_impulse_split() const;
|
||||
INLINE PN_stdfloat get_soft_vs_soft_impulse_split() const;
|
||||
INLINE PN_stdfloat get_maxvolume() const;
|
||||
INLINE PN_stdfloat get_timescale() const;
|
||||
INLINE int get_positions_solver_iterations() const;
|
||||
INLINE int get_velocities_solver_iterations() const;
|
||||
INLINE int get_drift_solver_iterations() const;
|
||||
|
|
|
|||
|
|
@ -52,10 +52,10 @@ get_material() const {
|
|||
// Access: Published
|
||||
// Description: Getter for the property m_kLST.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyMaterial::
|
||||
INLINE PN_stdfloat BulletSoftBodyMaterial::
|
||||
getLinearStiffness() const {
|
||||
|
||||
return _material.m_kLST;
|
||||
return (PN_stdfloat)_material.m_kLST;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -64,9 +64,9 @@ getLinearStiffness() const {
|
|||
// Description: Setter for the property m_kLST.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyMaterial::
|
||||
setLinearStiffness(float value) {
|
||||
setLinearStiffness(PN_stdfloat value) {
|
||||
|
||||
_material.m_kLST = value;
|
||||
_material.m_kLST = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -74,10 +74,10 @@ setLinearStiffness(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for the property m_kAST.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyMaterial::
|
||||
INLINE PN_stdfloat BulletSoftBodyMaterial::
|
||||
getAngularStiffness() const {
|
||||
|
||||
return _material.m_kAST;
|
||||
return (PN_stdfloat)_material.m_kAST;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -86,9 +86,9 @@ getAngularStiffness() const {
|
|||
// Description: Setter for the property m_kAST.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyMaterial::
|
||||
setAngularStiffness(float value) {
|
||||
setAngularStiffness(PN_stdfloat value) {
|
||||
|
||||
_material.m_kAST = value;
|
||||
_material.m_kAST = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -96,10 +96,10 @@ setAngularStiffness(float value) {
|
|||
// Access: Published
|
||||
// Description: Getter for the property m_kVST.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyMaterial::
|
||||
INLINE PN_stdfloat BulletSoftBodyMaterial::
|
||||
getVolumePreservation() const {
|
||||
|
||||
return _material.m_kVST;
|
||||
return (PN_stdfloat)_material.m_kVST;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -108,8 +108,8 @@ getVolumePreservation() const {
|
|||
// Description: Setter for the property m_kVST.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BulletSoftBodyMaterial::
|
||||
setVolumePreservation(float value) {
|
||||
setVolumePreservation(PN_stdfloat value) {
|
||||
|
||||
_material.m_kVST = value;
|
||||
_material.m_kVST = (btScalar)value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,13 +29,13 @@ PUBLISHED:
|
|||
INLINE ~BulletSoftBodyMaterial();
|
||||
INLINE static BulletSoftBodyMaterial empty();
|
||||
|
||||
INLINE void setLinearStiffness(float value);
|
||||
INLINE void setAngularStiffness(float value);
|
||||
INLINE void setVolumePreservation(float value);
|
||||
INLINE void setLinearStiffness(PN_stdfloat value);
|
||||
INLINE void setAngularStiffness(PN_stdfloat value);
|
||||
INLINE void setVolumePreservation(PN_stdfloat value);
|
||||
|
||||
INLINE float getLinearStiffness() const;
|
||||
INLINE float getAngularStiffness() const;
|
||||
INLINE float getVolumePreservation() const;
|
||||
INLINE PN_stdfloat getLinearStiffness() const;
|
||||
INLINE PN_stdfloat getAngularStiffness() const;
|
||||
INLINE PN_stdfloat getVolumePreservation() const;
|
||||
|
||||
public:
|
||||
BulletSoftBodyMaterial(btSoftBody::Material &material);
|
||||
|
|
|
|||
|
|
@ -53,10 +53,10 @@ empty() {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE LPoint3f BulletSoftBodyNodeElement::
|
||||
INLINE LPoint3 BulletSoftBodyNodeElement::
|
||||
get_pos() const {
|
||||
|
||||
return btVector3_to_LPoint3f(_node.m_x);
|
||||
return btVector3_to_LPoint3(_node.m_x);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -64,10 +64,10 @@ get_pos() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE LVector3f BulletSoftBodyNodeElement::
|
||||
INLINE LVector3 BulletSoftBodyNodeElement::
|
||||
get_normal() const {
|
||||
|
||||
return btVector3_to_LVector3f(_node.m_n);
|
||||
return btVector3_to_LVector3(_node.m_n);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -75,10 +75,10 @@ get_normal() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE LVector3f BulletSoftBodyNodeElement::
|
||||
INLINE LVector3 BulletSoftBodyNodeElement::
|
||||
get_velocity() const {
|
||||
|
||||
return btVector3_to_LVector3f(_node.m_v);
|
||||
return btVector3_to_LVector3(_node.m_v);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -86,10 +86,10 @@ get_velocity() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyNodeElement::
|
||||
INLINE PN_stdfloat BulletSoftBodyNodeElement::
|
||||
get_inv_mass() const {
|
||||
|
||||
return _node.m_im;
|
||||
return (PN_stdfloat)_node.m_im;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -97,10 +97,10 @@ get_inv_mass() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSoftBodyNodeElement::
|
||||
INLINE PN_stdfloat BulletSoftBodyNodeElement::
|
||||
get_area() const {
|
||||
|
||||
return _node.m_area;
|
||||
return (PN_stdfloat)_node.m_area;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -111,6 +111,6 @@ get_area() const {
|
|||
INLINE int BulletSoftBodyNodeElement::
|
||||
is_attached() const {
|
||||
|
||||
return _node.m_battach;
|
||||
return (PN_stdfloat)_node.m_battach;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -189,8 +189,8 @@ transform_changed() {
|
|||
NodePath np = NodePath::any_path((PandaNode *)this);
|
||||
CPT(TransformState) ts = np.get_net_transform();
|
||||
|
||||
LMatrix4f m_sync = _sync->get_mat();
|
||||
LMatrix4f m_ts = ts->get_mat();
|
||||
LMatrix4 m_sync = _sync->get_mat();
|
||||
LMatrix4 m_ts = ts->get_mat();
|
||||
|
||||
if (!m_sync.almost_equal(m_ts)) {
|
||||
_sync = ts;
|
||||
|
|
@ -201,8 +201,8 @@ transform_changed() {
|
|||
_soft->transform(trans);
|
||||
|
||||
if (ts->has_scale()) {
|
||||
LVecBase3f scale = ts->get_scale();
|
||||
if (!scale.almost_equal(LVecBase3f(1.0f, 1.0f, 1.0f))) {
|
||||
LVecBase3 scale = ts->get_scale();
|
||||
if (!scale.almost_equal(LVecBase3(1.0f, 1.0f, 1.0f))) {
|
||||
for (int i=0; i<get_num_shapes(); i++) {
|
||||
PT(BulletShape) shape = _shapes[i];
|
||||
shape->set_local_scale(scale);
|
||||
|
|
@ -250,8 +250,8 @@ sync_b2p() {
|
|||
|
||||
if (flips.get_data1i() > 0) n *= -1;
|
||||
|
||||
vertices.set_data3f(v.getX(), v.getY(), v.getZ());
|
||||
normals.set_data3f(n.getX(), n.getY(), n.getZ());
|
||||
vertices.set_data3((PN_stdfloat)v.getX(), (PN_stdfloat)v.getY(), (PN_stdfloat)v.getZ());
|
||||
normals.set_data3((PN_stdfloat)n.getX(), (PN_stdfloat)n.getY(), (PN_stdfloat)n.getZ());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -260,7 +260,7 @@ sync_b2p() {
|
|||
|
||||
for (int i=0; i < nodes.size(); i++) {
|
||||
btVector3 pos = nodes[i].m_x;
|
||||
_curve->set_vertex(i, btVector3_to_LPoint3f(pos));
|
||||
_curve->set_vertex(i, btVector3_to_LPoint3(pos));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -274,7 +274,7 @@ sync_b2p() {
|
|||
for (int u=0; u < num_u; u++) {
|
||||
for (int v=0; v < num_v; v++) {
|
||||
btVector3 pos = nodes[u * num_u + v].m_x;
|
||||
_surface->set_vertex(u, v, btVector3_to_LPoint3f(pos));
|
||||
_surface->set_vertex(u, v, btVector3_to_LPoint3(pos));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -283,10 +283,10 @@ sync_b2p() {
|
|||
// set_bounds does not store the pointer - it makes a copy using
|
||||
// volume->make_copy().
|
||||
BoundingBox bb = this->get_aabb();
|
||||
LVecBase3f pos = bb.get_approx_center();
|
||||
LVecBase3 pos = bb.get_approx_center();
|
||||
|
||||
NodePath np = NodePath::any_path((PandaNode *)this);
|
||||
LVecBase3f scale = np.get_net_transform()->get_scale();
|
||||
LVecBase3 scale = np.get_net_transform()->get_scale();
|
||||
|
||||
CPT(TransformState) ts = TransformState::make_pos(pos);
|
||||
ts = ts->set_scale(scale);
|
||||
|
|
@ -309,10 +309,10 @@ sync_b2p() {
|
|||
// if local=false, and in local space if local=true.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
int BulletSoftBodyNode::
|
||||
get_closest_node_index(LVecBase3f point, bool local) {
|
||||
get_closest_node_index(LVecBase3 point, bool local) {
|
||||
|
||||
btScalar max_dist_sqr = 1e30;
|
||||
btVector3 point_x = LVecBase3f_to_btVector3(point);
|
||||
btVector3 point_x = LVecBase3_to_btVector3(point);
|
||||
|
||||
btTransform trans = btTransform::getIdentity();
|
||||
if (local == true) {
|
||||
|
|
@ -369,7 +369,7 @@ link_geom(Geom *geom) {
|
|||
GeomVertexRewriter indices(vdata, BulletHelper::get_sb_index());
|
||||
|
||||
while (!vertices.is_at_end()) {
|
||||
LVecBase3f point = vertices.get_data3f();
|
||||
LVecBase3 point = vertices.get_data3();
|
||||
int node_idx = get_closest_node_index(point, true);
|
||||
indices.set_data1i(node_idx);
|
||||
}
|
||||
|
|
@ -448,8 +448,8 @@ get_aabb() const {
|
|||
_soft->getAabb(pMin, pMax);
|
||||
|
||||
return BoundingBox(
|
||||
btVector3_to_LPoint3f(pMin),
|
||||
btVector3_to_LPoint3f(pMax)
|
||||
btVector3_to_LPoint3(pMin),
|
||||
btVector3_to_LPoint3(pMax)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -459,7 +459,7 @@ get_aabb() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSoftBodyNode::
|
||||
set_volume_mass(float mass) {
|
||||
set_volume_mass(PN_stdfloat mass) {
|
||||
|
||||
_soft->setVolumeMass(mass);
|
||||
}
|
||||
|
|
@ -470,7 +470,7 @@ set_volume_mass(float mass) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSoftBodyNode::
|
||||
set_total_mass(float mass, bool fromfaces) {
|
||||
set_total_mass(PN_stdfloat mass, bool fromfaces) {
|
||||
|
||||
_soft->setTotalMass(mass, fromfaces);
|
||||
}
|
||||
|
|
@ -481,7 +481,7 @@ set_total_mass(float mass, bool fromfaces) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSoftBodyNode::
|
||||
set_volume_density(float density) {
|
||||
set_volume_density(PN_stdfloat density) {
|
||||
|
||||
_soft->setVolumeDensity(density);
|
||||
}
|
||||
|
|
@ -492,7 +492,7 @@ set_volume_density(float density) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSoftBodyNode::
|
||||
set_total_density(float density) {
|
||||
set_total_density(PN_stdfloat density) {
|
||||
|
||||
_soft->setTotalDensity(density);
|
||||
}
|
||||
|
|
@ -503,7 +503,7 @@ set_total_density(float density) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSoftBodyNode::
|
||||
set_mass(int node, float mass) {
|
||||
set_mass(int node, PN_stdfloat mass) {
|
||||
|
||||
_soft->setMass(node, mass);
|
||||
}
|
||||
|
|
@ -513,7 +513,7 @@ set_mass(int node, float mass) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletSoftBodyNode::
|
||||
PN_stdfloat BulletSoftBodyNode::
|
||||
get_mass(int node) const {
|
||||
|
||||
return _soft->getMass(node);
|
||||
|
|
@ -524,7 +524,7 @@ get_mass(int node) const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletSoftBodyNode::
|
||||
PN_stdfloat BulletSoftBodyNode::
|
||||
get_total_mass() const {
|
||||
|
||||
return _soft->getTotalMass();
|
||||
|
|
@ -535,7 +535,7 @@ get_total_mass() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletSoftBodyNode::
|
||||
PN_stdfloat BulletSoftBodyNode::
|
||||
get_volume() const {
|
||||
|
||||
return _soft->getVolume();
|
||||
|
|
@ -547,10 +547,10 @@ get_volume() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSoftBodyNode::
|
||||
add_force(const LVector3f &force) {
|
||||
add_force(const LVector3 &force) {
|
||||
|
||||
nassertv(!force.is_nan());
|
||||
_soft->addForce(LVecBase3f_to_btVector3(force));
|
||||
_soft->addForce(LVecBase3_to_btVector3(force));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -559,10 +559,10 @@ add_force(const LVector3f &force) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSoftBodyNode::
|
||||
add_force(const LVector3f &force, int node) {
|
||||
add_force(const LVector3 &force, int node) {
|
||||
|
||||
nassertv(!force.is_nan());
|
||||
_soft->addForce(LVecBase3f_to_btVector3(force), node);
|
||||
_soft->addForce(LVecBase3_to_btVector3(force), node);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -571,10 +571,10 @@ add_force(const LVector3f &force, int node) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSoftBodyNode::
|
||||
set_velocity(const LVector3f &velocity) {
|
||||
set_velocity(const LVector3 &velocity) {
|
||||
|
||||
nassertv(!velocity.is_nan());
|
||||
_soft->setVelocity(LVecBase3f_to_btVector3(velocity));
|
||||
_soft->setVelocity(LVecBase3_to_btVector3(velocity));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -583,10 +583,10 @@ set_velocity(const LVector3f &velocity) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSoftBodyNode::
|
||||
add_velocity(const LVector3f &velocity) {
|
||||
add_velocity(const LVector3 &velocity) {
|
||||
|
||||
nassertv(!velocity.is_nan());
|
||||
_soft->addVelocity(LVecBase3f_to_btVector3(velocity));
|
||||
_soft->addVelocity(LVecBase3_to_btVector3(velocity));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -595,10 +595,10 @@ add_velocity(const LVector3f &velocity) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSoftBodyNode::
|
||||
add_velocity(const LVector3f &velocity, int node) {
|
||||
add_velocity(const LVector3 &velocity, int node) {
|
||||
|
||||
nassertv(!velocity.is_nan());
|
||||
_soft->addVelocity(LVecBase3f_to_btVector3(velocity), node);
|
||||
_soft->addVelocity(LVecBase3_to_btVector3(velocity), node);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -650,10 +650,10 @@ get_num_clusters() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVecBase3f BulletSoftBodyNode::
|
||||
LVecBase3 BulletSoftBodyNode::
|
||||
cluster_com(int cluster) const {
|
||||
|
||||
return btVector3_to_LVecBase3f(_soft->clusterCom(cluster));
|
||||
return btVector3_to_LVecBase3(_soft->clusterCom(cluster));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -690,7 +690,7 @@ append_anchor(int node, BulletRigidBodyNode *body, bool disable) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSoftBodyNode::
|
||||
append_anchor(int node, BulletRigidBodyNode *body, const LVector3f &pivot, bool disable) {
|
||||
append_anchor(int node, BulletRigidBodyNode *body, const LVector3 &pivot, bool disable) {
|
||||
|
||||
nassertv(node < _soft->m_nodes.size())
|
||||
nassertv(body);
|
||||
|
|
@ -699,7 +699,7 @@ append_anchor(int node, BulletRigidBodyNode *body, const LVector3f &pivot, bool
|
|||
body->sync_p2b();
|
||||
|
||||
btRigidBody *ptr =(btRigidBody *)body->get_object();
|
||||
_soft->appendAnchor(node, ptr, LVecBase3f_to_btVector3(pivot), disable);
|
||||
_soft->appendAnchor(node, ptr, LVecBase3_to_btVector3(pivot), disable);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -721,11 +721,11 @@ BulletSoftBodyNodeElement(btSoftBody::Node &node) : _node(node) {
|
|||
// is found -1 is returned.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
int BulletSoftBodyNode::
|
||||
get_point_index(LVecBase3f p, PTA_LVecBase3f points) {
|
||||
get_point_index(LVecBase3 p, PTA_LVecBase3 points) {
|
||||
|
||||
float eps = 1.0e-6f; // TODO make this a config option
|
||||
PN_stdfloat eps = 1.0e-6f; // TODO make this a config option
|
||||
|
||||
for (PTA_LVecBase3f::size_type i=0; i<points.size(); i++) {
|
||||
for (PTA_LVecBase3::size_type i=0; i<points.size(); i++) {
|
||||
if (points[i].almost_equal(p, eps)) {
|
||||
return i; // Found
|
||||
}
|
||||
|
|
@ -764,12 +764,12 @@ next_line(const char* buffer) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
PT(BulletSoftBodyNode) BulletSoftBodyNode::
|
||||
make_rope(BulletSoftBodyWorldInfo &info, const LPoint3f &from, const LPoint3f &to, int res, int fixeds) {
|
||||
make_rope(BulletSoftBodyWorldInfo &info, const LPoint3 &from, const LPoint3 &to, int res, int fixeds) {
|
||||
|
||||
btSoftBody *body = btSoftBodyHelpers::CreateRope(
|
||||
info.get_info(),
|
||||
LVecBase3f_to_btVector3(from),
|
||||
LVecBase3f_to_btVector3(to),
|
||||
LVecBase3_to_btVector3(from),
|
||||
LVecBase3_to_btVector3(to),
|
||||
res,
|
||||
fixeds);
|
||||
|
||||
|
|
@ -784,14 +784,14 @@ make_rope(BulletSoftBodyWorldInfo &info, const LPoint3f &from, const LPoint3f &t
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
PT(BulletSoftBodyNode) BulletSoftBodyNode::
|
||||
make_patch(BulletSoftBodyWorldInfo &info, const LPoint3f &corner00, const LPoint3f &corner10, const LPoint3f &corner01, const LPoint3f &corner11, int resx, int resy, int fixeds, bool gendiags) {
|
||||
make_patch(BulletSoftBodyWorldInfo &info, const LPoint3 &corner00, const LPoint3 &corner10, const LPoint3 &corner01, const LPoint3 &corner11, int resx, int resy, int fixeds, bool gendiags) {
|
||||
|
||||
btSoftBody *body = btSoftBodyHelpers::CreatePatch(
|
||||
info.get_info(),
|
||||
LVecBase3f_to_btVector3(corner00),
|
||||
LVecBase3f_to_btVector3(corner10),
|
||||
LVecBase3f_to_btVector3(corner01),
|
||||
LVecBase3f_to_btVector3(corner11),
|
||||
LVecBase3_to_btVector3(corner00),
|
||||
LVecBase3_to_btVector3(corner10),
|
||||
LVecBase3_to_btVector3(corner01),
|
||||
LVecBase3_to_btVector3(corner11),
|
||||
resx,
|
||||
resy,
|
||||
fixeds,
|
||||
|
|
@ -808,12 +808,12 @@ make_patch(BulletSoftBodyWorldInfo &info, const LPoint3f &corner00, const LPoint
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
PT(BulletSoftBodyNode) BulletSoftBodyNode::
|
||||
make_ellipsoid(BulletSoftBodyWorldInfo &info, const LPoint3f ¢er, const LVecBase3f &radius, int res) {
|
||||
make_ellipsoid(BulletSoftBodyWorldInfo &info, const LPoint3 ¢er, const LVecBase3 &radius, int res) {
|
||||
|
||||
btSoftBody *body = btSoftBodyHelpers::CreateEllipsoid(
|
||||
info.get_info(),
|
||||
LVecBase3f_to_btVector3(center),
|
||||
LVecBase3f_to_btVector3(radius),
|
||||
LVecBase3_to_btVector3(center),
|
||||
LVecBase3_to_btVector3(radius),
|
||||
res);
|
||||
|
||||
PT(BulletSoftBodyNode) node = new BulletSoftBodyNode(body);
|
||||
|
|
@ -827,16 +827,16 @@ make_ellipsoid(BulletSoftBodyWorldInfo &info, const LPoint3f ¢er, const LVec
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
PT(BulletSoftBodyNode) BulletSoftBodyNode::
|
||||
make_tri_mesh(BulletSoftBodyWorldInfo &info, PTA_LVecBase3f points, PTA_int indices, bool randomizeConstraints) {
|
||||
make_tri_mesh(BulletSoftBodyWorldInfo &info, PTA_LVecBase3 points, PTA_int indices, bool randomizeConstraints) {
|
||||
|
||||
// Eliminate duplicate vertices
|
||||
PTA_LVecBase3f mapped_points;
|
||||
PTA_LVecBase3 mapped_points;
|
||||
PTA_int mapped_indices;
|
||||
|
||||
pmap<int, int> mapping;
|
||||
|
||||
for (PTA_LVecBase3f::size_type i=0; i<points.size(); i++) {
|
||||
LVecBase3f p = points[i];
|
||||
for (PTA_LVecBase3::size_type i=0; i<points.size(); i++) {
|
||||
LVecBase3 p = points[i];
|
||||
int j = get_point_index(p, mapped_points);
|
||||
if (j < 0) {
|
||||
mapping[i] = mapped_points.size();
|
||||
|
|
@ -899,7 +899,7 @@ PT(BulletSoftBodyNode) BulletSoftBodyNode::
|
|||
make_tri_mesh(BulletSoftBodyWorldInfo &info, const Geom *geom, bool randomizeConstraints) {
|
||||
|
||||
// Read vertex data
|
||||
PTA_LVecBase3f points;
|
||||
PTA_LVecBase3 points;
|
||||
PTA_int indices;
|
||||
|
||||
CPT(GeomVertexData) vdata = geom->get_vertex_data();
|
||||
|
|
@ -909,7 +909,7 @@ make_tri_mesh(BulletSoftBodyWorldInfo &info, const Geom *geom, bool randomizeCon
|
|||
GeomVertexReader vreader(vdata, InternalName::get_vertex());
|
||||
|
||||
while (!vreader.is_at_end()) {
|
||||
LVecBase3f v = vreader.get_data3f();
|
||||
LVecBase3 v = vreader.get_data3();
|
||||
points.push_back(v);
|
||||
}
|
||||
|
||||
|
|
@ -940,14 +940,14 @@ make_tri_mesh(BulletSoftBodyWorldInfo &info, const Geom *geom, bool randomizeCon
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
PT(BulletSoftBodyNode) BulletSoftBodyNode::
|
||||
make_tet_mesh(BulletSoftBodyWorldInfo &info, PTA_LVecBase3f points, PTA_int indices, bool tetralinks) {
|
||||
make_tet_mesh(BulletSoftBodyWorldInfo &info, PTA_LVecBase3 points, PTA_int indices, bool tetralinks) {
|
||||
|
||||
// Points
|
||||
btAlignedObjectArray<btVector3> pos;
|
||||
pos.resize(points.size());
|
||||
for (PTA_LVecBase3f::size_type i=0; i<points.size(); i++) {
|
||||
LVecBase3f point = points[i];
|
||||
pos[i] = LVecBase3f_to_btVector3(point);
|
||||
for (PTA_LVecBase3::size_type i=0; i<points.size(); i++) {
|
||||
LVecBase3 point = points[i];
|
||||
pos[i] = LVecBase3_to_btVector3(point);
|
||||
}
|
||||
|
||||
// Body
|
||||
|
|
@ -1005,7 +1005,7 @@ make_tet_mesh(BulletSoftBodyWorldInfo &info, const char *ele, const char *face,
|
|||
|
||||
for (int i=0; i<pos.size(); ++i) {
|
||||
int index = 0;
|
||||
float x, y, z;
|
||||
PN_stdfloat x, y, z;
|
||||
|
||||
sscanf(node, "%d %f %f %f", &index, &x, &y, &z);
|
||||
node += next_line(node);
|
||||
|
|
|
|||
|
|
@ -44,11 +44,11 @@ PUBLISHED:
|
|||
INLINE ~BulletSoftBodyNodeElement();
|
||||
INLINE static BulletSoftBodyNodeElement empty();
|
||||
|
||||
INLINE LPoint3f get_pos() const;
|
||||
INLINE LVector3f get_velocity() const;
|
||||
INLINE LVector3f get_normal() const;
|
||||
INLINE float get_inv_mass() const;
|
||||
INLINE float get_area() const;
|
||||
INLINE LPoint3 get_pos() const;
|
||||
INLINE LVector3 get_velocity() const;
|
||||
INLINE LVector3 get_normal() const;
|
||||
INLINE PN_stdfloat get_inv_mass() const;
|
||||
INLINE PN_stdfloat get_area() const;
|
||||
INLINE int is_attached() const;
|
||||
|
||||
public:
|
||||
|
|
@ -77,23 +77,23 @@ PUBLISHED:
|
|||
void randomize_constraints();
|
||||
|
||||
// Mass, volume, density
|
||||
void set_volume_mass(float mass);
|
||||
void set_volume_density(float density);
|
||||
void set_total_mass(float mass, bool fromfaces=false);
|
||||
void set_total_density(float density);
|
||||
void set_mass(int node, float mass);
|
||||
void set_volume_mass(PN_stdfloat mass);
|
||||
void set_volume_density(PN_stdfloat density);
|
||||
void set_total_mass(PN_stdfloat mass, bool fromfaces=false);
|
||||
void set_total_density(PN_stdfloat density);
|
||||
void set_mass(int node, PN_stdfloat mass);
|
||||
|
||||
float get_mass(int node) const;
|
||||
float get_total_mass() const;
|
||||
float get_volume() const;
|
||||
PN_stdfloat get_mass(int node) const;
|
||||
PN_stdfloat get_total_mass() const;
|
||||
PN_stdfloat get_volume() const;
|
||||
|
||||
// Force
|
||||
void add_force(const LVector3f &force);
|
||||
void add_force(const LVector3f &force, int node);
|
||||
void add_force(const LVector3 &force);
|
||||
void add_force(const LVector3 &force, int node);
|
||||
|
||||
void set_velocity(const LVector3f &velocity);
|
||||
void add_velocity(const LVector3f &velocity);
|
||||
void add_velocity(const LVector3f &velocity, int node);
|
||||
void set_velocity(const LVector3 &velocity);
|
||||
void add_velocity(const LVector3 &velocity);
|
||||
void add_velocity(const LVector3 &velocity, int node);
|
||||
|
||||
void set_pose(bool bvolume, bool bframe);
|
||||
|
||||
|
|
@ -104,7 +104,7 @@ PUBLISHED:
|
|||
void release_cluster(int index);
|
||||
void release_clusters();
|
||||
int get_num_clusters() const;
|
||||
LVecBase3f cluster_com(int cluster) const;
|
||||
LVecBase3 cluster_com(int cluster) const;
|
||||
|
||||
// Rendering
|
||||
void link_geom(Geom *geom);
|
||||
|
|
@ -120,7 +120,7 @@ PUBLISHED:
|
|||
void append_anchor(int node, BulletRigidBodyNode *body,
|
||||
bool disable=false);
|
||||
void append_anchor(int node, BulletRigidBodyNode *body,
|
||||
const LVector3f &pivot,
|
||||
const LVector3 &pivot,
|
||||
bool disable=false);
|
||||
|
||||
// Materials
|
||||
|
|
@ -135,22 +135,22 @@ PUBLISHED:
|
|||
BulletSoftBodyNodeElement get_node(int idx) const;
|
||||
MAKE_SEQ(get_nodes, get_num_nodes, get_node);
|
||||
|
||||
int get_closest_node_index(LVecBase3f point, bool local);
|
||||
int get_closest_node_index(LVecBase3 point, bool local);
|
||||
|
||||
// Factory
|
||||
static PT(BulletSoftBodyNode) make_rope(
|
||||
BulletSoftBodyWorldInfo &info,
|
||||
const LPoint3f &from,
|
||||
const LPoint3f &to,
|
||||
const LPoint3 &from,
|
||||
const LPoint3 &to,
|
||||
int res,
|
||||
int fixeds);
|
||||
|
||||
static PT(BulletSoftBodyNode) make_patch(
|
||||
BulletSoftBodyWorldInfo &info,
|
||||
const LPoint3f &corner00,
|
||||
const LPoint3f &corner10,
|
||||
const LPoint3f &corner01,
|
||||
const LPoint3f &corner11,
|
||||
const LPoint3 &corner00,
|
||||
const LPoint3 &corner10,
|
||||
const LPoint3 &corner01,
|
||||
const LPoint3 &corner11,
|
||||
int resx,
|
||||
int resy,
|
||||
int fixeds,
|
||||
|
|
@ -158,8 +158,8 @@ PUBLISHED:
|
|||
|
||||
static PT(BulletSoftBodyNode) make_ellipsoid(
|
||||
BulletSoftBodyWorldInfo &info,
|
||||
const LPoint3f ¢er,
|
||||
const LVecBase3f &radius,
|
||||
const LPoint3 ¢er,
|
||||
const LVecBase3 &radius,
|
||||
int res);
|
||||
|
||||
static PT(BulletSoftBodyNode) make_tri_mesh(
|
||||
|
|
@ -169,13 +169,13 @@ PUBLISHED:
|
|||
|
||||
static PT(BulletSoftBodyNode) make_tri_mesh(
|
||||
BulletSoftBodyWorldInfo &info,
|
||||
PTA_LVecBase3f points,
|
||||
PTA_LVecBase3 points,
|
||||
PTA_int indices,
|
||||
bool randomizeConstraints=true);
|
||||
|
||||
static PT(BulletSoftBodyNode) make_tet_mesh(
|
||||
BulletSoftBodyWorldInfo &info,
|
||||
PTA_LVecBase3f points,
|
||||
PTA_LVecBase3 points,
|
||||
PTA_int indices,
|
||||
bool tetralinks=true);
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ private:
|
|||
PT(NurbsCurveEvaluator) _curve;
|
||||
PT(NurbsSurfaceEvaluator) _surface;
|
||||
|
||||
static int get_point_index(LVecBase3f p, PTA_LVecBase3f points);
|
||||
static int get_point_index(LVecBase3 p, PTA_LVecBase3 points);
|
||||
static int next_line(const char *buffer);
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ garbage_collect(int lifetime) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSoftBodyWorldInfo::
|
||||
set_air_density(float density) {
|
||||
set_air_density(PN_stdfloat density) {
|
||||
|
||||
_info.air_density = density;
|
||||
_info.air_density = (btScalar)density;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -52,9 +52,9 @@ set_air_density(float density) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSoftBodyWorldInfo::
|
||||
set_water_density(float density) {
|
||||
set_water_density(PN_stdfloat density) {
|
||||
|
||||
_info.water_density = density;
|
||||
_info.water_density = (btScalar)density;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -63,9 +63,9 @@ set_water_density(float density) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSoftBodyWorldInfo::
|
||||
set_water_offset(float offset) {
|
||||
set_water_offset(PN_stdfloat offset) {
|
||||
|
||||
_info.water_offset = offset;
|
||||
_info.water_offset = (btScalar)offset;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -74,10 +74,10 @@ set_water_offset(float offset) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSoftBodyWorldInfo::
|
||||
set_water_normal(const LVector3f &normal) {
|
||||
set_water_normal(const LVector3 &normal) {
|
||||
|
||||
nassertv(!normal.is_nan());
|
||||
_info.water_normal = LVecBase3f_to_btVector3(normal);
|
||||
_info.water_normal = LVecBase3_to_btVector3(normal);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -86,10 +86,10 @@ set_water_normal(const LVector3f &normal) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSoftBodyWorldInfo::
|
||||
set_gravity(const LVector3f &gravity) {
|
||||
set_gravity(const LVector3 &gravity) {
|
||||
|
||||
nassertv(!gravity.is_nan());
|
||||
_info.m_gravity = LVecBase3f_to_btVector3(gravity);
|
||||
_info.m_gravity = LVecBase3_to_btVector3(gravity);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -97,10 +97,10 @@ set_gravity(const LVector3f &gravity) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletSoftBodyWorldInfo::
|
||||
PN_stdfloat BulletSoftBodyWorldInfo::
|
||||
get_air_density() const {
|
||||
|
||||
return _info.air_density;
|
||||
return (PN_stdfloat)_info.air_density;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -108,10 +108,10 @@ get_air_density() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletSoftBodyWorldInfo::
|
||||
PN_stdfloat BulletSoftBodyWorldInfo::
|
||||
get_water_density() const {
|
||||
|
||||
return _info.water_density;
|
||||
return (PN_stdfloat)_info.water_density;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -119,10 +119,10 @@ get_water_density() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletSoftBodyWorldInfo::
|
||||
PN_stdfloat BulletSoftBodyWorldInfo::
|
||||
get_water_offset() const {
|
||||
|
||||
return _info.water_offset;
|
||||
return (PN_stdfloat)_info.water_offset;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -130,10 +130,10 @@ get_water_offset() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVector3f BulletSoftBodyWorldInfo::
|
||||
LVector3 BulletSoftBodyWorldInfo::
|
||||
get_water_normal() const {
|
||||
|
||||
return btVector3_to_LVector3f(_info.water_normal);
|
||||
return btVector3_to_LVector3(_info.water_normal);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -141,9 +141,9 @@ get_water_normal() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVector3f BulletSoftBodyWorldInfo::
|
||||
LVector3 BulletSoftBodyWorldInfo::
|
||||
get_gravity() const {
|
||||
|
||||
return btVector3_to_LVector3f(_info.m_gravity);
|
||||
return btVector3_to_LVector3(_info.m_gravity);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,17 +31,17 @@ class EXPCL_PANDABULLET BulletSoftBodyWorldInfo {
|
|||
PUBLISHED:
|
||||
INLINE ~BulletSoftBodyWorldInfo();
|
||||
|
||||
void set_air_density(float density);
|
||||
void set_water_density(float density);
|
||||
void set_water_offset(float offset);
|
||||
void set_water_normal(const LVector3f &normal);
|
||||
void set_gravity(const LVector3f &gravity);
|
||||
void set_air_density(PN_stdfloat density);
|
||||
void set_water_density(PN_stdfloat density);
|
||||
void set_water_offset(PN_stdfloat offset);
|
||||
void set_water_normal(const LVector3 &normal);
|
||||
void set_gravity(const LVector3 &gravity);
|
||||
|
||||
float get_air_density() const;
|
||||
float get_water_density() const;
|
||||
float get_water_offset() const;
|
||||
LVector3f get_water_normal() const;
|
||||
LVector3f get_gravity() const;
|
||||
PN_stdfloat get_air_density() const;
|
||||
PN_stdfloat get_water_density() const;
|
||||
PN_stdfloat get_water_offset() const;
|
||||
LVector3 get_water_normal() const;
|
||||
LVector3 get_gravity() const;
|
||||
|
||||
void garbage_collect(int lifetime=256);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ INLINE BulletSphereShape::
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float BulletSphereShape::
|
||||
INLINE PN_stdfloat BulletSphereShape::
|
||||
get_radius() const {
|
||||
|
||||
return _shape->getRadius();
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ TypeHandle BulletSphereShape::_type_handle;
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
BulletSphereShape::
|
||||
BulletSphereShape(float radius) {
|
||||
BulletSphereShape(PN_stdfloat radius) {
|
||||
|
||||
_shape = new btSphereShape(radius);
|
||||
_shape->setUserPointer(this);
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@
|
|||
class EXPCL_PANDABULLET BulletSphereShape : public BulletShape {
|
||||
|
||||
PUBLISHED:
|
||||
BulletSphereShape(float radius);
|
||||
BulletSphereShape(PN_stdfloat radius);
|
||||
INLINE ~BulletSphereShape();
|
||||
|
||||
INLINE float get_radius() const;
|
||||
INLINE PN_stdfloat get_radius() const;
|
||||
|
||||
static BulletSphereShape *make_from_solid(const CollisionSphere *solid);
|
||||
|
||||
|
|
|
|||
|
|
@ -24,10 +24,10 @@ TypeHandle BulletSphericalConstraint::_type_handle;
|
|||
////////////////////////////////////////////////////////////////////
|
||||
BulletSphericalConstraint::
|
||||
BulletSphericalConstraint(const BulletRigidBodyNode *node_a,
|
||||
const LPoint3f &pivot_a) {
|
||||
const LPoint3 &pivot_a) {
|
||||
|
||||
btRigidBody *ptr_a = btRigidBody::upcast(node_a->get_object());
|
||||
btVector3 pos_a = LVecBase3f_to_btVector3(pivot_a);
|
||||
btVector3 pos_a = LVecBase3_to_btVector3(pivot_a);
|
||||
|
||||
_constraint = new btPoint2PointConstraint(*ptr_a, pos_a);
|
||||
}
|
||||
|
|
@ -40,14 +40,14 @@ BulletSphericalConstraint(const BulletRigidBodyNode *node_a,
|
|||
BulletSphericalConstraint::
|
||||
BulletSphericalConstraint(const BulletRigidBodyNode *node_a,
|
||||
const BulletRigidBodyNode *node_b,
|
||||
const LPoint3f &pivot_a,
|
||||
const LPoint3f &pivot_b) {
|
||||
const LPoint3 &pivot_a,
|
||||
const LPoint3 &pivot_b) {
|
||||
|
||||
btRigidBody *ptr_a = btRigidBody::upcast(node_a->get_object());
|
||||
btVector3 pos_a = LVecBase3f_to_btVector3(pivot_a);
|
||||
btVector3 pos_a = LVecBase3_to_btVector3(pivot_a);
|
||||
|
||||
btRigidBody *ptr_b = btRigidBody::upcast(node_b->get_object());
|
||||
btVector3 pos_b = LVecBase3f_to_btVector3(pivot_b);
|
||||
btVector3 pos_b = LVecBase3_to_btVector3(pivot_b);
|
||||
|
||||
_constraint = new btPoint2PointConstraint(*ptr_a, *ptr_b, pos_a, pos_b);
|
||||
}
|
||||
|
|
@ -69,10 +69,10 @@ ptr() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSphericalConstraint::
|
||||
set_pivot_a(const LPoint3f &pivot_a) {
|
||||
set_pivot_a(const LPoint3 &pivot_a) {
|
||||
|
||||
nassertv(!pivot_a.is_nan());
|
||||
_constraint->setPivotA(LVecBase3f_to_btVector3(pivot_a));
|
||||
_constraint->setPivotA(LVecBase3_to_btVector3(pivot_a));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -81,10 +81,10 @@ set_pivot_a(const LPoint3f &pivot_a) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletSphericalConstraint::
|
||||
set_pivot_b(const LPoint3f &pivot_b) {
|
||||
set_pivot_b(const LPoint3 &pivot_b) {
|
||||
|
||||
nassertv(!pivot_b.is_nan());
|
||||
_constraint->setPivotA(LVecBase3f_to_btVector3(pivot_b));
|
||||
_constraint->setPivotA(LVecBase3_to_btVector3(pivot_b));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -92,10 +92,10 @@ set_pivot_b(const LPoint3f &pivot_b) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletSphericalConstraint::
|
||||
LPoint3 BulletSphericalConstraint::
|
||||
get_pivot_in_a() const {
|
||||
|
||||
return btVector3_to_LPoint3f(_constraint->getPivotInA());
|
||||
return btVector3_to_LPoint3(_constraint->getPivotInA());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -103,9 +103,9 @@ get_pivot_in_a() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletSphericalConstraint::
|
||||
LPoint3 BulletSphericalConstraint::
|
||||
get_pivot_in_b() const {
|
||||
|
||||
return btVector3_to_LPoint3f(_constraint->getPivotInB());
|
||||
return btVector3_to_LPoint3(_constraint->getPivotInB());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,18 +39,18 @@ class EXPCL_PANDABULLET BulletSphericalConstraint : public BulletConstraint {
|
|||
|
||||
PUBLISHED:
|
||||
BulletSphericalConstraint(const BulletRigidBodyNode *node_a,
|
||||
const LPoint3f &pivot_a);
|
||||
const LPoint3 &pivot_a);
|
||||
BulletSphericalConstraint(const BulletRigidBodyNode *node_a,
|
||||
const BulletRigidBodyNode *node_b,
|
||||
const LPoint3f &pivot_a,
|
||||
const LPoint3f &pivot_b);
|
||||
const LPoint3 &pivot_a,
|
||||
const LPoint3 &pivot_b);
|
||||
INLINE ~BulletSphericalConstraint();
|
||||
|
||||
void set_pivot_a(const LPoint3f &pivot_a);
|
||||
void set_pivot_b(const LPoint3f &pivot_b);
|
||||
void set_pivot_a(const LPoint3 &pivot_a);
|
||||
void set_pivot_b(const LPoint3 &pivot_b);
|
||||
|
||||
LPoint3f get_pivot_in_a() const;
|
||||
LPoint3f get_pivot_in_b() const;
|
||||
LPoint3 get_pivot_in_a() const;
|
||||
LPoint3 get_pivot_in_b() const;
|
||||
|
||||
public:
|
||||
virtual btTypedConstraint *ptr() const;
|
||||
|
|
|
|||
|
|
@ -60,16 +60,16 @@ preallocate(int num_verts, int num_indices) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletTriangleMesh::
|
||||
add_triangle(const LPoint3f &p0, const LPoint3f &p1, const LPoint3f &p2, bool remove_duplicate_vertices) {
|
||||
add_triangle(const LPoint3 &p0, const LPoint3 &p1, const LPoint3 &p2, bool remove_duplicate_vertices) {
|
||||
|
||||
nassertv(!p0.is_nan());
|
||||
nassertv(!p1.is_nan());
|
||||
nassertv(!p2.is_nan());
|
||||
|
||||
_mesh->addTriangle(
|
||||
LVecBase3f_to_btVector3(p0),
|
||||
LVecBase3f_to_btVector3(p1),
|
||||
LVecBase3f_to_btVector3(p2),
|
||||
LVecBase3_to_btVector3(p0),
|
||||
LVecBase3_to_btVector3(p1),
|
||||
LVecBase3_to_btVector3(p2),
|
||||
remove_duplicate_vertices);
|
||||
}
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ add_triangle(const LPoint3f &p0, const LPoint3f &p1, const LPoint3f &p2, bool re
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletTriangleMesh::
|
||||
set_welding_distance(float distance) {
|
||||
set_welding_distance(PN_stdfloat distance) {
|
||||
|
||||
_mesh->m_weldingThreshold = distance;
|
||||
}
|
||||
|
|
@ -89,7 +89,7 @@ set_welding_distance(float distance) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletTriangleMesh::
|
||||
PN_stdfloat BulletTriangleMesh::
|
||||
get_welding_distance() const {
|
||||
|
||||
return _mesh->m_weldingThreshold;
|
||||
|
|
@ -104,23 +104,23 @@ void BulletTriangleMesh::
|
|||
add_geom(const Geom *geom, bool remove_duplicate_vertices) {
|
||||
|
||||
// Collect points
|
||||
pvector<LPoint3f> points;
|
||||
pvector<LPoint3> points;
|
||||
|
||||
CPT(GeomVertexData) vdata = geom->get_vertex_data();
|
||||
GeomVertexReader reader = GeomVertexReader(vdata, InternalName::get_vertex());
|
||||
|
||||
while (!reader.is_at_end()) {
|
||||
points.push_back(reader.get_data3f());
|
||||
points.push_back(reader.get_data3());
|
||||
}
|
||||
|
||||
// Convert points
|
||||
btVector3 *vertices = new btVector3[points.size()];
|
||||
|
||||
int i = 0;
|
||||
pvector<LPoint3f>::const_iterator it;
|
||||
pvector<LPoint3>::const_iterator it;
|
||||
for (it=points.begin(); it!=points.end(); it++) {
|
||||
LPoint3f v = *it;
|
||||
vertices[i] = LVecBase3f_to_btVector3(v);
|
||||
LPoint3 v = *it;
|
||||
vertices[i] = LVecBase3_to_btVector3(v);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
|
@ -152,16 +152,16 @@ add_geom(const Geom *geom, bool remove_duplicate_vertices) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletTriangleMesh::
|
||||
add_array(const PTA_LVecBase3f &points, const PTA_int &indices, bool remove_duplicate_vertices) {
|
||||
add_array(const PTA_LVecBase3 &points, const PTA_int &indices, bool remove_duplicate_vertices) {
|
||||
|
||||
// Convert vertices
|
||||
btVector3 *vertices = new btVector3[points.size()];
|
||||
|
||||
int i = 0;
|
||||
PTA_LVecBase3f::const_iterator it;
|
||||
PTA_LVecBase3::const_iterator it;
|
||||
for (it=points.begin(); it!=points.end(); it++) {
|
||||
LVecBase3f v = *it;
|
||||
vertices[i] = LVecBase3f_to_btVector3(v);
|
||||
LVecBase3 v = *it;
|
||||
vertices[i] = LVecBase3_to_btVector3(v);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,21 +37,21 @@ PUBLISHED:
|
|||
BulletTriangleMesh();
|
||||
INLINE ~BulletTriangleMesh();
|
||||
|
||||
void add_triangle(const LPoint3f &p0,
|
||||
const LPoint3f &p1,
|
||||
const LPoint3f &p2,
|
||||
void add_triangle(const LPoint3 &p0,
|
||||
const LPoint3 &p1,
|
||||
const LPoint3 &p2,
|
||||
bool remove_duplicate_vertices=false);
|
||||
void add_array(const PTA_LVecBase3f &points,
|
||||
void add_array(const PTA_LVecBase3 &points,
|
||||
const PTA_int &indices,
|
||||
bool remove_duplicate_vertices=false);
|
||||
void add_geom(const Geom *geom,
|
||||
bool remove_duplicate_vertices=false);
|
||||
|
||||
void set_welding_distance(float distance);
|
||||
void set_welding_distance(PN_stdfloat distance);
|
||||
void preallocate(int num_verts, int num_indices);
|
||||
|
||||
int get_num_triangles() const;
|
||||
float get_welding_distance() const;
|
||||
PN_stdfloat get_welding_distance() const;
|
||||
|
||||
virtual void output(ostream &out) const;
|
||||
virtual void write(ostream &out, int indent_level) const;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ BulletTriangleMeshShape(BulletTriangleMesh *mesh, bool dynamic, bool compress, b
|
|||
// Assert that mesh has at least one triangle
|
||||
if (mesh->get_num_triangles() == 0) {
|
||||
bullet_cat.warning() << "mesh has zero triangles! adding degenerated triangle." << endl;
|
||||
mesh->add_triangle(LPoint3f::zero(), LPoint3f::zero(), LPoint3f::zero());
|
||||
mesh->add_triangle(LPoint3::zero(), LPoint3::zero(), LPoint3::zero());
|
||||
}
|
||||
|
||||
// Retain a pointer to the mesh, to prevent it from being deleted
|
||||
|
|
@ -90,14 +90,14 @@ ptr() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletTriangleMeshShape::
|
||||
refit_tree(const LPoint3f &aabb_min, const LPoint3f &aabb_max) {
|
||||
refit_tree(const LPoint3 &aabb_min, const LPoint3 &aabb_max) {
|
||||
|
||||
nassertv(!aabb_max.is_nan());
|
||||
nassertv(!aabb_max.is_nan());
|
||||
|
||||
nassertv(this->is_static());
|
||||
|
||||
_bvh_shape->refitTree(LVecBase3f_to_btVector3(aabb_min),
|
||||
LVecBase3f_to_btVector3(aabb_max));
|
||||
_bvh_shape->refitTree(LVecBase3_to_btVector3(aabb_min),
|
||||
LVecBase3_to_btVector3(aabb_max));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ PUBLISHED:
|
|||
BulletTriangleMeshShape(BulletTriangleMesh *mesh, bool dynamic, bool compress=true, bool bvh=true);
|
||||
INLINE ~BulletTriangleMeshShape();
|
||||
|
||||
void refit_tree(const LPoint3f &aabb_min, const LPoint3f &aabb_max);
|
||||
void refit_tree(const LPoint3 &aabb_min, const LPoint3 &aabb_max);
|
||||
|
||||
INLINE bool is_static() const;
|
||||
INLINE bool is_dynamic() const;
|
||||
|
|
|
|||
|
|
@ -66,9 +66,9 @@ get_num_wheels() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletVehicleTuning::
|
||||
set_suspension_stiffness(float value) {
|
||||
set_suspension_stiffness(PN_stdfloat value) {
|
||||
|
||||
_.m_suspensionStiffness = value;
|
||||
_.m_suspensionStiffness = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -77,9 +77,9 @@ set_suspension_stiffness(float value) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletVehicleTuning::
|
||||
set_suspension_compression(float value) {
|
||||
set_suspension_compression(PN_stdfloat value) {
|
||||
|
||||
_.m_suspensionCompression = value;
|
||||
_.m_suspensionCompression = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -88,9 +88,9 @@ set_suspension_compression(float value) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletVehicleTuning::
|
||||
set_suspension_damping(float value) {
|
||||
set_suspension_damping(PN_stdfloat value) {
|
||||
|
||||
_.m_suspensionDamping = value;
|
||||
_.m_suspensionDamping = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -99,9 +99,9 @@ set_suspension_damping(float value) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletVehicleTuning::
|
||||
set_max_suspension_travel_cm(float value) {
|
||||
set_max_suspension_travel_cm(PN_stdfloat value) {
|
||||
|
||||
_.m_maxSuspensionTravelCm = value;
|
||||
_.m_maxSuspensionTravelCm = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -110,9 +110,9 @@ set_max_suspension_travel_cm(float value) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletVehicleTuning::
|
||||
set_friction_slip(float value) {
|
||||
set_friction_slip(PN_stdfloat value) {
|
||||
|
||||
_.m_frictionSlip = value;
|
||||
_.m_frictionSlip = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -121,9 +121,9 @@ set_friction_slip(float value) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletVehicleTuning::
|
||||
set_max_suspension_force(float value) {
|
||||
set_max_suspension_force(PN_stdfloat value) {
|
||||
|
||||
_.m_maxSuspensionForce = value;
|
||||
_.m_maxSuspensionForce = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -131,10 +131,10 @@ set_max_suspension_force(float value) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletVehicleTuning::
|
||||
PN_stdfloat BulletVehicleTuning::
|
||||
get_suspension_stiffness() const {
|
||||
|
||||
return _.m_suspensionStiffness;
|
||||
return (PN_stdfloat)_.m_suspensionStiffness;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -142,10 +142,10 @@ get_suspension_stiffness() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletVehicleTuning::
|
||||
PN_stdfloat BulletVehicleTuning::
|
||||
get_suspension_compression() const {
|
||||
|
||||
return _.m_suspensionCompression;
|
||||
return (PN_stdfloat)_.m_suspensionCompression;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -153,10 +153,10 @@ get_suspension_compression() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletVehicleTuning::
|
||||
PN_stdfloat BulletVehicleTuning::
|
||||
get_suspension_damping() const {
|
||||
|
||||
return _.m_suspensionDamping;
|
||||
return (PN_stdfloat)_.m_suspensionDamping;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -164,10 +164,10 @@ get_suspension_damping() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletVehicleTuning::
|
||||
PN_stdfloat BulletVehicleTuning::
|
||||
get_max_suspension_travel_cm() const {
|
||||
|
||||
return _.m_maxSuspensionTravelCm;
|
||||
return (PN_stdfloat)_.m_maxSuspensionTravelCm;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -175,10 +175,10 @@ get_max_suspension_travel_cm() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletVehicleTuning::
|
||||
PN_stdfloat BulletVehicleTuning::
|
||||
get_friction_slip() const {
|
||||
|
||||
return _.m_frictionSlip;
|
||||
return (PN_stdfloat)_.m_frictionSlip;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -186,9 +186,9 @@ get_friction_slip() const {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletVehicleTuning::
|
||||
PN_stdfloat BulletVehicleTuning::
|
||||
get_max_suspension_force() const {
|
||||
|
||||
return _.m_maxSuspensionForce;
|
||||
return (PN_stdfloat)_.m_maxSuspensionForce;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,10 +68,10 @@ set_coordinate_system(BulletUpAxis up) {
|
|||
// actual direction of movement. The forward vetcor
|
||||
// is given in global coordinates.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVector3f BulletVehicle::
|
||||
LVector3 BulletVehicle::
|
||||
get_forward_vector() const {
|
||||
|
||||
return btVector3_to_LVector3f(_vehicle->getForwardVector());
|
||||
return btVector3_to_LVector3(_vehicle->getForwardVector());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -93,10 +93,10 @@ get_chassis() {
|
|||
// Description: Returns the current speed in kilometers per hour.
|
||||
// Convert to miles using: km/h * 0.62 = mph
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletVehicle::
|
||||
PN_stdfloat BulletVehicle::
|
||||
get_current_speed_km_hour() const {
|
||||
|
||||
return _vehicle->getCurrentSpeedKmHour();
|
||||
return (PN_stdfloat)_vehicle->getCurrentSpeedKmHour();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -116,7 +116,7 @@ reset_suspension() {
|
|||
// Description: Returns the steering angle of the wheel with index
|
||||
// idx in degrees.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletVehicle::
|
||||
PN_stdfloat BulletVehicle::
|
||||
get_steering_value(int idx) const {
|
||||
|
||||
nassertr(idx < get_num_wheels(), 0.0f);
|
||||
|
|
@ -130,7 +130,7 @@ get_steering_value(int idx) const {
|
|||
// with index idx.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletVehicle::
|
||||
set_steering_value(float steering, int idx) {
|
||||
set_steering_value(PN_stdfloat steering, int idx) {
|
||||
|
||||
nassertv(idx < get_num_wheels());
|
||||
_vehicle->setSteeringValue(deg_2_rad(steering), idx);
|
||||
|
|
@ -143,7 +143,7 @@ set_steering_value(float steering, int idx) {
|
|||
// acceleration.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletVehicle::
|
||||
apply_engine_force(float force, int idx) {
|
||||
apply_engine_force(PN_stdfloat force, int idx) {
|
||||
|
||||
nassertv(idx < get_num_wheels());
|
||||
_vehicle->applyEngineForce(force, idx);
|
||||
|
|
@ -155,7 +155,7 @@ apply_engine_force(float force, int idx) {
|
|||
// Description: Applies braking force to the wheel with index idx.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletVehicle::
|
||||
set_brake(float brake, int idx) {
|
||||
set_brake(PN_stdfloat brake, int idx) {
|
||||
|
||||
nassertv(idx < get_num_wheels());
|
||||
_vehicle->setBrake(brake, idx);
|
||||
|
|
@ -167,7 +167,7 @@ set_brake(float brake, int idx) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletVehicle::
|
||||
set_pitch_control(float pitch) {
|
||||
set_pitch_control(PN_stdfloat pitch) {
|
||||
|
||||
_vehicle->setPitchControl(pitch);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,19 +39,19 @@ class BulletWheel;
|
|||
class BulletVehicleTuning {
|
||||
|
||||
PUBLISHED:
|
||||
INLINE void set_suspension_stiffness(float value);
|
||||
INLINE void set_suspension_compression(float value);
|
||||
INLINE void set_suspension_damping(float value);
|
||||
INLINE void set_max_suspension_travel_cm(float value);
|
||||
INLINE void set_friction_slip(float value);
|
||||
INLINE void set_max_suspension_force(float value);
|
||||
INLINE void set_suspension_stiffness(PN_stdfloat value);
|
||||
INLINE void set_suspension_compression(PN_stdfloat value);
|
||||
INLINE void set_suspension_damping(PN_stdfloat value);
|
||||
INLINE void set_max_suspension_travel_cm(PN_stdfloat value);
|
||||
INLINE void set_friction_slip(PN_stdfloat value);
|
||||
INLINE void set_max_suspension_force(PN_stdfloat value);
|
||||
|
||||
INLINE float get_suspension_stiffness() const;
|
||||
INLINE float get_suspension_compression() const;
|
||||
INLINE float get_suspension_damping() const;
|
||||
INLINE float get_max_suspension_travel_cm() const;
|
||||
INLINE float get_friction_slip() const;
|
||||
INLINE float get_max_suspension_force() const;
|
||||
INLINE PN_stdfloat get_suspension_stiffness() const;
|
||||
INLINE PN_stdfloat get_suspension_compression() const;
|
||||
INLINE PN_stdfloat get_suspension_damping() const;
|
||||
INLINE PN_stdfloat get_max_suspension_travel_cm() const;
|
||||
INLINE PN_stdfloat get_friction_slip() const;
|
||||
INLINE PN_stdfloat get_max_suspension_force() const;
|
||||
|
||||
private:
|
||||
btRaycastVehicle::btVehicleTuning _;
|
||||
|
|
@ -70,17 +70,17 @@ PUBLISHED:
|
|||
INLINE ~BulletVehicle();
|
||||
|
||||
void set_coordinate_system(BulletUpAxis up);
|
||||
void set_steering_value(float steering, int idx);
|
||||
void set_brake(float brake, int idx);
|
||||
void set_pitch_control(float pitch);
|
||||
void set_steering_value(PN_stdfloat steering, int idx);
|
||||
void set_brake(PN_stdfloat brake, int idx);
|
||||
void set_pitch_control(PN_stdfloat pitch);
|
||||
|
||||
BulletRigidBodyNode *get_chassis();
|
||||
float get_current_speed_km_hour() const;
|
||||
float get_steering_value(int idx) const;
|
||||
LVector3f get_forward_vector() const;
|
||||
PN_stdfloat get_current_speed_km_hour() const;
|
||||
PN_stdfloat get_steering_value(int idx) const;
|
||||
LVector3 get_forward_vector() const;
|
||||
|
||||
void reset_suspension();
|
||||
void apply_engine_force(float force, int idx);
|
||||
void apply_engine_force(PN_stdfloat force, int idx);
|
||||
|
||||
// Wheels
|
||||
BulletWheel create_wheel();
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ BulletWheel(btWheelInfo &info) : _info(info) {
|
|||
// Description: Returns the length of the suspension when the
|
||||
// vehicle is standing still.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_suspension_rest_length() const {
|
||||
|
||||
return _info.getSuspensionRestLength();
|
||||
return (PN_stdfloat)_info.getSuspensionRestLength();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -42,9 +42,9 @@ get_suspension_rest_length() const {
|
|||
// Description: Sets how stiff the suspension shall be.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_suspension_stiffness(float value) {
|
||||
set_suspension_stiffness(PN_stdfloat value) {
|
||||
|
||||
_info.m_suspensionStiffness = value;
|
||||
_info.m_suspensionStiffness = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -52,10 +52,10 @@ set_suspension_stiffness(float value) {
|
|||
// Access: Published
|
||||
// Description: Returns the stiffness of the suspension.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_suspension_stiffness() const {
|
||||
|
||||
return _info.m_suspensionStiffness;
|
||||
return (PN_stdfloat)_info.m_suspensionStiffness;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -65,9 +65,9 @@ get_suspension_stiffness() const {
|
|||
// out of the resting position in centimeters.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_max_suspension_travel_cm(float value) {
|
||||
set_max_suspension_travel_cm(PN_stdfloat value) {
|
||||
|
||||
_info.m_maxSuspensionTravelCm = value;
|
||||
_info.m_maxSuspensionTravelCm = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -75,10 +75,10 @@ set_max_suspension_travel_cm(float value) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_max_suspension_travel_cm() const {
|
||||
|
||||
return _info.m_maxSuspensionTravelCm;
|
||||
return (PN_stdfloat)_info.m_maxSuspensionTravelCm;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -87,9 +87,9 @@ get_max_suspension_travel_cm() const {
|
|||
// Description: Sets the slipperyness of the tyre.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_friction_slip(float value) {
|
||||
set_friction_slip(PN_stdfloat value) {
|
||||
|
||||
_info.m_frictionSlip = value;
|
||||
_info.m_frictionSlip = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -97,10 +97,10 @@ set_friction_slip(float value) {
|
|||
// Access: Published
|
||||
// Description: Returns how slippery the tyres are.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_friction_slip() const {
|
||||
|
||||
return _info.m_frictionSlip;
|
||||
return (PN_stdfloat)_info.m_frictionSlip;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -110,9 +110,9 @@ get_friction_slip() const {
|
|||
// handle.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_max_suspension_force(float value) {
|
||||
set_max_suspension_force(PN_stdfloat value) {
|
||||
|
||||
_info.m_maxSuspensionForce = value;
|
||||
_info.m_maxSuspensionForce = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -121,10 +121,10 @@ set_max_suspension_force(float value) {
|
|||
// Description: Returns the maximum force (weight) the suspension
|
||||
// can handle.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_max_suspension_force() const {
|
||||
|
||||
return _info.m_maxSuspensionForce;
|
||||
return (PN_stdfloat)_info.m_maxSuspensionForce;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -134,9 +134,9 @@ get_max_suspension_force() const {
|
|||
// gets compressed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_wheels_damping_compression(float value) {
|
||||
set_wheels_damping_compression(PN_stdfloat value) {
|
||||
|
||||
_info.m_wheelsDampingCompression = value;
|
||||
_info.m_wheelsDampingCompression = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -145,10 +145,10 @@ set_wheels_damping_compression(float value) {
|
|||
// Description: Returns the damping applied to the compressing
|
||||
// suspension.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_wheels_damping_compression() const {
|
||||
|
||||
return _info.m_wheelsDampingCompression;
|
||||
return (PN_stdfloat)_info.m_wheelsDampingCompression;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -158,9 +158,9 @@ get_wheels_damping_compression() const {
|
|||
// relaxes.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_wheels_damping_relaxation(float value) {
|
||||
set_wheels_damping_relaxation(PN_stdfloat value) {
|
||||
|
||||
_info.m_wheelsDampingRelaxation = value;
|
||||
_info.m_wheelsDampingRelaxation = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -169,10 +169,10 @@ set_wheels_damping_relaxation(float value) {
|
|||
// Description: Returns the damping applied to the relaxing
|
||||
// suspension.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_wheels_damping_relaxation() const {
|
||||
|
||||
return _info.m_wheelsDampingRelaxation;
|
||||
return (PN_stdfloat)_info.m_wheelsDampingRelaxation;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -185,9 +185,9 @@ get_wheels_damping_relaxation() const {
|
|||
// of mass up and down.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_roll_influence(float value) {
|
||||
set_roll_influence(PN_stdfloat value) {
|
||||
|
||||
_info.m_rollInfluence = value;
|
||||
_info.m_rollInfluence = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -196,10 +196,10 @@ set_roll_influence(float value) {
|
|||
// Description: Returns the factor by which roll forces are scaled.
|
||||
// See set_roll_influence.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_roll_influence() const {
|
||||
|
||||
return _info.m_rollInfluence;
|
||||
return (PN_stdfloat)_info.m_rollInfluence;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -208,9 +208,9 @@ get_roll_influence() const {
|
|||
// Description: Sets the wheel radius.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_wheel_radius(float value) {
|
||||
set_wheel_radius(PN_stdfloat value) {
|
||||
|
||||
_info.m_wheelsRadius = value;
|
||||
_info.m_wheelsRadius = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -218,10 +218,10 @@ set_wheel_radius(float value) {
|
|||
// Access: Published
|
||||
// Description: Returns the wheel radius.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_wheel_radius() const {
|
||||
|
||||
return _info.m_wheelsRadius;
|
||||
return (PN_stdfloat)_info.m_wheelsRadius;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -230,9 +230,9 @@ get_wheel_radius() const {
|
|||
// Description: Sets the steering angle.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_steering(float value) {
|
||||
set_steering(PN_stdfloat value) {
|
||||
|
||||
_info.m_steering = value;
|
||||
_info.m_steering = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -240,10 +240,10 @@ set_steering(float value) {
|
|||
// Access: Published
|
||||
// Description: Returns the steering angle in degrees.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_steering() const {
|
||||
|
||||
return _info.m_steering;
|
||||
return (PN_stdfloat)_info.m_steering;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -252,9 +252,9 @@ get_steering() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_rotation(float value) {
|
||||
set_rotation(PN_stdfloat value) {
|
||||
|
||||
_info.m_rotation = value;
|
||||
_info.m_rotation = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -262,10 +262,10 @@ set_rotation(float value) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_rotation() const {
|
||||
|
||||
return _info.m_rotation;
|
||||
return (PN_stdfloat)_info.m_rotation;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -274,9 +274,9 @@ get_rotation() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_delta_rotation(float value) {
|
||||
set_delta_rotation(PN_stdfloat value) {
|
||||
|
||||
_info.m_deltaRotation = value;
|
||||
_info.m_deltaRotation = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -284,10 +284,10 @@ set_delta_rotation(float value) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_delta_rotation() const {
|
||||
|
||||
return _info.m_deltaRotation;
|
||||
return (PN_stdfloat)_info.m_deltaRotation;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -297,9 +297,9 @@ get_delta_rotation() const {
|
|||
// wheel.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_engine_force(float value) {
|
||||
set_engine_force(PN_stdfloat value) {
|
||||
|
||||
_info.m_engineForce = value;
|
||||
_info.m_engineForce = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -308,10 +308,10 @@ set_engine_force(float value) {
|
|||
// Description: Returns the amount of accelleration force currently
|
||||
// applied.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_engine_force() const {
|
||||
|
||||
return _info.m_engineForce;
|
||||
return (PN_stdfloat)_info.m_engineForce;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -320,9 +320,9 @@ get_engine_force() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_brake(float value) {
|
||||
set_brake(PN_stdfloat value) {
|
||||
|
||||
_info.m_brake = value;
|
||||
_info.m_brake = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -331,10 +331,10 @@ set_brake(float value) {
|
|||
// Description: Returns the amount of braking force currently
|
||||
// applied.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_brake() const {
|
||||
|
||||
return _info.m_brake;
|
||||
return (PN_stdfloat)_info.m_brake;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -343,9 +343,9 @@ get_brake() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_skid_info(float value) {
|
||||
set_skid_info(PN_stdfloat value) {
|
||||
|
||||
_info.m_skidInfo = value;
|
||||
_info.m_skidInfo = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -353,10 +353,10 @@ set_skid_info(float value) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_skid_info() const {
|
||||
|
||||
return _info.m_skidInfo;
|
||||
return (PN_stdfloat)_info.m_skidInfo;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -365,9 +365,9 @@ get_skid_info() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_wheels_suspension_force(float value) {
|
||||
set_wheels_suspension_force(PN_stdfloat value) {
|
||||
|
||||
_info.m_wheelsSuspensionForce = value;
|
||||
_info.m_wheelsSuspensionForce = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -375,10 +375,10 @@ set_wheels_suspension_force(float value) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_wheels_suspension_force() const {
|
||||
|
||||
return _info.m_wheelsSuspensionForce;
|
||||
return (PN_stdfloat)_info.m_wheelsSuspensionForce;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -387,9 +387,9 @@ get_wheels_suspension_force() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_suspension_relative_velocity(float value) {
|
||||
set_suspension_relative_velocity(PN_stdfloat value) {
|
||||
|
||||
_info.m_suspensionRelativeVelocity = value;
|
||||
_info.m_suspensionRelativeVelocity = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -397,10 +397,10 @@ set_suspension_relative_velocity(float value) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_suspension_relative_velocity() const {
|
||||
|
||||
return _info.m_suspensionRelativeVelocity;
|
||||
return (PN_stdfloat)_info.m_suspensionRelativeVelocity;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -409,9 +409,9 @@ get_suspension_relative_velocity() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_clipped_inv_connection_point_cs(float value) {
|
||||
set_clipped_inv_connection_point_cs(PN_stdfloat value) {
|
||||
|
||||
_info.m_clippedInvContactDotSuspension = value;
|
||||
_info.m_clippedInvContactDotSuspension = (btScalar)value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -419,10 +419,10 @@ set_clipped_inv_connection_point_cs(float value) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float BulletWheel::
|
||||
PN_stdfloat BulletWheel::
|
||||
get_clipped_inv_connection_point_cs() const {
|
||||
|
||||
return _info.m_clippedInvContactDotSuspension;
|
||||
return (PN_stdfloat)_info.m_clippedInvContactDotSuspension;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -432,10 +432,10 @@ get_clipped_inv_connection_point_cs() const {
|
|||
// chassis.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_chassis_connection_point_cs(const LPoint3f &pos) {
|
||||
set_chassis_connection_point_cs(const LPoint3 &pos) {
|
||||
|
||||
nassertv(!pos.is_nan());
|
||||
_info.m_chassisConnectionPointCS = LVecBase3f_to_btVector3(pos);
|
||||
_info.m_chassisConnectionPointCS = LVecBase3_to_btVector3(pos);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -444,10 +444,10 @@ set_chassis_connection_point_cs(const LPoint3f &pos) {
|
|||
// Description: Returns the point where the wheel is connected to
|
||||
// the chassis.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f BulletWheel::
|
||||
LPoint3 BulletWheel::
|
||||
get_chassis_connection_point_cs() const {
|
||||
|
||||
return btVector3_to_LPoint3f(_info.m_chassisConnectionPointCS);
|
||||
return btVector3_to_LPoint3(_info.m_chassisConnectionPointCS);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -457,10 +457,10 @@ get_chassis_connection_point_cs() const {
|
|||
// orthogonal to the axle vector.)
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_wheel_direction_cs(const LVector3f &dir) {
|
||||
set_wheel_direction_cs(const LVector3 &dir) {
|
||||
|
||||
nassertv(!dir.is_nan());
|
||||
_info.m_wheelDirectionCS = LVecBase3f_to_btVector3(dir);
|
||||
_info.m_wheelDirectionCS = LVecBase3_to_btVector3(dir);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -469,10 +469,10 @@ set_wheel_direction_cs(const LVector3f &dir) {
|
|||
// Description: Returns the wheel's forward vector relative to the
|
||||
// chassis.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVector3f BulletWheel::
|
||||
LVector3 BulletWheel::
|
||||
get_wheel_direction_cs() const {
|
||||
|
||||
return btVector3_to_LVector3f(_info.m_wheelDirectionCS);
|
||||
return btVector3_to_LVector3(_info.m_wheelDirectionCS);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -481,10 +481,10 @@ get_wheel_direction_cs() const {
|
|||
// Description: Determines the wheel axle normal vector.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_wheel_axle_cs(const LVector3f &axle) {
|
||||
set_wheel_axle_cs(const LVector3 &axle) {
|
||||
|
||||
nassertv(!axle.is_nan());
|
||||
_info.m_wheelAxleCS = LVecBase3f_to_btVector3(axle);
|
||||
_info.m_wheelAxleCS = LVecBase3_to_btVector3(axle);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -492,10 +492,10 @@ set_wheel_axle_cs(const LVector3f &axle) {
|
|||
// Access: Published
|
||||
// Description: Returns the normal vector of the wheel axle.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVector3f BulletWheel::
|
||||
LVector3 BulletWheel::
|
||||
get_wheel_axle_cs() const {
|
||||
|
||||
return btVector3_to_LVector3f(_info.m_wheelAxleCS);
|
||||
return btVector3_to_LVector3(_info.m_wheelAxleCS);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -504,10 +504,10 @@ get_wheel_axle_cs() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWheel::
|
||||
set_world_transform(const LMatrix4f &mat) {
|
||||
set_world_transform(const LMatrix4 &mat) {
|
||||
|
||||
nassertv(!mat.is_nan());
|
||||
_info.m_worldTransform = LMatrix4f_to_btTrans(mat);
|
||||
_info.m_worldTransform = LMatrix4_to_btTrans(mat);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -515,10 +515,10 @@ set_world_transform(const LMatrix4f &mat) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LMatrix4f BulletWheel::
|
||||
LMatrix4 BulletWheel::
|
||||
get_world_transform() const {
|
||||
|
||||
return btTrans_to_LMatrix4f(_info.m_worldTransform);
|
||||
return btTrans_to_LMatrix4(_info.m_worldTransform);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -36,52 +36,52 @@ class EXPCL_PANDABULLET BulletWheel {
|
|||
PUBLISHED:
|
||||
INLINE ~BulletWheel();
|
||||
|
||||
void set_suspension_stiffness(float value);
|
||||
void set_max_suspension_travel_cm(float value);
|
||||
void set_friction_slip(float value);
|
||||
void set_max_suspension_force(float value);
|
||||
void set_wheels_damping_compression(float value);
|
||||
void set_wheels_damping_relaxation(float value);
|
||||
void set_roll_influence(float value);
|
||||
void set_wheel_radius(float value);
|
||||
void set_steering(float value);
|
||||
void set_rotation(float value);
|
||||
void set_delta_rotation(float value);
|
||||
void set_engine_force(float value);
|
||||
void set_brake(float value);
|
||||
void set_skid_info(float value);
|
||||
void set_wheels_suspension_force(float value);
|
||||
void set_suspension_relative_velocity(float value);
|
||||
void set_clipped_inv_connection_point_cs(float value);
|
||||
void set_chassis_connection_point_cs(const LPoint3f &pos);
|
||||
void set_wheel_direction_cs(const LVector3f &dir);
|
||||
void set_wheel_axle_cs(const LVector3f &axle);
|
||||
void set_world_transform(const LMatrix4f &mat);
|
||||
void set_suspension_stiffness(PN_stdfloat value);
|
||||
void set_max_suspension_travel_cm(PN_stdfloat value);
|
||||
void set_friction_slip(PN_stdfloat value);
|
||||
void set_max_suspension_force(PN_stdfloat value);
|
||||
void set_wheels_damping_compression(PN_stdfloat value);
|
||||
void set_wheels_damping_relaxation(PN_stdfloat value);
|
||||
void set_roll_influence(PN_stdfloat value);
|
||||
void set_wheel_radius(PN_stdfloat value);
|
||||
void set_steering(PN_stdfloat value);
|
||||
void set_rotation(PN_stdfloat value);
|
||||
void set_delta_rotation(PN_stdfloat value);
|
||||
void set_engine_force(PN_stdfloat value);
|
||||
void set_brake(PN_stdfloat value);
|
||||
void set_skid_info(PN_stdfloat value);
|
||||
void set_wheels_suspension_force(PN_stdfloat value);
|
||||
void set_suspension_relative_velocity(PN_stdfloat value);
|
||||
void set_clipped_inv_connection_point_cs(PN_stdfloat value);
|
||||
void set_chassis_connection_point_cs(const LPoint3 &pos);
|
||||
void set_wheel_direction_cs(const LVector3 &dir);
|
||||
void set_wheel_axle_cs(const LVector3 &axle);
|
||||
void set_world_transform(const LMatrix4 &mat);
|
||||
void set_front_wheel(bool value);
|
||||
void set_node(PandaNode *node);
|
||||
|
||||
float get_suspension_rest_length() const;
|
||||
float get_suspension_stiffness() const;
|
||||
float get_max_suspension_travel_cm() const;
|
||||
float get_friction_slip() const;
|
||||
float get_max_suspension_force() const;
|
||||
float get_wheels_damping_compression() const;
|
||||
float get_wheels_damping_relaxation() const;
|
||||
float get_roll_influence() const;
|
||||
float get_wheel_radius() const;
|
||||
float get_steering() const;
|
||||
float get_rotation() const;
|
||||
float get_delta_rotation() const;
|
||||
float get_engine_force() const;
|
||||
float get_brake() const;
|
||||
float get_skid_info() const;
|
||||
float get_wheels_suspension_force() const;
|
||||
float get_suspension_relative_velocity() const;
|
||||
float get_clipped_inv_connection_point_cs() const;
|
||||
LPoint3f get_chassis_connection_point_cs() const;
|
||||
LVector3f get_wheel_direction_cs() const;
|
||||
LVector3f get_wheel_axle_cs() const;
|
||||
LMatrix4f get_world_transform() const;
|
||||
PN_stdfloat get_suspension_rest_length() const;
|
||||
PN_stdfloat get_suspension_stiffness() const;
|
||||
PN_stdfloat get_max_suspension_travel_cm() const;
|
||||
PN_stdfloat get_friction_slip() const;
|
||||
PN_stdfloat get_max_suspension_force() const;
|
||||
PN_stdfloat get_wheels_damping_compression() const;
|
||||
PN_stdfloat get_wheels_damping_relaxation() const;
|
||||
PN_stdfloat get_roll_influence() const;
|
||||
PN_stdfloat get_wheel_radius() const;
|
||||
PN_stdfloat get_steering() const;
|
||||
PN_stdfloat get_rotation() const;
|
||||
PN_stdfloat get_delta_rotation() const;
|
||||
PN_stdfloat get_engine_force() const;
|
||||
PN_stdfloat get_brake() const;
|
||||
PN_stdfloat get_skid_info() const;
|
||||
PN_stdfloat get_wheels_suspension_force() const;
|
||||
PN_stdfloat get_suspension_relative_velocity() const;
|
||||
PN_stdfloat get_clipped_inv_connection_point_cs() const;
|
||||
LPoint3 get_chassis_connection_point_cs() const;
|
||||
LVector3 get_wheel_direction_cs() const;
|
||||
LVector3 get_wheel_axle_cs() const;
|
||||
LMatrix4 get_world_transform() const;
|
||||
bool is_front_wheel() const;
|
||||
PandaNode *get_node() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -102,9 +102,9 @@ get_world_info() {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWorld::
|
||||
set_gravity(const LVector3f &gravity) {
|
||||
set_gravity(const LVector3 &gravity) {
|
||||
|
||||
_world->setGravity(LVecBase3f_to_btVector3(gravity));
|
||||
_world->setGravity(LVecBase3_to_btVector3(gravity));
|
||||
_info.m_gravity = _world->getGravity();
|
||||
}
|
||||
|
||||
|
|
@ -114,9 +114,9 @@ set_gravity(const LVector3f &gravity) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWorld::
|
||||
set_gravity(float gx, float gy, float gz) {
|
||||
set_gravity(PN_stdfloat gx, PN_stdfloat gy, PN_stdfloat gz) {
|
||||
|
||||
_world->setGravity(btVector3(gx, gy, gz));
|
||||
_world->setGravity(btVector3((btScalar)gx, (btScalar)gy, (btScalar)gz));
|
||||
_info.m_gravity = _world->getGravity();
|
||||
}
|
||||
|
||||
|
|
@ -125,10 +125,10 @@ set_gravity(float gx, float gy, float gz) {
|
|||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
const LVector3f BulletWorld::
|
||||
const LVector3 BulletWorld::
|
||||
get_gravity() const {
|
||||
|
||||
return btVector3_to_LVector3f(_world->getGravity());
|
||||
return btVector3_to_LVector3(_world->getGravity());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -137,7 +137,7 @@ get_gravity() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWorld::
|
||||
do_physics(float dt, int substeps, float stepsize) {
|
||||
do_physics(PN_stdfloat dt, int substeps, PN_stdfloat stepsize) {
|
||||
|
||||
_pstat_physics.start();
|
||||
|
||||
|
|
@ -148,7 +148,7 @@ do_physics(float dt, int substeps, float stepsize) {
|
|||
|
||||
// Simulation
|
||||
_pstat_simulation.start();
|
||||
int n = _world->stepSimulation(dt, substeps, stepsize);
|
||||
int n = _world->stepSimulation((btScalar)dt, substeps, (btScalar)stepsize);
|
||||
_pstat_simulation.stop();
|
||||
|
||||
if (!n) {
|
||||
|
|
@ -181,7 +181,7 @@ do_physics(float dt, int substeps, float stepsize) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void BulletWorld::
|
||||
sync_p2b(float dt) {
|
||||
sync_p2b(PN_stdfloat dt) {
|
||||
|
||||
for (int i=0; i < get_num_rigid_bodies(); i++) {
|
||||
get_rigid_body(i)->sync_p2b();
|
||||
|
|
@ -579,13 +579,13 @@ remove_constraint(BulletConstraint *constraint) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
BulletClosestHitRayResult BulletWorld::
|
||||
ray_test_closest(const LPoint3f &from_pos, const LPoint3f &to_pos, const CollideMask &mask) const {
|
||||
ray_test_closest(const LPoint3 &from_pos, const LPoint3 &to_pos, const CollideMask &mask) const {
|
||||
|
||||
nassertr(!from_pos.is_nan(), BulletClosestHitRayResult::empty());
|
||||
nassertr(!to_pos.is_nan(), BulletClosestHitRayResult::empty());
|
||||
|
||||
const btVector3 from = LVecBase3f_to_btVector3(from_pos);
|
||||
const btVector3 to = LVecBase3f_to_btVector3(to_pos);
|
||||
const btVector3 from = LVecBase3_to_btVector3(from_pos);
|
||||
const btVector3 to = LVecBase3_to_btVector3(to_pos);
|
||||
|
||||
BulletClosestHitRayResult cb(from, to, mask);
|
||||
_world->rayTest(from, to, cb);
|
||||
|
|
@ -598,13 +598,13 @@ ray_test_closest(const LPoint3f &from_pos, const LPoint3f &to_pos, const Collide
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
BulletAllHitsRayResult BulletWorld::
|
||||
ray_test_all(const LPoint3f &from_pos, const LPoint3f &to_pos, const CollideMask &mask) const {
|
||||
ray_test_all(const LPoint3 &from_pos, const LPoint3 &to_pos, const CollideMask &mask) const {
|
||||
|
||||
nassertr(!from_pos.is_nan(), BulletAllHitsRayResult::empty());
|
||||
nassertr(!to_pos.is_nan(), BulletAllHitsRayResult::empty());
|
||||
|
||||
const btVector3 from = LVecBase3f_to_btVector3(from_pos);
|
||||
const btVector3 to = LVecBase3f_to_btVector3(to_pos);
|
||||
const btVector3 from = LVecBase3_to_btVector3(from_pos);
|
||||
const btVector3 to = LVecBase3_to_btVector3(to_pos);
|
||||
|
||||
BulletAllHitsRayResult cb(from, to, mask);
|
||||
_world->rayTest(from, to, cb);
|
||||
|
|
@ -617,7 +617,7 @@ ray_test_all(const LPoint3f &from_pos, const LPoint3f &to_pos, const CollideMask
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
BulletClosestHitSweepResult BulletWorld::
|
||||
sweep_test_closest(BulletShape *shape, const TransformState &from_ts, const TransformState &to_ts, const CollideMask &mask, float penetration) const {
|
||||
sweep_test_closest(BulletShape *shape, const TransformState &from_ts, const TransformState &to_ts, const CollideMask &mask, PN_stdfloat penetration) const {
|
||||
|
||||
nassertr(shape, BulletClosestHitSweepResult::empty());
|
||||
nassertr(shape->is_convex(), BulletClosestHitSweepResult::empty());
|
||||
|
|
@ -625,10 +625,10 @@ sweep_test_closest(BulletShape *shape, const TransformState &from_ts, const Tran
|
|||
nassertr(!to_ts.is_invalid(), BulletClosestHitSweepResult::empty());
|
||||
|
||||
const btConvexShape *convex = (const btConvexShape *) shape->ptr();
|
||||
const btVector3 from_pos = LVecBase3f_to_btVector3(from_ts.get_pos());
|
||||
const btVector3 to_pos = LVecBase3f_to_btVector3(to_ts.get_pos());
|
||||
const btTransform from_trans = LMatrix4f_to_btTrans(from_ts.get_mat());
|
||||
const btTransform to_trans = LMatrix4f_to_btTrans(to_ts.get_mat());
|
||||
const btVector3 from_pos = LVecBase3_to_btVector3(from_ts.get_pos());
|
||||
const btVector3 to_pos = LVecBase3_to_btVector3(to_ts.get_pos());
|
||||
const btTransform from_trans = LMatrix4_to_btTrans(from_ts.get_mat());
|
||||
const btTransform to_trans = LMatrix4_to_btTrans(to_ts.get_mat());
|
||||
|
||||
BulletClosestHitSweepResult cb(from_pos, to_pos, mask);
|
||||
_world->convexSweepTest(convex, from_trans, to_trans, cb, penetration);
|
||||
|
|
|
|||
|
|
@ -52,11 +52,11 @@ PUBLISHED:
|
|||
BulletWorld();
|
||||
INLINE ~BulletWorld();
|
||||
|
||||
void set_gravity(const LVector3f &gravity);
|
||||
void set_gravity(float gx, float gy, float gz);
|
||||
const LVector3f get_gravity() const;
|
||||
void set_gravity(const LVector3 &gravity);
|
||||
void set_gravity(PN_stdfloat gx, PN_stdfloat gy, PN_stdfloat gz);
|
||||
const LVector3 get_gravity() const;
|
||||
|
||||
void do_physics(float dt, int substeps=1, float stepsize=1.0f/60.0f);
|
||||
void do_physics(PN_stdfloat dt, int substeps=1, PN_stdfloat stepsize=1.0f/60.0f);
|
||||
|
||||
void set_debug_node(BulletDebugNode *node);
|
||||
void clear_debug_node();
|
||||
|
|
@ -113,13 +113,13 @@ PUBLISHED:
|
|||
|
||||
// Raycast and other queries
|
||||
BulletClosestHitRayResult ray_test_closest(
|
||||
const LPoint3f &from_pos,
|
||||
const LPoint3f &to_pos,
|
||||
const LPoint3 &from_pos,
|
||||
const LPoint3 &to_pos,
|
||||
const CollideMask &mask=CollideMask::all_on()) const;
|
||||
|
||||
BulletAllHitsRayResult ray_test_all(
|
||||
const LPoint3f &from_pos,
|
||||
const LPoint3f &to_pos,
|
||||
const LPoint3 &from_pos,
|
||||
const LPoint3 &to_pos,
|
||||
const CollideMask &mask=CollideMask::all_on()) const;
|
||||
|
||||
BulletClosestHitSweepResult sweep_test_closest(
|
||||
|
|
@ -127,7 +127,7 @@ PUBLISHED:
|
|||
const TransformState &from_ts,
|
||||
const TransformState &to_ts,
|
||||
const CollideMask &mask=CollideMask::all_on(),
|
||||
float penetration=0.0f) const;
|
||||
PN_stdfloat penetration=0.0f) const;
|
||||
|
||||
BulletContactResult contact_test(PandaNode *node) const;
|
||||
BulletContactResult contact_test_pair(PandaNode *node0, PandaNode *node1) const;
|
||||
|
|
@ -151,7 +151,7 @@ public:
|
|||
INLINE btDispatcher *get_dispatcher() const;
|
||||
|
||||
private:
|
||||
void sync_p2b(float dt);
|
||||
void sync_p2b(PN_stdfloat dt);
|
||||
void sync_b2p();
|
||||
|
||||
typedef PTA(PT(BulletRigidBodyNode)) BulletRigidBodies;
|
||||
|
|
|
|||
|
|
@ -17,118 +17,132 @@
|
|||
#include "transformState.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: LVecBase3f_to_btVector3
|
||||
// Function: LVecBase3_to_btVector3
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
btVector3 LVecBase3f_to_btVector3(const LVecBase3f &v) {
|
||||
btVector3 LVecBase3_to_btVector3(const LVecBase3 &v) {
|
||||
|
||||
return btVector3(v.get_x(), v.get_y(), v.get_z());
|
||||
return btVector3((btScalar)v.get_x(),
|
||||
(btScalar)v.get_y(),
|
||||
(btScalar)v.get_z());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: btVector3_to_LVecBase3f
|
||||
// Function: btVector3_to_LVecBase3
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVecBase3f btVector3_to_LVecBase3f(const btVector3 &v) {
|
||||
LVecBase3 btVector3_to_LVecBase3(const btVector3 &v) {
|
||||
|
||||
return LVecBase3f(v.getX(), v.getY(), v.getZ());
|
||||
return LVecBase3((PN_stdfloat)v.getX(),
|
||||
(PN_stdfloat)v.getY(),
|
||||
(PN_stdfloat)v.getZ());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: btVector3_to_LVector3f
|
||||
// Function: btVector3_to_LVector3
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LVector3f btVector3_to_LVector3f(const btVector3 &v) {
|
||||
LVector3 btVector3_to_LVector3(const btVector3 &v) {
|
||||
|
||||
return LVector3f(v.getX(), v.getY(), v.getZ());
|
||||
return LVector3((PN_stdfloat)v.getX(),
|
||||
(PN_stdfloat)v.getY(),
|
||||
(PN_stdfloat)v.getZ());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: btVector3_to_LPoint3f
|
||||
// Function: btVector3_to_LPoint3
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LPoint3f btVector3_to_LPoint3f(const btVector3 &p) {
|
||||
LPoint3 btVector3_to_LPoint3(const btVector3 &p) {
|
||||
|
||||
return LPoint3f(p.getX(), p.getY(), p.getZ());
|
||||
return LPoint3((PN_stdfloat)p.getX(),
|
||||
(PN_stdfloat)p.getY(),
|
||||
(PN_stdfloat)p.getZ());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: LMatrix3f_to_btMatrix3x3
|
||||
// Function: LMatrix3_to_btMatrix3x3
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
btMatrix3x3 LMatrix3f_to_btMatrix3x3(const LMatrix3f &m) {
|
||||
btMatrix3x3 LMatrix3_to_btMatrix3x3(const LMatrix3 &m) {
|
||||
|
||||
btMatrix3x3 result;
|
||||
result.setFromOpenGLSubMatrix(m.get_data());
|
||||
result.setFromOpenGLSubMatrix((const btScalar *)m.get_data());
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: btMatrix3x3_to_LMatrix3f
|
||||
// Function: btMatrix3x3_to_LMatrix3
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LMatrix3f btMatrix3x3_to_LMatrix3f(const btMatrix3x3 &m) {
|
||||
LMatrix3 btMatrix3x3_to_LMatrix3(const btMatrix3x3 &m) {
|
||||
|
||||
float cells[9];
|
||||
btScalar cells[9];
|
||||
m.getOpenGLSubMatrix(cells);
|
||||
return LMatrix3f(cells[0], cells[1], cells[2],
|
||||
cells[3], cells[4], cells[5],
|
||||
cells[6], cells[7], cells[8]);
|
||||
return LMatrix3((PN_stdfloat)cells[0], (PN_stdfloat)cells[1], (PN_stdfloat)cells[2],
|
||||
(PN_stdfloat)cells[3], (PN_stdfloat)cells[4], (PN_stdfloat)cells[5],
|
||||
(PN_stdfloat)cells[6], (PN_stdfloat)cells[7], (PN_stdfloat)cells[8]);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: LQuaternionf_to_btQuat
|
||||
// Function: LQuaternion_to_btQuat
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
btQuaternion LQuaternionf_to_btQuat(const LQuaternionf &q) {
|
||||
btQuaternion LQuaternion_to_btQuat(const LQuaternion &q) {
|
||||
|
||||
return btQuaternion(q.get_i(), q.get_j(), q.get_k(), q.get_r());
|
||||
return btQuaternion((btScalar)q.get_i(),
|
||||
(btScalar)q.get_j(),
|
||||
(btScalar)q.get_k(),
|
||||
(btScalar)q.get_r());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: btQuat_to_LQuaternionf
|
||||
// Function: btQuat_to_LQuaternion
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LQuaternionf btQuat_to_LQuaternionf(const btQuaternion &q) {
|
||||
LQuaternion btQuat_to_LQuaternion(const btQuaternion &q) {
|
||||
|
||||
return LQuaternionf(q.getW(), q.getX(), q.getY(), q.getZ());
|
||||
return LQuaternion((PN_stdfloat)q.getW(),
|
||||
(PN_stdfloat)q.getX(),
|
||||
(PN_stdfloat)q.getY(),
|
||||
(PN_stdfloat)q.getZ());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: LMatrix4f_to_btTrans
|
||||
// Function: LMatrix4_to_btTrans
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
btTransform LMatrix4f_to_btTrans(const LMatrix4f &m) {
|
||||
btTransform LMatrix4_to_btTrans(const LMatrix4 &m) {
|
||||
|
||||
LQuaternionf quat;
|
||||
LQuaternion quat;
|
||||
quat.set_from_matrix(m.get_upper_3());
|
||||
|
||||
btQuaternion btq = LQuaternionf_to_btQuat(quat);
|
||||
btVector3 btv = LVecBase3f_to_btVector3(m.get_row3(3));
|
||||
btQuaternion btq = LQuaternion_to_btQuat(quat);
|
||||
btVector3 btv = LVecBase3_to_btVector3(m.get_row3(3));
|
||||
|
||||
return btTransform(btq, btv);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: btTrans_to_LMatrix4f
|
||||
// Function: btTrans_to_LMatrix4
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
LMatrix4f btTrans_to_LMatrix4f(const btTransform &trans) {
|
||||
LMatrix4 btTrans_to_LMatrix4(const btTransform &trans) {
|
||||
|
||||
return TransformState::make_pos_quat_scale(
|
||||
btVector3_to_LVector3f(trans.getOrigin()),
|
||||
btQuat_to_LQuaternionf(trans.getRotation()),
|
||||
LVector3f(1.0f, 1.0f, 1.0f))->get_mat();
|
||||
btVector3_to_LVector3(trans.getOrigin()),
|
||||
btQuat_to_LQuaternion(trans.getRotation()),
|
||||
LVector3(1.0f, 1.0f, 1.0f))->get_mat();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: btTrans_to_TransformState
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
CPT(TransformState) btTrans_to_TransformState(const btTransform &trans, const LVecBase3f &scale) {
|
||||
CPT(TransformState) btTrans_to_TransformState(const btTransform &trans, const LVecBase3 &scale) {
|
||||
|
||||
LVecBase3f pos = btVector3_to_LVector3f(trans.getOrigin());
|
||||
LQuaternionf quat = btQuat_to_LQuaternionf(trans.getRotation());
|
||||
LVecBase3 pos = btVector3_to_LVector3(trans.getOrigin());
|
||||
LQuaternion quat = btQuat_to_LQuaternion(trans.getRotation());
|
||||
|
||||
return TransformState::make_pos_quat_scale(pos, quat, scale);
|
||||
}
|
||||
|
|
@ -141,13 +155,13 @@ btTransform TransformState_to_btTrans(CPT(TransformState) ts) {
|
|||
|
||||
ts = ts->set_scale(1.0);
|
||||
|
||||
LMatrix4f m = ts->get_mat();
|
||||
LMatrix4 m = ts->get_mat();
|
||||
|
||||
LQuaternionf quat;
|
||||
LQuaternion quat;
|
||||
quat.set_from_matrix(m.get_upper_3());
|
||||
|
||||
btQuaternion btq = LQuaternionf_to_btQuat(quat);
|
||||
btVector3 btv = LVecBase3f_to_btVector3(m.get_row3(3));
|
||||
btQuaternion btq = LQuaternion_to_btQuat(quat);
|
||||
btVector3 btv = LVecBase3_to_btVector3(m.get_row3(3));
|
||||
|
||||
return btTransform(btq, btv);
|
||||
}
|
||||
|
|
@ -193,13 +207,13 @@ void get_node_transform(btTransform &trans, PandaNode *node) {
|
|||
ts = ts->set_scale(1.0);
|
||||
|
||||
// Convert
|
||||
LMatrix4f m = ts->get_mat();
|
||||
LMatrix4 m = ts->get_mat();
|
||||
|
||||
LQuaternionf quat;
|
||||
LQuaternion quat;
|
||||
quat.set_from_matrix(m.get_upper_3());
|
||||
|
||||
btQuaternion btq = LQuaternionf_to_btQuat(quat);
|
||||
btVector3 btv = LVecBase3f_to_btVector3(m.get_row3(3));
|
||||
btQuaternion btq = LQuaternion_to_btQuat(quat);
|
||||
btVector3 btv = LVecBase3_to_btVector3(m.get_row3(3));
|
||||
|
||||
trans.setRotation(btq);
|
||||
trans.setOrigin(btv);
|
||||
|
|
|
|||
|
|
@ -28,22 +28,22 @@
|
|||
#include "nodePath.h"
|
||||
|
||||
// Conversion from Panda3D to Bullet
|
||||
EXPCL_PANDABULLET btVector3 LVecBase3f_to_btVector3(const LVecBase3f &v);
|
||||
EXPCL_PANDABULLET btMatrix3x3 LMatrix3f_to_btMatrix3x3(const LMatrix3f &m);
|
||||
EXPCL_PANDABULLET btTransform LMatrix4f_to_btTrans(const LMatrix4f &m);
|
||||
EXPCL_PANDABULLET btQuaternion LQuaternionf_to_btQuat(const LQuaternionf &q);
|
||||
EXPCL_PANDABULLET btVector3 LVecBase3_to_btVector3(const LVecBase3 &v);
|
||||
EXPCL_PANDABULLET btMatrix3x3 LMatrix3_to_btMatrix3x3(const LMatrix3 &m);
|
||||
EXPCL_PANDABULLET btTransform LMatrix4_to_btTrans(const LMatrix4 &m);
|
||||
EXPCL_PANDABULLET btQuaternion LQuaternion_to_btQuat(const LQuaternion &q);
|
||||
|
||||
// Conversion from Bullet to Panda3D
|
||||
EXPCL_PANDABULLET LVecBase3f btVector3_to_LVecBase3f(const btVector3 &v);
|
||||
EXPCL_PANDABULLET LVector3f btVector3_to_LVector3f(const btVector3 &v);
|
||||
EXPCL_PANDABULLET LPoint3f btVector3_to_LPoint3f(const btVector3 &p);
|
||||
EXPCL_PANDABULLET LMatrix3f btMatrix3x3_to_LMatrix3f(const btMatrix3x3 &m);
|
||||
EXPCL_PANDABULLET LMatrix4f btTrans_to_LMatrix4f(const btTransform &tf);
|
||||
EXPCL_PANDABULLET LQuaternionf btQuat_to_LQuaternionf(const btQuaternion &q);
|
||||
EXPCL_PANDABULLET LVecBase3 btVector3_to_LVecBase3(const btVector3 &v);
|
||||
EXPCL_PANDABULLET LVector3 btVector3_to_LVector3(const btVector3 &v);
|
||||
EXPCL_PANDABULLET LPoint3 btVector3_to_LPoint3(const btVector3 &p);
|
||||
EXPCL_PANDABULLET LMatrix3 btMatrix3x3_to_LMatrix3(const btMatrix3x3 &m);
|
||||
EXPCL_PANDABULLET LMatrix4 btTrans_to_LMatrix4(const btTransform &tf);
|
||||
EXPCL_PANDABULLET LQuaternion btQuat_to_LQuaternion(const btQuaternion &q);
|
||||
|
||||
EXPCL_PANDABULLET CPT(TransformState) btTrans_to_TransformState(
|
||||
const btTransform &tf,
|
||||
const LVecBase3f &scale=LVecBase3f(1.0f, 1.0f, 1.0f));
|
||||
const LVecBase3 &scale=LVecBase3(1.0f, 1.0f, 1.0f));
|
||||
|
||||
EXPCL_PANDABULLET btTransform TransformState_to_btTrans(
|
||||
CPT(TransformState) ts);
|
||||
|
|
|
|||
Loading…
Reference in New Issue