package.path=package.path..";C:\\Users\\micro\\AppData\\Roaming\\com.nesbox.tic\\TIC-80\\rift\\?.lua"	-- jtruk
package.path=package.path..";C:\\Users\\Ronan\\AppData\\Roaming\\com.nesbox.tic\\TIC-80\\rift\\?.lua"	-- Mantratronic
package.path=package.path..";C:\\Users\\Matt\\AppData\\Roaming\\com.nesbox.tic\\TIC-80\\rift\\?.lua"	-- jynx

local R={}
require("./sys/sys")(R)
require("./3d/geom")(R)
require("./3d/model")(R)
require("./3d/scene")(R)

local MODEL=nil
local SCENE=nil
local ACTOR=nil

function BOOT()
	MODEL=R.Model:new()
	local data=require("./data/model/anim-test")
	MODEL:load(data)
	MODEL:setDrawFn(R.poly.DrawDebug,R.Model.Z_SORT|R.Model.CALC_NORMAL)

	SCENE=R.Scene:new()

	local scale=1
	local matModel=R.M44:new(R.M44.ID)
	matModel:mulM44(R.M44:newTrans(0,0,6))
	matModel:mulM44(R.M44:newScale(scale,scale,scale))
	matModel:mulM44(R.M44:newRotX(math.pi))

	ACTOR=R.Actor:new(MODEL,matModel)
	SCENE:addActor(ACTOR)
end

function TIC()
	R.tryBreak()
	
	cls(0)

    -- Shouldn't hack really!
	--[[
    ACTOR.mat.e[2][2]=math.cos(time()/1000)
    ACTOR.mat.e[2][3]=-math.sin(time()/1000)
    ACTOR.mat.e[3][2]=math.sin(time()/1000)
    ACTOR.mat.e[3][3]=math.cos(time()/1000)
	--]]
	SCENE:draw()
end

-- <PALETTE>
-- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
-- </PALETTE>
