/*************************************************************************************** ***** INTERFACE IMRTPRIMITIVE ***** **************************************************************************************** ** Author: Peter Stuart ** Date: 8/1/98 ** Description: This is used to interface with a primitive. Primitives are the basic ** objects which can be used together to build complex objects. Some examples of ** simple primitives include sphere, plane, or torus. Examples of more complex ** primitives are patches, NURBS, CSG objects. Once this interface is complete, ** all of these will be able to be represented. ** ** Interface Functions: ** ** Intersection - Checks to see if a particular ray intersects the primitive ** GetHitDetails - If an intersection occurs, this function is called. It fills ** in a structure called ShaderInfo with information about the point ** of intersection. This includes the surface normal at that point ** and the U-V coordinates at that point. ** GetPolygons - This returns a polygonal representation of the primitive based on ** the "fidelity" or complexity of the mesh. ** GetFrame - This returns the primitives coordinate frame. ** GetTransform - This returns a matrix which transforms a point from the cartesian ** frame into the coordinate frame used by the primitive. ***************************************************************************************/ #include #include #include "IMRTInterface.hpp" #include "IMRTShader.hpp" #include "3DMath.hpp" #include "Triangle.hpp" #ifndef __IMRTPRIMITIVE__ #define __IMRTPRIMITIVE__ interface IMRTPrimitive : public IMRTInterface { virtual HRESULT pascal Intersection (const Vector&, const Point&, Point*) = 0; virtual HRESULT pascal GetHitDetails (ShaderInfo*) = 0; virtual HRESULT pascal GetPolygons (const UINT&, const UINT&, TriangleList*) = 0; virtual HRESULT pascal GetFrame (Frame**) = 0; virtual HRESULT pascal GetTransform (Matrix4D*) = 0; }; #endif