本文整理汇总了Java中com.bulletphysics.collision.dispatch.CollisionObjectType类的典型用法代码示例。如果您正苦于以下问题:Java CollisionObjectType类的具体用法?Java CollisionObjectType怎么用?Java CollisionObjectType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CollisionObjectType类属于com.bulletphysics.collision.dispatch包,在下文中一共展示了CollisionObjectType类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: upcast
import com.bulletphysics.collision.dispatch.CollisionObjectType; //导入依赖的package包/类
/** 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
import com.bulletphysics.collision.dispatch.CollisionObjectType; //导入依赖的package包/类
/**
* 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
import com.bulletphysics.collision.dispatch.CollisionObjectType; //导入依赖的package包/类
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
import com.bulletphysics.collision.dispatch.CollisionObjectType; //导入依赖的package包/类
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
import com.bulletphysics.collision.dispatch.CollisionObjectType; //导入依赖的package包/类
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();
}