本文整理汇总了Java中com.bulletphysics.collision.dispatch.CollisionObject.setInterpolationWorldTransform方法的典型用法代码示例。如果您正苦于以下问题:Java CollisionObject.setInterpolationWorldTransform方法的具体用法?Java CollisionObject.setInterpolationWorldTransform怎么用?Java CollisionObject.setInterpolationWorldTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.bulletphysics.collision.dispatch.CollisionObject
的用法示例。
在下文中一共展示了CollisionObject.setInterpolationWorldTransform方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clientResetScene
import com.bulletphysics.collision.dispatch.CollisionObject; //导入方法依赖的package包/类
public void clientResetScene() {
//#ifdef SHOW_NUM_DEEP_PENETRATIONS
BulletStats.gNumDeepPenetrationChecks = 0;
BulletStats.gNumGjkChecks = 0;
//#endif //SHOW_NUM_DEEP_PENETRATIONS
int numObjects = 0;
if (dynamicsWorld != null) {
dynamicsWorld.stepSimulation(1f / 60f, 0);
numObjects = dynamicsWorld.getNumCollisionObjects();
}
for (int i = 0; i < numObjects; i++) {
CollisionObject colObj = dynamicsWorld.getCollisionObjectArray().get(i);
RigidBody body = RigidBody.upcast(colObj);
if (body != null) {
if (body.getMotionState() != null) {
DefaultMotionState myMotionState = (DefaultMotionState) body.getMotionState();
myMotionState.graphicsWorldTrans.set(myMotionState.startWorldTrans);
colObj.setWorldTransform(myMotionState.graphicsWorldTrans);
colObj.setInterpolationWorldTransform(myMotionState.startWorldTrans);
colObj.activate();
}
// removed cached contact points
dynamicsWorld.getBroadphase().getOverlappingPairCache().cleanProxyFromPairs(colObj.getBroadphaseHandle(), getDynamicsWorld().getDispatcher());
body = RigidBody.upcast(colObj);
if (body != null && !body.isStaticObject()) {
RigidBody.upcast(colObj).setLinearVelocity(new Vector3f(0f, 0f, 0f));
RigidBody.upcast(colObj).setAngularVelocity(new Vector3f(0f, 0f, 0f));
}
}
/*
//quickly search some issue at a certain simulation frame, pressing space to reset
int fixed=18;
for (int i=0;i<fixed;i++)
{
getDynamicsWorld()->stepSimulation(1./60.f,1);
}
*/
}
}
示例2: clientResetScene
import com.bulletphysics.collision.dispatch.CollisionObject; //导入方法依赖的package包/类
public void clientResetScene() {
//#ifdef SHOW_NUM_DEEP_PENETRATIONS
BulletStats.gNumDeepPenetrationChecks = 0;
BulletStats.gNumGjkChecks = 0;
//#endif //SHOW_NUM_DEEP_PENETRATIONS
int numObjects = 0;
if (dynamicsWorld != null) {
dynamicsWorld.stepSimulation(1f / 60f, 0);
numObjects = dynamicsWorld.getNumCollisionObjects();
}
for (int i = 0; i < numObjects; i++) {
CollisionObject colObj = dynamicsWorld.getCollisionObjectArray().getQuick(i);
RigidBody body = RigidBody.upcast(colObj);
if (body != null) {
if (body.getMotionState() != null) {
DefaultMotionState myMotionState = (DefaultMotionState) body.getMotionState();
myMotionState.graphicsWorldTrans.set(myMotionState.startWorldTrans);
colObj.setWorldTransform(myMotionState.graphicsWorldTrans);
colObj.setInterpolationWorldTransform(myMotionState.startWorldTrans);
colObj.activate();
}
// removed cached contact points
dynamicsWorld.getBroadphase().getOverlappingPairCache().cleanProxyFromPairs(colObj.getBroadphaseHandle(), getDynamicsWorld().getDispatcher());
body = RigidBody.upcast(colObj);
if (body != null && !body.isStaticObject()) {
RigidBody.upcast(colObj).setLinearVelocity(new Vector3f(0f, 0f, 0f));
RigidBody.upcast(colObj).setAngularVelocity(new Vector3f(0f, 0f, 0f));
}
}
/*
//quickly search some issue at a certain simulation frame, pressing space to reset
int fixed=18;
for (int i=0;i<fixed;i++)
{
getDynamicsWorld()->stepSimulation(1./60.f,1);
}
*/
}
}