mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-17 12:12:10 -04:00
Alternate CTOR for BulletHingeConstraint
This commit is contained in:
parent
f42eb3164c
commit
0a09dad23a
@ -19,6 +19,45 @@
|
||||
|
||||
TypeHandle BulletHingeConstraint::_type_handle;
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: BulletHingeConstraint::Constructor
|
||||
// Access: Published
|
||||
// Description: Creates a hinge constraint which connects one
|
||||
// rigid body with some fixe dpoint in the world.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
BulletHingeConstraint::
|
||||
BulletHingeConstraint(const BulletRigidBodyNode *node_a,
|
||||
const TransformState *ts_a,
|
||||
bool use_frame_a) {
|
||||
|
||||
btRigidBody *ptr_a = btRigidBody::upcast(node_a->get_object());
|
||||
btTransform frame_a = TransformState_to_btTrans(ts_a);
|
||||
|
||||
_constraint = new btHingeConstraint(*ptr_a, frame_a, use_frame_a);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: BulletHingeConstraint::Constructor
|
||||
// Access: Published
|
||||
// Description: Constructs a hinge constraint which connects two
|
||||
// rigid bodies.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
BulletHingeConstraint::
|
||||
BulletHingeConstraint(const BulletRigidBodyNode *node_a,
|
||||
const BulletRigidBodyNode *node_b,
|
||||
const TransformState *ts_a,
|
||||
const TransformState *ts_b,
|
||||
bool use_frame_a) {
|
||||
|
||||
btRigidBody *ptr_a = btRigidBody::upcast(node_a->get_object());
|
||||
btTransform frame_a = TransformState_to_btTrans(ts_a);
|
||||
|
||||
btRigidBody *ptr_b = btRigidBody::upcast(node_b->get_object());
|
||||
btTransform frame_b = TransformState_to_btTrans(ts_b);
|
||||
|
||||
_constraint = new btHingeConstraint(*ptr_a, *ptr_b, frame_a, frame_b, use_frame_a);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: BulletHingeConstraint::Constructor
|
||||
// Access: Published
|
||||
|
@ -45,6 +45,16 @@ PUBLISHED:
|
||||
const LVector3 &axis_a,
|
||||
const LVector3 &axis_b,
|
||||
bool use_frame_a=false);
|
||||
|
||||
BulletHingeConstraint(const BulletRigidBodyNode *node_a,
|
||||
const TransformState *ts_a,
|
||||
bool use_frame_a=false);
|
||||
BulletHingeConstraint(const BulletRigidBodyNode *node_a,
|
||||
const BulletRigidBodyNode *node_b,
|
||||
const TransformState *ts_a,
|
||||
const TransformState *ts_b,
|
||||
bool use_frame_a=false);
|
||||
|
||||
INLINE ~BulletHingeConstraint();
|
||||
|
||||
PN_stdfloat get_hinge_angle();
|
||||
|
Loading…
x
Reference in New Issue
Block a user