summaryrefslogtreecommitdiff
path: root/common/pieceinf.h
diff options
context:
space:
mode:
authorleo2006-01-24 04:48:40 +0000
committerleo2006-01-24 04:48:40 +0000
commit3cf202f177cffb3b962420933ab8d9481b0d8f32 (patch)
treebb3b66c0f6948443b4b6230841d8e39ad737cafd /common/pieceinf.h
parent8773592dd2a7f096b29d91b750437ac60b4584f8 (diff)
Added the ability to zoom and rotate the Piece Preview.
git-svn-id: http://svn.leocad.org/trunk@460 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common/pieceinf.h')
-rw-r--r--common/pieceinf.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/common/pieceinf.h b/common/pieceinf.h
index a4ea314..9dd3d94 100644
--- a/common/pieceinf.h
+++ b/common/pieceinf.h
@@ -9,6 +9,7 @@
#ifndef GLuint
#include "opengl.h"
#endif
+#include "algebra.h"
#define LC_PIECE_COUNT 0x01 // Count this piece in the totals ?
#define LC_PIECE_LONGDATA 0x02 // unsigned long/short index
@@ -72,8 +73,15 @@ class PieceInfo
return (m_strDescription[0] == '~');
}
+ Point3 GetCenter() const
+ {
+ return Point3((m_fDimensions[0] + m_fDimensions[3]) * 0.5f,
+ (m_fDimensions[1] + m_fDimensions[4]) * 0.5f,
+ (m_fDimensions[2] + m_fDimensions[5]) * 0.5f);
+ }
+
// Operations
- void ZoomExtents(float Fov, float Aspect);
+ void ZoomExtents(float Fov, float Aspect, float* EyePos = NULL) const;
void RenderOnce(int nColor);
void RenderPiece(int nColor);
void WriteWavefront(FILE* file, unsigned char color, unsigned long* start);