本文整理汇总了C++中BasicShape::GetBody方法的典型用法代码示例。如果您正苦于以下问题:C++ BasicShape::GetBody方法的具体用法?C++ BasicShape::GetBody怎么用?C++ BasicShape::GetBody使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BasicShape
的用法示例。
在下文中一共展示了BasicShape::GetBody方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Create
void RevoluteJoint::Create(b2World &world,
const BasicShape &joinedBody1,
const BasicShape &joinedBody2,
const b2Vec2 &anchor1,
const b2Vec2 &anchor2,
const bool collideConnected,
const float lowerAngle,
const float upperAngle,
const bool enableLimit,
const float maxMotorTorque,
const float motorSpeed,
const bool enableMotor,
const float referenceAngle)
{
b_ptrJoinedBody1 = const_cast<b2Body*>(joinedBody1.GetBody());
b_ptrJoinedBody2 = const_cast<b2Body*>(joinedBody2.GetBody());
//b2RevoluteJointDef revoluteJointDefinition;
_revoluteJointDefinition.bodyA = b_ptrJoinedBody1;
_revoluteJointDefinition.bodyB = b_ptrJoinedBody2;
_revoluteJointDefinition.localAnchorA = anchor1;
_revoluteJointDefinition.localAnchorB = anchor2;
_revoluteJointDefinition.collideConnected = collideConnected;
_revoluteJointDefinition.lowerAngle = lowerAngle;
_revoluteJointDefinition.upperAngle = upperAngle;
_revoluteJointDefinition.enableLimit = enableLimit;
_revoluteJointDefinition.maxMotorTorque = maxMotorTorque;
_revoluteJointDefinition.motorSpeed = motorSpeed;
_revoluteJointDefinition.enableMotor = enableMotor;
_revoluteJointDefinition.referenceAngle = referenceAngle;
b_ptrJoint = world.CreateJoint(&_revoluteJointDefinition);
}