Example Camera
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
const e = Entity.create();
|
||||
const pos = e.add(Component.POSITION);
|
||||
pos.localPosition = new Vec3(-1, 0, 1);
|
||||
Console.print('Entity ID: ' + e.toString());
|
||||
const cam = Entity.create();
|
||||
const pos = cam.add(Component.POSITION);
|
||||
cam.add(Component.CAMERA);
|
||||
|
||||
pos.localPosition = new Vec3(3, 3, 3);
|
||||
pos.lookAt(new Vec3(0, 0, 0));
|
||||
|
||||
Console.print('Camera entity ID: ' + cam.toString());
|
||||
|
||||
Reference in New Issue
Block a user