/*
   Class Name:

      CVector3.

   Created by:

      Allen Sherrod (Programming Ace of www.UltimateGameProgramming.com).

   Description:

      This class represents a 3D point for a vertex's x, y, and z axis.
*/


#ifndef CVECTOR_H
#define CVECTOR_H


#include<math.h>                                         // Math header file.


class CVector3
{
   public:
      CVector3();                                        // Constructor.
      CVector3(float X, float Y, float Z);               // Overloaded constructor.
      CVector3(const CVector3 &v);                       // Another overloaded constructor.

      void operator=(CVector3 v);                        // Overloaded = sign.
      CVector3 operator-(CVector3 v);                    // Overloaded - sign.
      CVector3 operator+(CVector3 v);                    // Overloaded + sign.
      CVector3 operator*(float f);                       // Overloaded * sign.
      CVector3 operator/(float f);                       // Overloaded / sign.

      void operator +=(CVector3 v);                      // Overloaded += sign.
      void operator -=(CVector3 v);                      // Overloaded -= sign.
      void operator *=(float f);                         // Overloaded *= sign.
      void operator /=(float f);                         // Overloaded /= sign.

      bool operator ==(CVector3 v);                      // Overloaded == sign.
      bool operator !=(CVector3 v);                      // Overloaded != sign.

      void CrossProduct(CVector3 v1, CVector3 v2);       // Stores cross product of v1, v2.
      float DotProduct(CVector3 v1);                     // Returns dot product of v1 and this.
      float GetLength();                                 // Return this objects length.
      void Normal();                                     // Normalize this vector.
      void Normalize(CVector3 Triangle[]);               // Find the normal of a triangle.

      float x, y, z;                                     // vertex's x, y, and z info.
      float nx, ny, nz;                                  // vertex's normal x, y, and z info.
};

#endif


// Copyright March 2003
// All Rights Reserved!
// Allen Sherrod
// ProgrammingAce@UltimateGameProgramming.com
// www.UltimateGameProgramming.com