◆
~IIntersect()
成员函数文档编制
◆
Alloc()
Allocates an intersect interface. Destroy the allocated intersect interface with
Free()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
-
参数
-
-
返回
-
The allocated intersect interface, or
nullptr
if the allocation failed.
◆
Free()
Destructs intersect interfaces allocated with
Alloc()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
-
参数
-
[in,out]
|
isect
|
The intersect interface to destruct. If the pointer is
nullptr
nothing happens. The pointer is assigned
nullptr
afterwards.
|
◆
Init()
Adds the
PolygonObject
pObject
to the data structure for intersection testing against the triangles.
-
注意
-
Internally this calls
Clear()
before.
-
参数
-
[in]
|
pObject
|
The polygon object to set. The caller owns the pointed object.
|
-
返回
-
true
if successful, otherwise
false
. (Due to not enough memory.)
◆
AddObject()
Adds another polygon object object.
-
参数
-
[in]
|
pObject
|
The polygon object to set. The caller owns the pointed object.
|
-
返回
-
true
if successful, otherwise
false
. (Due to not enough memory.)
◆
Clear()
Clears all the data.
◆
Hit()
[1/2]
From a viewport cast a ray, in screen space, onto the object(s) and return any data if there was a hit.
Returns the closest hit point if multiple intersections are found.
-
参数
-
[in]
|
bd
|
The view that the user is casting the ray from. The caller owns the pointed view.
|
[in]
|
mx
|
The X coordinate (mouse coordinate) in screen space.
|
[in]
|
my
|
The Y coordinate (mouse coordinate) in screen space.
|
[in]
|
backfaces
|
true
to allow back facing polygons to be hit tested.
If enabled and the back facing hit point is closer than the front hit point, then it is returned.
|
[out]
|
hitData
|
Filled with the intersection data if there was a hit.
|
-
返回
-
true
if there was a hit, otherwise
false
.
◆
Hit()
[2/2]
Given a ray in object space do a hit intersection against the object(s) and return any data if there was a hit.
Return the closest hit point if multiple intersections are found.
-
参数
-
[in]
|
rayp
|
The starting position of the ray in object space.
|
[in]
|
rayv
|
The direction the ray is pointing.
|
[in]
|
backfaces
|
true
to allow back facing polygons to be hit tested.
If enabled and the back facing hit point is closer than the front hit point, then it is returned.
|
[out]
|
hitData
|
Filled with the intersection data if there was a hit.
|
-
返回
-
true
if there was a hit, otherwise
false
.