22 lines
373 B
Lua
22 lines
373 B
Lua
local Cube = {}
|
|
Cube.__index = Cube
|
|
|
|
function Cube.new()
|
|
local self = setmetatable({}, Cube)
|
|
self.id = entityAdd()
|
|
local pos = entityPositionAdd(self.id)
|
|
pos.x = 0
|
|
pos.y = 0
|
|
pos.z = 0
|
|
entityMeshAdd(self.id)
|
|
local mat = entityMaterialAdd(self.id)
|
|
mat.color = colorWhite()
|
|
return self
|
|
end
|
|
|
|
function Cube:dispose()
|
|
entityRemove(self.id)
|
|
end
|
|
|
|
return Cube
|