本文整理汇总了Java中com.badlogic.gdx.graphics.g3d.ModelInstance.calculateTransforms方法的典型用法代码示例。如果您正苦于以下问题:Java ModelInstance.calculateTransforms方法的具体用法?Java ModelInstance.calculateTransforms怎么用?Java ModelInstance.calculateTransforms使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.graphics.g3d.ModelInstance
的用法示例。
在下文中一共展示了ModelInstance.calculateTransforms方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyTransform
import com.badlogic.gdx.graphics.g3d.ModelInstance; //导入方法依赖的package包/类
public static void applyTransform(Vector3 location, Vector3 rotation, Vector3 scale,
ModelInstance modelInstance) {
for (Node node : modelInstance.nodes) {
node.scale.set(Math.abs(scale.x), Math.abs(scale.y), Math.abs(scale.z));
}
modelInstance.transform.rotate(Vector3.X, rotation.x);
modelInstance.transform.rotate(Vector3.Z, rotation.z);
modelInstance.transform.rotate(Vector3.Y, rotation.y);
modelInstance.transform.setTranslation(location);
modelInstance.calculateTransforms();
}
示例2: doneLoading
import com.badlogic.gdx.graphics.g3d.ModelInstance; //导入方法依赖的package包/类
private void doneLoading () {
Model model = assets.get("data/g3d/invaders.g3dj", Model.class);
for (int i = 0; i < model.nodes.size; i++) {
String id = model.nodes.get(i).id;
ModelInstance instance = new ModelInstance(model, id);
Node node = instance.getNode(id);
instance.transform.set(node.globalTransform);
node.translation.set(0, 0, 0);
node.scale.set(1, 1, 1);
node.rotation.idt();
instance.calculateTransforms();
if (id.equals("space")) {
space = instance;
continue;
}
instances.add(instance);
if (id.equals("ship"))
ship = instance;
else if (id.startsWith("block"))
blocks.add(instance);
else if (id.startsWith("invader")) invaders.add(instance);
}
loading = false;
}