本文整理汇总了Java中com.bulletphysics.collision.dispatch.CollisionObjectType.RIGID_BODY属性的典型用法代码示例。如果您正苦于以下问题:Java CollisionObjectType.RIGID_BODY属性的具体用法?Java CollisionObjectType.RIGID_BODY怎么用?Java CollisionObjectType.RIGID_BODY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.bulletphysics.collision.dispatch.CollisionObjectType
的用法示例。
在下文中一共展示了CollisionObjectType.RIGID_BODY属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: upcast
/** To keep collision detection and dynamics separate we don't store a rigidbody pointer, but a rigidbody is derived from
* CollisionObject, so we can safely perform an upcast. */
public static RigidBody upcast (CollisionObject colObj) {
if (colObj.getInternalType() == CollisionObjectType.RIGID_BODY) {
return (RigidBody)colObj;
}
return null;
}
示例2: upcast
/**
* To keep collision detection and dynamics separate we don't store a rigidbody pointer,
* but a rigidbody is derived from CollisionObject, so we can safely perform an upcast.
*/
public static RigidBody upcast(CollisionObject colObj) {
if (colObj.getInternalType() == CollisionObjectType.RIGID_BODY) {
return (RigidBody)colObj;
}
return null;
}
示例3: setupRigidBody
private void setupRigidBody (RigidBodyConstructionInfo constructionInfo) {
internalType = CollisionObjectType.RIGID_BODY;
linearVelocity.set(0f, 0f, 0f);
angularVelocity.set(0f, 0f, 0f);
linearFactor.set(1f, 1f, 1f);
angularFactor.set(1f, 1f, 1f);
gravity.set(0f, 0f, 0f);
totalForce.set(0f, 0f, 0f);
totalTorque.set(0f, 0f, 0f);
linearDamping = 0f;
angularDamping = 0.5f;
linearSleepingThreshold = constructionInfo.linearSleepingThreshold;
angularSleepingThreshold = constructionInfo.angularSleepingThreshold;
optionalMotionState = constructionInfo.motionState;
contactSolverType = 0;
frictionSolverType = 0;
additionalDamping = constructionInfo.additionalDamping;
additionalDampingFactor = constructionInfo.additionalDampingFactor;
additionalLinearDampingThresholdSqr = constructionInfo.additionalLinearDampingThresholdSqr;
additionalAngularDampingThresholdSqr = constructionInfo.additionalAngularDampingThresholdSqr;
additionalAngularDampingFactor = constructionInfo.additionalAngularDampingFactor;
if (optionalMotionState != null) {
optionalMotionState.getWorldTransform(worldTransform);
} else {
worldTransform.set(constructionInfo.startWorldTransform);
}
interpolationWorldTransform.set(worldTransform);
interpolationLinearVelocity.set(0f, 0f, 0f);
interpolationAngularVelocity.set(0f, 0f, 0f);
// moved to CollisionObject
friction = constructionInfo.friction;
restitution = constructionInfo.restitution;
setCollisionShape(constructionInfo.collisionShape);
debugBodyId = uniqueId++;
setMassProps(constructionInfo.mass, constructionInfo.localInertia);
setDamping(constructionInfo.linearDamping, constructionInfo.angularDamping);
updateInertiaTensor();
}
示例4: setupRigidBody
private void setupRigidBody(RigidBodyConstructionInfo constructionInfo) {
internalType = CollisionObjectType.RIGID_BODY;
linearVelocity.set(0f, 0f, 0f);
angularVelocity.set(0f, 0f, 0f);
angularFactor = 1f;
gravity.set(0f, 0f, 0f);
totalForce.set(0f, 0f, 0f);
totalTorque.set(0f, 0f, 0f);
linearDamping = 0f;
angularDamping = 0.5f;
linearSleepingThreshold = constructionInfo.linearSleepingThreshold;
angularSleepingThreshold = constructionInfo.angularSleepingThreshold;
optionalMotionState = constructionInfo.motionState;
contactSolverType = 0;
frictionSolverType = 0;
additionalDamping = constructionInfo.additionalDamping;
additionalDampingFactor = constructionInfo.additionalDampingFactor;
additionalLinearDampingThresholdSqr = constructionInfo.additionalLinearDampingThresholdSqr;
additionalAngularDampingThresholdSqr = constructionInfo.additionalAngularDampingThresholdSqr;
additionalAngularDampingFactor = constructionInfo.additionalAngularDampingFactor;
if (optionalMotionState != null)
{
optionalMotionState.getWorldTransform(worldTransform);
} else
{
worldTransform.set(constructionInfo.startWorldTransform);
}
interpolationWorldTransform.set(worldTransform);
interpolationLinearVelocity.set(0f, 0f, 0f);
interpolationAngularVelocity.set(0f, 0f, 0f);
// moved to CollisionObject
friction = constructionInfo.friction;
restitution = constructionInfo.restitution;
setCollisionShape(constructionInfo.collisionShape);
debugBodyId = uniqueId++;
setMassProps(constructionInfo.mass, constructionInfo.localInertia);
setDamping(constructionInfo.linearDamping, constructionInfo.angularDamping);
updateInertiaTensor();
}
示例5: setupRigidBody
public void setupRigidBody(RigidBodyConstructionInfo constructionInfo) {
internalType = CollisionObjectType.RIGID_BODY;
linearVelocity.set(0f, 0f, 0f);
angularVelocity.set(0f, 0f, 0f);
angularFactor.set(1, 1, 1);
linearFactor.set(1, 1, 1);
gravity.set(0f, 0f, 0f);
totalForce.set(0f, 0f, 0f);
totalTorque.set(0f, 0f, 0f);
linearDamping = 0f;
angularDamping = 0.5f;
linearSleepingThreshold = constructionInfo.linearSleepingThreshold;
angularSleepingThreshold = constructionInfo.angularSleepingThreshold;
optionalMotionState = constructionInfo.motionState;
contactSolverType = 0;
frictionSolverType = 0;
additionalDamping = constructionInfo.additionalDamping;
additionalDampingFactor = constructionInfo.additionalDampingFactor;
additionalLinearDampingThresholdSqr = constructionInfo.additionalLinearDampingThresholdSqr;
additionalAngularDampingThresholdSqr = constructionInfo.additionalAngularDampingThresholdSqr;
additionalAngularDampingFactor = constructionInfo.additionalAngularDampingFactor;
if (optionalMotionState != null)
{
optionalMotionState.getWorldTransform(worldTransform);
} else
{
worldTransform.set(constructionInfo.startWorldTransform);
}
interpolationWorldTransform.set(worldTransform);
interpolationLinearVelocity.set(0f, 0f, 0f);
interpolationAngularVelocity.set(0f, 0f, 0f);
// moved to CollisionObject
friction = constructionInfo.friction;
restitution = constructionInfo.restitution;
setCollisionShape(constructionInfo.collisionShape);
debugBodyId = uniqueId++;
setMassProps(constructionInfo.mass, constructionInfo.localInertia);
setDamping(constructionInfo.linearDamping, constructionInfo.angularDamping);
updateInertiaTensor();
}