本文整理汇总了Java中com.bulletphysics.collision.dispatch.CollisionObject.ISLAND_SLEEPING属性的典型用法代码示例。如果您正苦于以下问题:Java CollisionObject.ISLAND_SLEEPING属性的具体用法?Java CollisionObject.ISLAND_SLEEPING怎么用?Java CollisionObject.ISLAND_SLEEPING使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.bulletphysics.collision.dispatch.CollisionObject
的用法示例。
在下文中一共展示了CollisionObject.ISLAND_SLEEPING属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: synchronizeMotionStates
public void synchronizeMotionStates() {
Stack stack = Stack.enter();
Transform tmpTrans = stack.allocTransform();
// todo: iterate over awake simulation islands!
for (int i = 0; i < collisionObjects.size(); i++) {
CollisionObject colObj = collisionObjects.getQuick(i);
RigidBody body = RigidBody.upcast(colObj);
if (body != null && body.getMotionState() != null) {
if (body.getActivationState() != CollisionObject.ISLAND_SLEEPING) {
body.getMotionState().setWorldTransform(body.getWorldTransform(tmpTrans));
}
}
}
stack.leave();
}
示例2: saveKinematicState
protected void saveKinematicState (float timeStep) {
for (int i = 0; i < collisionObjects.size(); i++) {
CollisionObject colObj = collisionObjects.getQuick(i);
RigidBody body = RigidBody.upcast(colObj);
if (body != null) {
// Transform predictedTrans = new Transform();
if (body.getActivationState() != CollisionObject.ISLAND_SLEEPING) {
if (body.isKinematicObject()) {
// to calculate velocities next frame
body.saveKinematicState(timeStep);
}
}
}
}
}
示例3: 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();
}
}
示例4: saveKinematicState
protected void saveKinematicState(float timeStep) {
for (int i = 0; i < collisionObjects.size(); i++) {
CollisionObject colObj = collisionObjects.getQuick(i);
RigidBody body = RigidBody.upcast(colObj);
if (body != null) {
//Transform predictedTrans = new Transform();
if (body.getActivationState() != CollisionObject.ISLAND_SLEEPING) {
if (body.isKinematicObject()) {
// to calculate velocities next frame
body.saveKinematicState(timeStep);
}
}
}
}
}
示例5: 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();
}
}
示例6: synchronizeMotionStates
public void synchronizeMotionStates() {
Transform tmpTrans = Stack.alloc(Transform.class);
// todo: iterate over awake simulation islands!
for (int i = 0; i < collisionObjects.size(); i++) {
CollisionObject colObj = collisionObjects.getQuick(i);
RigidBody body = RigidBody.upcast(colObj);
if (body != null && body.getMotionState() != null) {
if (body.getActivationState() != CollisionObject.ISLAND_SLEEPING) {
body.getMotionState().setWorldTransform(body.getWorldTransform(tmpTrans));
}
}
}
}
示例7: saveKinematicState
protected void saveKinematicState(float timeStep) {
for (int i = 0; i < collisionObjects.size(); i++) {
CollisionObject colObj = collisionObjects.get(i);
RigidBody body = RigidBody.upcast(colObj);
if (body != null) {
//Transform predictedTrans = new Transform();
if (body.getActivationState() != CollisionObject.ISLAND_SLEEPING) {
if (body.isKinematicObject()) {
// to calculate velocities next frame
body.saveKinematicState(timeStep);
}
}
}
}
}
示例8: synchronizeMotionStates
public void synchronizeMotionStates() {
Transform tmpTrans = Stack.alloc(Transform.class);
// todo: iterate over awake simulation islands!
for (int i = 0; i < collisionObjects.size(); i++) {
CollisionObject colObj = collisionObjects.get(i);
RigidBody body = RigidBody.upcast(colObj);
if (body != null && body.getMotionState() != null) {
if (body.getActivationState() != CollisionObject.ISLAND_SLEEPING) {
body.getMotionState().setWorldTransform(body.getWorldTransform(tmpTrans));
}
}
}
}