将模型对象附加到SCNNode

时间:2018-09-05 20:04:33

标签: scenekit arkit scenekit-modelio

如何将模型对象(location.reload(true) )附加到场景节点(public class MyClass { private static final int STARTX = 100; private static final int STARTY = 50; public static void main(String args[]) { int width = 1000; int height = 1000; World w = new World(width, height); //create a turtle at the starting x and starting y pos Turtle t = new Turtle(STARTX, STARTY, w); System.out.println(t.getSTARTX() + " : " + t.getSTARTY() + " : " + t.getWorld().getLength() + " : " + t.getWorld().getWidth()); } } class World { private double width; private double length; public World () { this.width = 0.0; this.length = 0.0; } public World (double width, double length) { this.width = width; this.length = length; } public double getWidth () { return this.width; } public double getLength () { return this.length; } public void setWidth (double width){ this.width = width; } public void setLength(double length){ this.length = length; } } class Turtle { private double STARTX; private double STARTY; private World world; public Turtle () { this.STARTX = 0.0; this.STARTY = 0.0; this.world = new World(); } public Turtle (double STARTX, double STARTY, World w) { this.STARTX = STARTX; this.STARTY = STARTY; this.world = w; } public double getSTARTX () { return this.STARTX; } public double getSTARTY () { return this.STARTY; } public World getWorld(){ return this.world; } public void setSTARTX (double STARTX){ this.STARTX = STARTX; } public void setSTARTY(double STARTY){ this.STARTY = STARTY; } public void setWorld (World world){ this.world = world; } } )? 我知道可以使用的静态便捷方法:

MDLObject

但是,这对我不起作用,因为我将SCNNode子类化,并且我需要调用指定的初始化程序,并且仍然能够将模型对象附加到节点上。

0 个答案:

没有答案