فهرست منبع

Update sample

Daniele Bartolini 10 سال پیش
والد
کامیت
6d18bda36d
2فایلهای تغییر یافته به همراه14 افزوده شده و 12 حذف شده
  1. 13 10
      samples/00-hello-world/camera.unit
  2. 1 2
      samples/00-hello-world/lua/game.lua

+ 13 - 10
samples/00-hello-world/camera.unit

@@ -1,12 +1,15 @@
-cameras = {
-	camera = {
-		node = "root"
-		type = "perspective"
-		near_clip_distance = 0.01
-		far_clip_distance = 1000.0
+components = {
+	"2de2052d-8256-4627-a7db-de8764afcab4" = {
+		type = "transform"
+		position = [0 0 0]
+		rotation = [0 0 1 0]
+		scale = [1 1 1]
+	}
+	"c3c601b0-1a96-42f1-8801-d95a75d8d184" = {
+		type = "camera"
+		projection = "perspective"
+		fov = 60.0
+		near_range = 0.01
+		far_range = 1000.0
 	}
 	}
-}
-
-nodes = {
-	root = { parent = null position = [0 0 0] rotation = [0 0 1 0] }
 }
 }

+ 1 - 2
samples/00-hello-world/lua/game.lua

@@ -8,8 +8,7 @@ function init()
 	-- Create world and camera
 	-- Create world and camera
 	world = Device.create_world()
 	world = Device.create_world()
 	local camera_unit = World.spawn_unit(world, "camera")
 	local camera_unit = World.spawn_unit(world, "camera")
-	camera = Unit.camera(camera_unit, "camera")
-	Camera.set_orthographic_metrics(camera, 0, 0, 1280, 720)
+	camera = World.camera(world, camera_unit)
 end
 end
 
 
 function update(dt)
 function update(dt)