From 02f02f6500df1c3683cbf173a620557b8827ebd1 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sat, 2 Jan 2010 06:16:56 +0000 Subject: [PATCH] updated todo git-svn-id: svn://anubis/anaglym/trunk@224 99a6e188-d820-4881-8870-2d33a10e2619 --- .todo | 1 - Engine.cc | 4 ++++ lib/demo/checkers.lua | 6 ++++++ tests/bowling.lua | 10 ++++------ 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.todo b/.todo index c3e5df9..98cc554 100644 --- a/.todo +++ b/.todo @@ -1,2 +1 @@ -- rapid prototyping demo - support reference objects diff --git a/Engine.cc b/Engine.cc index bbc19b2..806edfe 100644 --- a/Engine.cc +++ b/Engine.cc @@ -1414,6 +1414,7 @@ void Engine::Object::draw() { glPushAttrib(GL_TRANSFORM_BIT); glEnable(GL_NORMALIZE); + glPushMatrix(); glScalef(m_scale, m_scale, m_scale); } @@ -1422,7 +1423,10 @@ void Engine::Object::draw() checkGLError(); if (m_is_scaled) + { + glPopMatrix(); glPopAttrib(); + } if (transform) glPopMatrix(); diff --git a/lib/demo/checkers.lua b/lib/demo/checkers.lua index 6bac0d0..f9a3e06 100644 --- a/lib/demo/checkers.lua +++ b/lib/demo/checkers.lua @@ -13,3 +13,9 @@ function init_event() checker = ag.loadTexture("checker.jpg") createWorld() end + +function reinit_event() + ball = ag.createSphere(0.5) + ball:setColor(1, 1, 0) + ball:setPosition(3, 3, 4) +end diff --git a/tests/bowling.lua b/tests/bowling.lua index 7cd2726..dda6cf0 100644 --- a/tests/bowling.lua +++ b/tests/bowling.lua @@ -1,5 +1,7 @@ function init_event() + ag.import("std") + local rows = 5 local offset = 1 local pin = ag.loadModel("bowling_pin", 0.5) @@ -22,13 +24,9 @@ function init_event() ball = ag.loadModel("checkerball", 0.5) ball:setPosition(2*camx - cx, 2*camy - cy, 2*camz - cz) ball:setMass(5) - --ball = ag.createSphere(0.4) - --ball:setColor(0.2, 0.2, 0.9) --- local crate = ag.loadModel("crate") --- crate:setPosition(0, 20, 10) - --- crate_texture = ag.loadTexture("crate.png") + smallPin = std.loadModelBounds("bowling_pin", 0, 0, 1) + smallPin:setPosition(0, -1, 1) end function mousebutton_down_event(button)