本文整理匯總了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;
}