Merge branch 'feature/remove_3d' into feature/input_event_system

This commit is contained in:
2019-11-30 10:37:51 +07:00
25 changed files with 330 additions and 136 deletions

View File

@@ -11,7 +11,7 @@
"prototype" : "../prefabs/gnome_prefab.json",
"components" : {
"actor" : {
"translation" : [0,0,0],
"translation" : [0,0],
"scale" : 20
},
"behaviour" : {
@@ -28,7 +28,7 @@
"outline_color" : [0,0,0,255]
},
"actor" : {
"translation" : [-315,-235,0],
"translation" : [-315,-235],
"scale" : 1
},
"behaviour" : {

View File

@@ -8,7 +8,7 @@
"prototype" : "../prefabs/gnome_prefab.json",
"components" : {
"actor" : {
"translation" : [0,0,0],
"translation" : [0,0],
"scale" : 20
}
}
@@ -19,7 +19,7 @@
"blending" : "additive"
},
"actor" : {
"translation" : [-50,-50,0]
"translation" : [-50,-50]
}
}
}, {
@@ -29,7 +29,7 @@
"tint" : [255,0,0,255]
},
"actor" : {
"translation" : [50,-50,0]
"translation" : [50,-50]
}
}
}, {
@@ -42,7 +42,7 @@
"outline_color" : [0,0,0,255]
},
"actor" : {
"translation" : [0,180,0],
"translation" : [0,180],
"scale" : 3
}
}
@@ -56,7 +56,7 @@
"outline_color" : [0,0,0,255]
},
"actor" : {
"translation" : [0.5,-180.5,0],
"translation" : [0.5,-180.5],
"scale" : 3
}
}

View File

@@ -8,7 +8,7 @@
"prototype" : "../prefabs/coin_prefab.json",
"components" : {
"actor" : {
"translation" : [350,250,0],
"translation" : [350,250],
"scale" : 0.25
}
}
@@ -16,7 +16,7 @@
"prototype" : "../prefabs/raptor_prefab.json",
"components" : {
"actor" : {
"translation" : [300,-350,0],
"translation" : [300,-350],
"scale" : 0.25
}
}
@@ -24,7 +24,7 @@
"prototype" : "../prefabs/dragon_prefab.json",
"components" : {
"actor" : {
"translation" : [-100,0,0],
"translation" : [-100,0],
"scale" : 0.9
}
}

View File

@@ -4,7 +4,19 @@ local renderer = {
enabled = true,
---@type boolean
disabled = false
disabled = false,
---@type t3f
transform = t3f.identity(),
---@type v3f
translation = v3f.zero(),
---@type q4f
rotation = q4f.identity(),
---@type v3f
scale = v3f.unit()
}
---@overload fun(self: renderer)

View File

@@ -1,16 +1,19 @@
---@class node
local node = {
---@type t3f
transform = t3f.identity(),
---@type gobject
owner = nil,
---@type v3f
translation = v3f.zero(),
---@type t2f
transform = t2f.identity(),
---@type q4f
rotation = q4f.identity(),
---@type v2f
translation = v2f.zero(),
---@type v3f
scale = v3f.unit(),
---@type number
rotation = 0,
---@type v2f
scale = v2f.unit(),
---@type m4f
local_matrix = m4f.identity(),

View File

@@ -4,7 +4,7 @@ local world = {
---@overload fun(prefab: prefab): gobject
---@overload fun(prefab: prefab, parent: node): gobject
---@overload fun(prefab: prefab, parent: node, transform: t3f): gobject
---@overload fun(prefab: prefab, parent: node, transform: t2f): gobject
---@return gobject
function world:instantiate(...) end

View File

@@ -21,7 +21,7 @@ end
---@param go gobject
local function update_gnome_rotation(meta, go)
local time = the_engine.time
go.actor.node.rotation = q4f.make_from_euler_angles(0, time, 0)
go.renderer.rotation = q4f.make_from_euler_angles(0, time, 0)
end
-- -----------------------------------------------------------------------------