added initial support for reference objects
git-svn-id: svn://anubis/anaglym/trunk@241 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
1 parent
9d9c16f3ad
commit
9058dcfefc
15 files changed
+289
-177
No files matched your search
@@ -63,17 +63,17 @@ function setupScore()
|
||||
end
|
||||
|
||||
function init_event()
|
||||
lane = ag.loadModelStatic("bowling_lane")
|
||||
lane = ag.loadModel("bowling_lane", {static = true})
|
||||
local minx, miny, minz, maxx, maxy, maxz = lane:getAABB()
|
||||
local lane_bottom = minz
|
||||
local lane_top = maxz
|
||||
pins = {}
|
||||
reference_pin = ag.loadModel("bowling_pin", 1.0/4.3)
|
||||
reference_pin = ag.loadModel("bowling_pin", {scale = 1.0/4.3})
|
||||
minx, miny, minz, maxx, maxy, maxz = reference_pin:getAABB()
|
||||
pin_minz = minz
|
||||
pin_maxz = maxz
|
||||
pin_standing_position = lane_top - pin_minz
|
||||
local box = ag.createBoxStatic(1, 10, 0.1)
|
||||
local box = ag.createBox(1, 10, 0.1, {static = true})
|
||||
box:setVisible(false)
|
||||
box:setPosition(0, 0, lane_bottom - (maxz - minz) - 0.4)
|
||||
reference_pin:setPosition(0, 0, lane_bottom - maxz - 0.1)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
function createWorld()
|
||||
board = ag.createBoxStatic(8, 8, 0.01)
|
||||
board = ag.createBox(8, 8, 0.01, {static = true})
|
||||
board:setPosition(0, 0, -0.005)
|
||||
board:setTexture(checker)
|
||||
board:setTextureScale(2)
|
||||
|
||||
+2
-2
@@ -70,7 +70,7 @@ end
|
||||
-- model_name: the string containing the name of the model to load
|
||||
-- max_x, max_y, max_z:
|
||||
std.loadModelBounds = function(model_name, max_x, max_y, max_z)
|
||||
local tmp_model = ag.loadModel(model_name)
|
||||
local tmp_model = ag.loadModel(model_name, {reference = true})
|
||||
local sx, sy, sz = tmp_model:getSize()
|
||||
tmp_model:destroy()
|
||||
local scale = 1.0
|
||||
@@ -93,5 +93,5 @@ std.loadModelBounds = function(model_name, max_x, max_y, max_z)
|
||||
scale_set = true
|
||||
end
|
||||
end
|
||||
return ag.loadModel(model_name, scale)
|
||||
return ag.loadModel(model_name, {scale = scale})
|
||||
end
|
||||
Reference in new issue
Block a user