www.pudn.com > Ray_Tracing_Materials.rar > Plane.h, change:2005-03-02,size:1139b


/* 
   File Name: 
 
      Plane.h 
 
   Created by: 
 
      Allen Sherrod (Programming Ace of www.UltimateGameProgramming.com). 
 
   Description: 
 
      This file holds a structure that represents a 3D Triangle. 
*/ 
 
 
#ifndef PLANES_H
#define PLANES_H 
 
 
#include"Ray.h" 
#include"CVector.h"
 

class Plane
{
   public:
      Plane() : r(0), g(0), b(0), d(0), diffuseMat(0), reflect(0), refract(0) {}
      Plane(CVector4 &p, CVector4 &n, float R, float G, float B,
            float dMat, float rl, float etaRatio)
      {
         normal = n;
         normal.Normal();
         d = -(p.DotProduct3(normal));
         r = R; g = G; b = B;
         diffuseMat = dMat;
         reflect = rl;
         refract = etaRatio;
      }

      TraceResult Intersect(Ray &ray);
      CVector4 GetNormal();

      // Plane normal, distance, color.
      CVector4 normal;
      float d;
      float r, g, b;
      float diffuseMat;
      float reflect;
      float refract;
};

#endif
 
 
// Copyright February 2005 
// All Rights Reserved! 
// Allen Sherrod 
// ProgrammingAce@UltimateGameProgramming.com 
// www.UltimateGameProgramming.com