summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2008-05-14 12:00:23 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2008-05-14 12:00:23 (GMT)
commitd46ec98f6dc5156c98a37b1c4232f56bc0583a22 (patch)
tree6f9ea458105ac4361ba1f7b98028c7ff72aa2dc0
parent8cef9d148f2eb1d8cdd6041b10ba81f6f656f2ba (diff)
download2iv55-d46ec98f6dc5156c98a37b1c4232f56bc0583a22.zip
2iv55-d46ec98f6dc5156c98a37b1c4232f56bc0583a22.tar.gz
2iv55-d46ec98f6dc5156c98a37b1c4232f56bc0583a22.tar.bz2
moved more cruft
-rw-r--r--matchblox/typedefs.h128
1 files changed, 0 insertions, 128 deletions
diff --git a/matchblox/typedefs.h b/matchblox/typedefs.h
deleted file mode 100644
index 0262c14..0000000
--- a/matchblox/typedefs.h
+++ /dev/null
@@ -1,128 +0,0 @@
-#ifndef TYPEDEFS_H
-
-#define TYPEDEFS_H
-
-#include <vector>
-#include <limits>
-
-typedef struct bb
-{
- bb() {
- //init a bounding box with the min values set to max double and visa versa
- m_dLeft = m_dBottom = m_dFront = std::numeric_limits<double>::max();
- m_dRight = m_dTop = m_dBack = -std::numeric_limits<double>::max();
- }
-
- double m_dLeft, //min x
- m_dBottom, //min y
- m_dFront, //min z
- m_dRight, //max x
- m_dTop, //max y
- m_dBack; //max z
-
-} BoundingBox_t;
-
-typedef struct vec3d
-{
- double x, y, z;
-
- //constructors
- vec3d()
- { x=0.0, y=0.0, z=0.0; }
- vec3d(double fx, double fy, double fz)
- { x=fx, y=fy, z=fz; }
- vec3d(const vec3d &clone)
- { x=clone.x; y=clone.y; z=clone.z; }
-
- inline vec3d& operator=(const vec3d &rhs)
- { x=rhs.x; y=rhs.y; z=rhs.z; return *this; }
- inline vec3d& operator+=(const vec3d &rhs)
- { x+=rhs.x; y+=rhs.y; z+=rhs.z; return *this; }
- inline vec3d& operator-=(const vec3d &rhs)
- { x-=rhs.x; y-=rhs.y; z-=rhs.z; return *this; }
- inline vec3d& operator*=(const vec3d &rhs)
- { x*=rhs.x; y*=rhs.y; z*=rhs.z; return *this; }
- inline vec3d& operator*=(const double &scal)
- { x*=scal; y*=scal; z*=scal; return *this; }
-
- inline const vec3d& operator+(const vec3d &rhs)
- { return vec3d(*this) += rhs; }
- inline const vec3d& operator-(const vec3d &rhs)
- { return vec3d(*this) -= rhs; }
- inline const vec3d& operator*(const vec3d &rhs)
- { return vec3d(*this) *= rhs; }
- inline const vec3d& operator*(const double &scal)
- { return vec3d(*this) *= scal; }
-} Vect3D_t;
-
-
-
-inline void UpdBBox(BoundingBox_t &B, Vect3D_t &V)
-{
- if (V.x < B.m_dLeft)
- B.m_dLeft = V.x;
- else if (V.x > B.m_dRight)
- B.m_dRight = V.x;
- if (V.y < B.m_dBottom)
- B.m_dBottom = V.y;
- else if (V.y > B.m_dTop)
- B.m_dTop = V.y;
- if (V.z < B.m_dFront)
- B.m_dFront = V.z;
- else if (V.z > B.m_dBack)
- B.m_dBack = V.z;
-};
-
-typedef struct triangle
-{
- int v1, n1, t1,
- v2, n2, t2,
- v3, n3, t3;
-} Triangle_t;
-
-typedef struct mat
-{
- GLfloat m_fAmb[4],
- m_fDif[4],
- m_fSpec[4],
- m_fEmi[4],
- m_fShin;
-
- //default constructor
- mat()
- {
- m_fAmb[0] = m_fAmb[1] = m_fAmb[2] = 0.7f; m_fAmb[3] = 1.0f;
- m_fDif[0] = m_fDif[1] = m_fDif[3] = 0.7f; m_fDif[3] = 1.0f;
- m_fSpec[0] = m_fSpec[1] = m_fSpec[2] = m_fSpec[3] = 1.0f;
- m_fEmi[0] = m_fEmi[1] = m_fEmi[2] = 0.0f; m_fEmi[3] = 1.0f;
- m_fShin = 128.0f;
- }
- //for convenience
- inline void setAmb(float r, float g, float b, float a)
- { m_fAmb[0] = r; m_fAmb[1] = g; m_fAmb[2] = b; m_fAmb[3] = a; }
- inline void setDif(float r, float g, float b, float a)
- { m_fDif[0] = r; m_fDif[1] = g; m_fDif[2] = b; m_fDif[3] = a; }
- inline void setSpec(float r, float g, float b, float a)
- { m_fSpec[0] = r; m_fSpec[1] = g; m_fSpec[2] = b; m_fSpec[3] = a; }
- inline void setEmi(float r, float g, float b, float a)
- { m_fEmi[0] = r; m_fEmi[1] = g; m_fEmi[2] = b; m_fEmi[3] = a; }
-
-} MatProps_t;
-/*
-typedef struct facegroup
-{
- MatProps_t m_material;
- std::vector<Face_t> m_faces;
-} FaceGroup_t;
-*/
-
-typedef struct geom
-{
- std::vector<Vect3D_t> m_verts,
- m_norms,
- m_texs;
- std::vector<Triangle_t> m_triangles;
-} Geometry_t;
-
-#endif //TYPEDEFS_H
-