66 return RObj->
Intersect(
this, FinalResult);
88 while(
Layer->Is_Valid()) {
93 if(
Layer == &BackLayer)
105 Result.Intersects =
false;
110 if((screen_x < v.
Min.
X) ||
111 (screen_x > v.
Max.
X) ||
112 (screen_y < v.
Min.
Y) ||
113 (screen_y > v.
Max.
Y))
128 Result.Intersects =
false;
151 Layer.Scene->Destroy_Iterator(it);
163 if(CurrentCount < MaxCount) {
164 ObjectArray[CurrentCount] =
Object;
168 WWDEBUG_SAY((
"IntersectionClass::Append_Object_Array - Too many objects\n"));
188 char quadrant[PLANE_COUNT];
190 float distance[PLANE_COUNT];
191 float candidate_plane[PLANE_COUNT];
227 int nearest_plane = 0;
229 if (distance[nearest_plane] < distance[
counter])
234 if (distance[nearest_plane] < 0.0f)
238 if (nearest_plane !=
counter) {
239 (*intersection)[
counter] = (*RayLocation)[
counter] + distance[nearest_plane] *(*RayDirection)[
counter];
284 bool Test_Bounding_Sphere,
291 if(Test_Bounding_Sphere) {
319 int candidate_count = 0;
324 if(candidate_count == 0) {
344 if (retval)
return retval;
361 bool Test_Bounding_Sphere,
367 return Intersect_Object_Array(Object_Count, ObjectArray, FinalResult, TemporaryResults, Test_Bounding_Sphere, Convex);
375 bool Test_Bounding_Sphere,
386 int nearest_index = -1;
388 if(Test_Bounding_Sphere) {
408 if(Test_Bounding_Sphere) {
428 float nearest_range = (float) (2<<28);
431 if(TemporaryResults[
counter].Intersects && (nearest_range > TemporaryResults[
counter].
Range)) {
436 Copy_Results(FinalResult, &TemporaryResults[nearest_index]);
bool Intersect_Screen_Point_RenderObject(float screen_x, float screen_y, const LayerClass &Layer, RenderObjClass *RObj, IntersectionResultClass *FinalResult)
IntersectionResultClass Result
RenderObjClass * Intersect_Sub_Object(float screenx, float screeny, LayerClass &layer, RenderObjClass *robj, IntersectionResultClass *result)
bool Intersect_Hierarchy_Sphere(RenderObjClass *Hierarchy, IntersectionResultClass *FinalResult)
void Get_Screen_Ray(float ScreenX, float ScreenY, const LayerClass &Layer)
debug code that will be tossed
@ MAX_HIERARCHY_NODE_COUNT
bool Intersect_Screen_Point_Layer(float ScreenX, float ScreenY, const LayerClass &Layer)
bool Intersect_Sphere_Quick(SphereClass &Sphere, IntersectionResultClass *FinalResult)
static Vector3 _IntersectionNormal
void Append_Hierarchy_Objects(int MaxCount, int &CurrentCount, RenderObjClass **ObjectArray, RenderObjClass *Heirarchy, bool Test_Bounding_Spheres, bool Convex)
bool Intersect_Box(Vector3 &Box_Min, Vector3 &Box_Max, IntersectionResultClass *FinalResult)
bool Intersect_RenderObject(RenderObjClass *RObj, IntersectionResultClass *FinalResult=0)
bool Intersect_Hierarchy_Sphere_Quick(RenderObjClass *Hierarchy, IntersectionResultClass *FinalResult)
static Vector3 _RayLocation
bool Intersect_Layer(const LayerClass &Layer, bool Test_All=true)
static Vector3 _RayDirection
bool Intersect_Screen_Point_Layer_Range(float ScreenX, float ScreenY, const LayerClass &TopLayer, const LayerClass &BackLayer)
void Copy_Results(IntersectionResultClass *Destination, IntersectionResultClass *Source)
void Append_Object_Array(int MaxCount, int &CurrentCount, RenderObjClass **ObjectArray, RenderObjClass *Object)
bool Intersect_Object_Array(int ObjectCount, RenderObjClass **ObjectArray, IntersectionResultClass *FinalResult, bool Test_Bounding_Sphere, bool Convex)
bool Intersect_Hierarchy(RenderObjClass *Hierarchy, IntersectionResultClass *FinalResult, bool Test_Bounding_Sphere=true, bool Convex=false)
WWINLINE void Release_Ref(void) const
virtual bool Intersect_Sphere_Quick(IntersectionClass *Intersection, IntersectionResultClass *Final_Result)
virtual int Is_Really_Visible(void)
virtual bool Intersect_Sphere(IntersectionClass *Intersection, IntersectionResultClass *Final_Result)
virtual int Get_Num_Sub_Objects(void) const
virtual RenderObjClass * Get_Sub_Object(int index) const
virtual int Get_Collision_Type(void) const
virtual bool Intersect(IntersectionClass *Intersection, IntersectionResultClass *Final_Result)
virtual void Next(void)=0
virtual RenderObjClass * Current_Item(void)=0
virtual void First(void)=0
virtual bool Is_Done(void)=0