Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
IntersectionClass Class Reference

#include <intersec.h>

Public Types

enum  { MAX_POLY_INTERSECTION_COUNT = 1000 , MAX_HIERARCHY_NODE_COUNT = 256 }
 

Public Member Functions

void Set (Vector3 *location, Vector3 *direction, Vector3 *intersection_normal, bool interpolate_normal, float max_distance, bool convex_test=false)
 
 IntersectionClass ()
 
 IntersectionClass (Vector3 *location, Vector3 *direction, Vector3 *intersection_normal, bool interpolate_normal=false, float max_distance=WWMATH_FLOAT_MAX, bool convex_test=false)
 
virtual ~IntersectionClass ()
 
void Copy_Results (IntersectionResultClass *Destination, IntersectionResultClass *Source)
 
void Copy_Results (IntersectionResultClass *Source)
 
void Copy_Partial_Results (IntersectionResultClass *Destination, IntersectionResultClass *Source)
 
 IntersectionClass (IntersectionClass *source)
 
IntersectionClassoperator= (IntersectionClass *source)
 
bool Intersect_Sphere_Quick (SphereClass &Sphere, IntersectionResultClass *FinalResult)
 
bool Intersect_Sphere (SphereClass &Sphere, IntersectionResultClass *FinalResult)
 
void Get_Screen_Ray (float ScreenX, float ScreenY, const LayerClass &Layer)
 debug code that will be tossed
 
void Calculate_Intersection (IntersectionResultClass *Result)
 
void Interpolate_Intersection_Normal (IntersectionResultClass *FinalResult)
 
bool Intersect_Plane (IntersectionResultClass *Result, Vector3 &Plane_Normal, Vector3 &Plane_Point)
 
bool Intersect_Plane_Quick (IntersectionResultClass *Result, Vector3 &Plane_Normal, Vector3 &Plane_Point)
 
bool Intersect_Polygon (IntersectionResultClass *Result, Vector3 &PolygonNormal, Vector3 &v1, Vector3 &v2, Vector3 &v3)
 
bool Intersect_Polygon (IntersectionResultClass *Result, Vector3 &v1, Vector3 &v2, Vector3 &v3)
 
bool Intersect_Polygon_Z (IntersectionResultClass *Result, Vector3 &PolygonNormal, Vector3 &v1, Vector3 &v2, Vector3 &v3)
 
bool Intersect_Screen_Object (IntersectionResultClass *Final_Result, Vector4 &Area, RenderObjClass *obj=0)
 
void Append_Object_Array (int MaxCount, int &CurrentCount, RenderObjClass **ObjectArray, RenderObjClass *Object)
 
void Append_Hierarchy_Objects (int MaxCount, int &CurrentCount, RenderObjClass **ObjectArray, RenderObjClass *Heirarchy, bool Test_Bounding_Spheres, bool Convex)
 
bool Intersect_Object_Array (int ObjectCount, RenderObjClass **ObjectArray, IntersectionResultClass *FinalResult, bool Test_Bounding_Sphere, bool Convex)
 
bool Intersect_Object_Array (int ObjectCount, RenderObjClass **ObjectArray, IntersectionResultClass *FinalResult, IntersectionResultClass *TemporaryResults, bool Test_Bounding_Sphere, bool Convex)
 
bool Intersect_RenderObject (RenderObjClass *RObj, IntersectionResultClass *FinalResult=0)
 
bool Intersect_Screen_Point_RenderObject (float screen_x, float screen_y, const LayerClass &Layer, RenderObjClass *RObj, IntersectionResultClass *FinalResult)
 
bool Intersect_Screen_Point_Layer_Range (float ScreenX, float ScreenY, const LayerClass &TopLayer, const LayerClass &BackLayer)
 
bool Intersect_Screen_Point_Layer (float ScreenX, float ScreenY, const LayerClass &Layer)
 
bool Intersect_Layer (const LayerClass &Layer, bool Test_All=true)
 
bool Intersect_Box (Vector3 &Box_Min, Vector3 &Box_Max, IntersectionResultClass *FinalResult)
 
bool Intersect_Hierarchy (RenderObjClass *Hierarchy, IntersectionResultClass *FinalResult, bool Test_Bounding_Sphere=true, bool Convex=false)
 
bool Intersect_Hierarchy_Sphere (RenderObjClass *Hierarchy, IntersectionResultClass *FinalResult)
 
bool Intersect_Hierarchy_Sphere_Quick (RenderObjClass *Hierarchy, IntersectionResultClass *FinalResult)
 
RenderObjClassIntersect_Sub_Object (float screenx, float screeny, LayerClass &layer, RenderObjClass *robj, IntersectionResultClass *result)
 

Static Public Member Functions

static int _Intersect_Triangles_Z (Vector3 ClipPoints[3], Vector3 TrianglePoints[3], Vector2 UV[3], Vector3 ClippedPoints[6], Vector2 ClippedUV[6])
 
static float _Get_Z_Elevation (Vector3 &Point, Vector3 &PlanePoint, Vector3 &PlaneNormal)
 
static void _Find_Polygon_Dominant_Plane (Vector3 &Normal, int &Axis_1, int &Axis_2)
 
static int _Largest_Normal_Index (Vector3 &v)
 
static bool _Point_In_Polygon (IntersectionResultClass *FinalResult, Vector3 &Normal, Vector3 &loc1, Vector3 &loc2, Vector3 &loc3)
 
static bool _Point_In_Polygon (IntersectionResultClass *FinalResult, Vector3 &loc1, Vector3 &loc2, Vector3 &loc3, int axis_1, int axis_2)
 
static bool _Point_In_Polygon (Vector3 &Point, Vector3 &loc1, Vector3 &loc2, Vector3 &loc3, int axis_1, int axis_2, float &Alpha, float &Beta)
 
static bool _Point_In_Polygon_Z (Vector3 &Point, Vector3 Corners[3])
 
static bool _Point_In_Polygon_Z (Vector3 &Point, Vector3 &Corner1, Vector3 &Corner2, Vector3 &Corner3)
 

Public Attributes

Vector3RayLocation
 
Vector3RayDirection
 
Vector3IntersectionNormal
 
float ScreenX
 
float ScreenY
 
bool InterpolateNormal
 
bool ConvexTest
 
float MaxDistance
 
IntersectionResultClass Result
 

Protected Member Functions

float Plane_Z_Distance (Vector3 &PlaneNormal, Vector3 &PlanePoint)
 
void Transform_Model_To_World_Coords (IntersectionResultClass *FinalResult)
 

Static Protected Member Functions

static bool In_Front_Of_Line (const Vector3 &p, const Vector3 &e0, const Vector3 &de)
 
static float Intersect_Lines (const Vector3 &p0, const Vector3 &p1, const Vector3 &e0, const Vector3 &de)
 
static int Clip_Triangle_To_LineXY (int incount, Vector3 *InPoints, Vector2 *InUVs, Vector3 *OutPoints, Vector2 *OutUVs, const Vector3 &edge_point0, const Vector3 &edge_point1)
 

Static Protected Attributes

static Vector3 _RayLocation
 
static Vector3 _RayDirection
 
static Vector3 _IntersectionNormal
 

Detailed Description

Definition at line 94 of file intersec.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_POLY_INTERSECTION_COUNT 
MAX_HIERARCHY_NODE_COUNT 

Definition at line 99 of file intersec.h.

Constructor & Destructor Documentation

◆ IntersectionClass() [1/3]

IntersectionClass::IntersectionClass ( )
inline

Definition at line 155 of file intersec.h.

◆ IntersectionClass() [2/3]

IntersectionClass::IntersectionClass ( Vector3 * location,
Vector3 * direction,
Vector3 * intersection_normal,
bool interpolate_normal = false,
float max_distance = WWMATH_FLOAT_MAX,
bool convex_test = false )
inline

Definition at line 166 of file intersec.h.

◆ ~IntersectionClass()

virtual IntersectionClass::~IntersectionClass ( )
inlinevirtual

Definition at line 172 of file intersec.h.

◆ IntersectionClass() [3/3]

IntersectionClass::IntersectionClass ( IntersectionClass * source)
inline

Definition at line 206 of file intersec.h.

Member Function Documentation

◆ _Find_Polygon_Dominant_Plane()

void IntersectionClass::_Find_Polygon_Dominant_Plane ( Vector3 & Normal,
int & Axis_1,
int & Axis_2 )
inlinestatic

Definition at line 462 of file intersec.inl.

◆ _Get_Z_Elevation()

float IntersectionClass::_Get_Z_Elevation ( Vector3 & Point,
Vector3 & PlanePoint,
Vector3 & PlaneNormal )
inlinestatic

Definition at line 350 of file intersec.inl.

◆ _Intersect_Triangles_Z()

int IntersectionClass::_Intersect_Triangles_Z ( Vector3 ClipPoints[3],
Vector3 TrianglePoints[3],
Vector2 UV[3],
Vector3 ClippedPoints[6],
Vector2 ClippedUV[6] )
inlinestatic

Definition at line 896 of file intersec.inl.

◆ _Largest_Normal_Index()

int IntersectionClass::_Largest_Normal_Index ( Vector3 & v)
inlinestatic

Definition at line 442 of file intersec.inl.

◆ _Point_In_Polygon() [1/3]

bool IntersectionClass::_Point_In_Polygon ( IntersectionResultClass * FinalResult,
Vector3 & loc1,
Vector3 & loc2,
Vector3 & loc3,
int axis_1,
int axis_2 )
inlinestatic

Definition at line 303 of file intersec.inl.

◆ _Point_In_Polygon() [2/3]

bool IntersectionClass::_Point_In_Polygon ( IntersectionResultClass * FinalResult,
Vector3 & Normal,
Vector3 & loc1,
Vector3 & loc2,
Vector3 & loc3 )
inlinestatic

Definition at line 319 of file intersec.inl.

◆ _Point_In_Polygon() [3/3]

bool IntersectionClass::_Point_In_Polygon ( Vector3 & Point,
Vector3 & loc1,
Vector3 & loc2,
Vector3 & loc3,
int axis_1,
int axis_2,
float & Alpha,
float & Beta )
inlinestatic

Definition at line 220 of file intersec.inl.

◆ _Point_In_Polygon_Z() [1/2]

bool IntersectionClass::_Point_In_Polygon_Z ( Vector3 & Point,
Vector3 & Corner1,
Vector3 & Corner2,
Vector3 & Corner3 )
inlinestatic

Definition at line 148 of file intersec.inl.

◆ _Point_In_Polygon_Z() [2/2]

bool IntersectionClass::_Point_In_Polygon_Z ( Vector3 & Point,
Vector3 Corners[3] )
inlinestatic

Definition at line 208 of file intersec.inl.

◆ Append_Hierarchy_Objects()

void IntersectionClass::Append_Hierarchy_Objects ( int MaxCount,
int & CurrentCount,
RenderObjClass ** ObjectArray,
RenderObjClass * Heirarchy,
bool Test_Bounding_Spheres,
bool Convex )

Definition at line 279 of file intersec.cpp.

◆ Append_Object_Array()

void IntersectionClass::Append_Object_Array ( int MaxCount,
int & CurrentCount,
RenderObjClass ** ObjectArray,
RenderObjClass * Object )

Definition at line 157 of file intersec.cpp.

◆ Calculate_Intersection()

void IntersectionClass::Calculate_Intersection ( IntersectionResultClass * Result)
inline

Definition at line 385 of file intersec.inl.

◆ Clip_Triangle_To_LineXY()

int IntersectionClass::Clip_Triangle_To_LineXY ( int incount,
Vector3 * InPoints,
Vector2 * InUVs,
Vector3 * OutPoints,
Vector2 * OutUVs,
const Vector3 & edge_point0,
const Vector3 & edge_point1 )
inlinestaticprotected

Definition at line 832 of file intersec.inl.

◆ Copy_Partial_Results()

void IntersectionClass::Copy_Partial_Results ( IntersectionResultClass * Destination,
IntersectionResultClass * Source )
inline

Definition at line 193 of file intersec.h.

◆ Copy_Results() [1/2]

void IntersectionClass::Copy_Results ( IntersectionResultClass * Destination,
IntersectionResultClass * Source )
inline

Definition at line 176 of file intersec.h.

◆ Copy_Results() [2/2]

void IntersectionClass::Copy_Results ( IntersectionResultClass * Source)
inline

Definition at line 184 of file intersec.h.

◆ Get_Screen_Ray()

void IntersectionClass::Get_Screen_Ray ( float ScreenX,
float ScreenY,
const LayerClass & Layer )
inline

debug code that will be tossed

Definition at line 81 of file intersec.inl.

◆ In_Front_Of_Line()

bool IntersectionClass::In_Front_Of_Line ( const Vector3 & p,
const Vector3 & e0,
const Vector3 & de )
inlinestaticprotected

Definition at line 788 of file intersec.inl.

◆ Interpolate_Intersection_Normal()

void IntersectionClass::Interpolate_Intersection_Normal ( IntersectionResultClass * FinalResult)
inline

◆ Intersect_Box()

bool IntersectionClass::Intersect_Box ( Vector3 & Box_Min,
Vector3 & Box_Max,
IntersectionResultClass * FinalResult )

Definition at line 177 of file intersec.cpp.

◆ Intersect_Hierarchy()

bool IntersectionClass::Intersect_Hierarchy ( RenderObjClass * Hierarchy,
IntersectionResultClass * FinalResult,
bool Test_Bounding_Sphere = true,
bool Convex = false )

Definition at line 313 of file intersec.cpp.

◆ Intersect_Hierarchy_Sphere()

bool IntersectionClass::Intersect_Hierarchy_Sphere ( RenderObjClass * Hierarchy,
IntersectionResultClass * FinalResult )

Definition at line 267 of file intersec.cpp.

◆ Intersect_Hierarchy_Sphere_Quick()

bool IntersectionClass::Intersect_Hierarchy_Sphere_Quick ( RenderObjClass * Hierarchy,
IntersectionResultClass * FinalResult )

Definition at line 252 of file intersec.cpp.

◆ Intersect_Layer()

bool IntersectionClass::Intersect_Layer ( const LayerClass & Layer,
bool Test_All = true )

Definition at line 124 of file intersec.cpp.

◆ Intersect_Lines()

float IntersectionClass::Intersect_Lines ( const Vector3 & p0,
const Vector3 & p1,
const Vector3 & e0,
const Vector3 & de )
inlinestaticprotected

Definition at line 803 of file intersec.inl.

◆ Intersect_Object_Array() [1/2]

bool IntersectionClass::Intersect_Object_Array ( int ObjectCount,
RenderObjClass ** ObjectArray,
IntersectionResultClass * FinalResult,
bool Test_Bounding_Sphere,
bool Convex )

Definition at line 357 of file intersec.cpp.

◆ Intersect_Object_Array() [2/2]

bool IntersectionClass::Intersect_Object_Array ( int ObjectCount,
RenderObjClass ** ObjectArray,
IntersectionResultClass * FinalResult,
IntersectionResultClass * TemporaryResults,
bool Test_Bounding_Sphere,
bool Convex )

Definition at line 370 of file intersec.cpp.

◆ Intersect_Plane()

bool IntersectionClass::Intersect_Plane ( IntersectionResultClass * Result,
Vector3 & Plane_Normal,
Vector3 & Plane_Point )
inline

Definition at line 416 of file intersec.inl.

◆ Intersect_Plane_Quick()

bool IntersectionClass::Intersect_Plane_Quick ( IntersectionResultClass * Result,
Vector3 & Plane_Normal,
Vector3 & Plane_Point )
inline

Definition at line 397 of file intersec.inl.

◆ Intersect_Polygon() [1/2]

bool IntersectionClass::Intersect_Polygon ( IntersectionResultClass * Result,
Vector3 & PolygonNormal,
Vector3 & v1,
Vector3 & v2,
Vector3 & v3 )
inline

Definition at line 491 of file intersec.inl.

◆ Intersect_Polygon() [2/2]

bool IntersectionClass::Intersect_Polygon ( IntersectionResultClass * Result,
Vector3 & v1,
Vector3 & v2,
Vector3 & v3 )
inline

Definition at line 511 of file intersec.inl.

◆ Intersect_Polygon_Z()

bool IntersectionClass::Intersect_Polygon_Z ( IntersectionResultClass * Result,
Vector3 & PolygonNormal,
Vector3 & v1,
Vector3 & v2,
Vector3 & v3 )
inline

Definition at line 371 of file intersec.inl.

◆ Intersect_RenderObject()

bool IntersectionClass::Intersect_RenderObject ( RenderObjClass * RObj,
IntersectionResultClass * FinalResult = 0 )

Definition at line 61 of file intersec.cpp.

◆ Intersect_Screen_Object()

bool IntersectionClass::Intersect_Screen_Object ( IntersectionResultClass * Final_Result,
Vector4 & Area,
RenderObjClass * obj = 0 )
inline

Definition at line 549 of file intersec.inl.

◆ Intersect_Screen_Point_Layer()

bool IntersectionClass::Intersect_Screen_Point_Layer ( float ScreenX,
float ScreenY,
const LayerClass & Layer )

Definition at line 102 of file intersec.cpp.

◆ Intersect_Screen_Point_Layer_Range()

bool IntersectionClass::Intersect_Screen_Point_Layer_Range ( float ScreenX,
float ScreenY,
const LayerClass & TopLayer,
const LayerClass & BackLayer )

Definition at line 71 of file intersec.cpp.

◆ Intersect_Screen_Point_RenderObject()

bool IntersectionClass::Intersect_Screen_Point_RenderObject ( float screen_x,
float screen_y,
const LayerClass & Layer,
RenderObjClass * RObj,
IntersectionResultClass * FinalResult )

Definition at line 55 of file intersec.cpp.

◆ Intersect_Sphere()

bool IntersectionClass::Intersect_Sphere ( SphereClass & Sphere,
IntersectionResultClass * FinalResult )
inline

Definition at line 246 of file intersec.h.

◆ Intersect_Sphere_Quick()

bool IntersectionClass::Intersect_Sphere_Quick ( SphereClass & Sphere,
IntersectionResultClass * FinalResult )
inline

Definition at line 228 of file intersec.h.

◆ Intersect_Sub_Object()

RenderObjClass * IntersectionClass::Intersect_Sub_Object ( float screenx,
float screeny,
LayerClass & layer,
RenderObjClass * robj,
IntersectionResultClass * result )

Definition at line 337 of file intersec.cpp.

◆ operator=()

IntersectionClass * IntersectionClass::operator= ( IntersectionClass * source)
inline

Definition at line 212 of file intersec.h.

◆ Plane_Z_Distance()

float IntersectionClass::Plane_Z_Distance ( Vector3 & PlaneNormal,
Vector3 & PlanePoint )
inlineprotected

Definition at line 332 of file intersec.inl.

◆ Set()

void IntersectionClass::Set ( Vector3 * location,
Vector3 * direction,
Vector3 * intersection_normal,
bool interpolate_normal,
float max_distance,
bool convex_test = false )
inline

Definition at line 140 of file intersec.h.

◆ Transform_Model_To_World_Coords()

void IntersectionClass::Transform_Model_To_World_Coords ( IntersectionResultClass * FinalResult)
inlineprotected

Definition at line 528 of file intersec.inl.

Member Data Documentation

◆ _IntersectionNormal

Vector3 IntersectionClass::_IntersectionNormal
staticprotected

Definition at line 399 of file intersec.h.

◆ _RayDirection

Vector3 IntersectionClass::_RayDirection
staticprotected

Definition at line 399 of file intersec.h.

◆ _RayLocation

Vector3 IntersectionClass::_RayLocation
staticprotected

Definition at line 399 of file intersec.h.

◆ ConvexTest

bool IntersectionClass::ConvexTest

Definition at line 126 of file intersec.h.

◆ InterpolateNormal

bool IntersectionClass::InterpolateNormal

Definition at line 120 of file intersec.h.

◆ IntersectionNormal

Vector3* IntersectionClass::IntersectionNormal

Definition at line 110 of file intersec.h.

◆ MaxDistance

float IntersectionClass::MaxDistance

Definition at line 130 of file intersec.h.

◆ RayDirection

Vector3* IntersectionClass::RayDirection

Definition at line 109 of file intersec.h.

◆ RayLocation

Vector3* IntersectionClass::RayLocation

Definition at line 108 of file intersec.h.

◆ Result

IntersectionResultClass IntersectionClass::Result

Definition at line 133 of file intersec.h.

◆ ScreenX

float IntersectionClass::ScreenX

Definition at line 113 of file intersec.h.

◆ ScreenY

float IntersectionClass::ScreenY

Definition at line 113 of file intersec.h.


The documentation for this class was generated from the following files: