本文整理汇总了Java中com.badlogic.gdx.math.Quaternion.getAxisAngle方法的典型用法代码示例。如果您正苦于以下问题:Java Quaternion.getAxisAngle方法的具体用法?Java Quaternion.getAxisAngle怎么用?Java Quaternion.getAxisAngle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.math.Quaternion
的用法示例。
在下文中一共展示了Quaternion.getAxisAngle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: click
import com.badlogic.gdx.math.Quaternion; //导入方法依赖的package包/类
public void click(int button) {
if (button == 6) {
logger.info("Freeze!");
for (WorldEntity entity : entities) {
entity.btRigidBody.clearForces();
entity.btRigidBody.setAngularVelocity(new Vector3(0, 0, 0));
entity.btRigidBody.setLinearVelocity(new Vector3(0, 0, 0));
}
}
if (lastHovered == null) {
return;
}
if (button == 3) {
Quaternion rotation = new Quaternion();
lastHovered.btRigidBody.getCenterOfMassTransform().getRotation(rotation);
Vector3 rot = new Vector3();
float axisAngle = rotation.getAxisAngle(rot);
Vector3 rotate = new Vector3(0f, 0, 10).rotate(rot, axisAngle);
// lastHovered.btRigidBody.applyCentralForce(rotate);
lastHovered.btRigidBody.applyForce(new Vector3(5, 0, 0), new Vector3(0, 0f, 2.5f));
} else if (button == 4) {
// lastHovered.btRigidBody.applyCentralImpulse(new Vector3(0, 0, 50f));
lastHovered.btRigidBody.applyTorqueImpulse(new Vector3(0, 5, 0f));
} else if (button == 5) {
lastHovered.btRigidBody.applyTorqueImpulse(new Vector3(0, 0, 500f));
}
}
示例2: SimulationData
import com.badlogic.gdx.math.Quaternion; //导入方法依赖的package包/类
public SimulationData(WheelWorld wheelWorld) {
position = new Vector3(wheelWorld.rim.rigidBody.getCenterOfMassPosition());
Quaternion q = new Quaternion();
rotation = new Vector3();
wheelWorld.rim.rigidBody.getCenterOfMassTransform().getRotation(q);
float f = q.getAxisAngle(rotation);
rotation.scl(f);
spokeForces = new float[wheelWorld.spokes.size()];
for (int i = 0; i < wheelWorld.spokes.size(); i++) {
spokeForces[i] = wheelWorld.spokes.get(i).currentForce;
}
}