home *** CD-ROM | disk | FTP | other *** search
- //**********************************************************************
- // DIVE Laboratories, Inc.
- // Copyright(c) 1995
- // All rights reserved.
- // FILE: TRIANGLE.HPP
- //
- // DESCRIPTION
- // This file provides the function prototypes for the
- // triangleClass
- //
- // Author: M. Doucet
- //
- // Modification History:
- // 6/13/95 Created
- //
- //**********************************************************************
- #ifndef _TRIANGLE_HPP
- #define _TRIANGLE_HPP
-
- #include "vrtypes.hpp"
- #include "vertex.hpp"
-
- #ifndef AMBERRT
- #include "texture.hpp"
- #include "material.hpp"
- #endif
-
- class triangleClass {
-
- private:
-
- // Polygon data
- //
- int nVerts;
- Vres A,B,C,D; // Determinants
-
- public:
-
- F3 texCoord[3];
- int rgbOverride, // Indicates that the user has supplied a specific rgb color
- tcOverride; // Indicates that the user has supplied a texture coordinate
-
- vertexClass *vertex[3];
- vectorClass normal;
- F4 color;
-
- #ifndef AMBERRT
- textureClass *tex;
- materialClass *mat;
- float textureRot, textureScale;
- F2 textureTrans;
- int textureMirrored;
- void rotateTexture(float rads);
- void translateTexture(F2 pos);
- void scaleTexture(float scale);
- void mirrorTexture();
- void setTexture(textureClass *t);
- void setTcOverride(int flag);
- int getTcOverride();
- #endif
-
- // Color
- void setColor(F4 col);
- void setRgbOverride(int flag);
- int getRgbOverride();
-
- // Vertex functions
- //
- int addVertex(vertexClass *v);
- int getNumVertices();
- vertexClass *getVertex(int index);
- void getVertexPos(int index, V3 pos);
-
- // Normal and facing routines
- //
- void calcDeterminants();
- vectorClass *getNormal();
- void getNormal(V3 vals);
- void swapFace();
-
- triangleClass();
- ~triangleClass();
- };
-
- #endif
-