本文整理汇总了Java中com.bulletphysics.collision.dispatch.CollisionObject.DISABLE_DEACTIVATION属性的典型用法代码示例。如果您正苦于以下问题:Java CollisionObject.DISABLE_DEACTIVATION属性的具体用法?Java CollisionObject.DISABLE_DEACTIVATION怎么用?Java CollisionObject.DISABLE_DEACTIVATION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.bulletphysics.collision.dispatch.CollisionObject
的用法示例。
在下文中一共展示了CollisionObject.DISABLE_DEACTIVATION属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateActivationState
protected void updateActivationState (float timeStep) {
BulletStats.pushProfile("updateActivationState");
Stack stack = Stack.enter();
int sp = stack.getSp();
try {
Vector3 tmp = stack.allocVector3();
for (int i = 0; i < collisionObjects.size(); i++) {
CollisionObject colObj = collisionObjects.getQuick(i);
RigidBody body = RigidBody.upcast(colObj);
if (body != null) {
body.updateDeactivation(timeStep);
if (body.wantsSleeping()) {
if (body.isStaticOrKinematicObject()) {
body.setActivationState(CollisionObject.ISLAND_SLEEPING);
} else {
if (body.getActivationState() == CollisionObject.ACTIVE_TAG) {
body.setActivationState(CollisionObject.WANTS_DEACTIVATION);
}
if (body.getActivationState() == CollisionObject.ISLAND_SLEEPING) {
tmp.set(0f, 0f, 0f);
body.setAngularVelocity(tmp);
body.setLinearVelocity(tmp);
}
}
} else {
if (body.getActivationState() != CollisionObject.DISABLE_DEACTIVATION) {
body.setActivationState(CollisionObject.ACTIVE_TAG);
}
}
}
}
} finally {
stack.leave(sp);
BulletStats.popProfile();
}
}
示例2: updateActivationState
protected void updateActivationState(float timeStep) {
BulletStats.pushProfile("updateActivationState");
try {
Vector3f tmp = Stack.alloc(Vector3f.class);
for (int i=0; i<collisionObjects.size(); i++) {
CollisionObject colObj = collisionObjects.getQuick(i);
RigidBody body = RigidBody.upcast(colObj);
if (body != null) {
body.updateDeactivation(timeStep);
if (body.wantsSleeping()) {
if (body.isStaticOrKinematicObject()) {
body.setActivationState(CollisionObject.ISLAND_SLEEPING);
}
else {
if (body.getActivationState() == CollisionObject.ACTIVE_TAG) {
body.setActivationState(CollisionObject.WANTS_DEACTIVATION);
}
if (body.getActivationState() == CollisionObject.ISLAND_SLEEPING) {
tmp.set(0f, 0f, 0f);
body.setAngularVelocity(tmp);
body.setLinearVelocity(tmp);
}
}
}
else {
if (body.getActivationState() != CollisionObject.DISABLE_DEACTIVATION) {
body.setActivationState(CollisionObject.ACTIVE_TAG);
}
}
}
}
}
finally {
BulletStats.popProfile();
}
}
示例3: updateActivationState
protected void updateActivationState(float timeStep) {
BulletStats.pushProfile("updateActivationState");
try {
for (int i = 0; i < collisionObjects.size(); i++) {
CollisionObject colObj = collisionObjects.get(i);
RigidBody body = RigidBody.upcast(colObj);
if (body != null) {
body.updateDeactivation(timeStep);
if (body.wantsSleeping()) {
if (body.isStaticOrKinematicObject()) {
body.setActivationState(CollisionObject.ISLAND_SLEEPING);
}
else {
if (body.getActivationState() == CollisionObject.ACTIVE_TAG) {
body.setActivationState(CollisionObject.WANTS_DEACTIVATION);
}
}
}
else {
if (body.getActivationState() != CollisionObject.DISABLE_DEACTIVATION) {
body.setActivationState(CollisionObject.ACTIVE_TAG);
}
}
}
}
}
finally {
BulletStats.popProfile();
}
}