|
From: Tapio V. <aa...@us...> - 2009-12-11 12:44:27
|
Module: performous
Branch: dance
Commit: d88cb93f5db8961e18086a0eead2273279199193
Author: Tapio Vierros <tap...@gm...>
Date: Wed Dec 2 11:17:05 2009 +0200
Scaling capability for 3dObject::draw()
---
game/3dobject.hh | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/game/3dobject.hh b/game/3dobject.hh
index 585084b..8761ca6 100644
--- a/game/3dobject.hh
+++ b/game/3dobject.hh
@@ -63,12 +63,14 @@ class Object3d: boost::noncopyable {
generateDisplayList();
}
/// draws the object
- void draw(float x = 0, float y = 0, float z = 0) const {
+ void draw(float x = 0, float y = 0, float z = 0, float s = 1.0) const {
glTranslatef(x, y, z);
+ if (s != 1.0) glScalef(s,s,s);
if (m_texture) {
UseTexture tex(*m_texture);
glCallList(m_displist);
} else glCallList(m_displist);
+ if (s != 1.0) { float ss = 1.0/s; glScalef(ss,ss,ss); }
glTranslatef(-x, -y, -z);
}
};
|