Intersector performs an intersection test for a given screen point and stores a list of intersections.
#include <Intersector.h>
Public Member Functions |
|
Intersector () | |
virtual bool | intersect (double x, double y)=0 |
Returns true if any object in the scene was
hit by a ray projected into the scene. |
|
virtual int | hitCount () const =0 |
Returns the number of hits. |
|
virtual awScene::NodeRef | getHit (int index) const =0 |
Returns the node for a particular hit.
|
|
virtual awLinear::Point | getIntersectionPoint (int index) const =0 |
Returns the the intersection point by index.
|
|
virtual awLinear::Normal | getNormalAtIntersection (int index) const =0 |
Returns the normal at the intersection by
index. |
|
virtual double | getDistanceAtIntersection (int index) const =0 |
Returns the distance to the intersection by
index. |
|
virtual int | getPatchIndexAtIntersection (awScene::NodeRef node, int index) const =0 |
Returns the patch index at the intersection
by index. |
|
virtual awLinear::Point2 | getUVAtIntersection (int index) const =0 |
Returns the uv at the intersection by index.
|
|
virtual bool | intersectManips (double x, double y, const awScene::NodeRef startNode)=0 |
Protected Member Functions |
|
virtual | ~Intersector () |
Intersector | ( | ) |
virtual ~Intersector | ( | ) | [protected, virtual] |
virtual bool intersect | ( | double | x, |
double | y | ||
) | [pure virtual] |
Returns true if any object in the scene was hit by a ray projected into the scene.
virtual int hitCount | ( | ) | const [pure virtual] |
Returns the number of hits.
virtual awScene::NodeRef getHit | ( | int | index | ) | const [pure virtual] |
Returns the node for a particular hit.
virtual awLinear::Point getIntersectionPoint | ( | int | index | ) | const [pure virtual] |
Returns the the intersection point by index.
If there is no intersection, then the origin is returned.
virtual awLinear::Normal getNormalAtIntersection | ( | int | index | ) | const [pure virtual] |
Returns the normal at the intersection by index.
If there is no intersection, then a zero vector is returned.
virtual double getDistanceAtIntersection | ( | int | index | ) | const [pure virtual] |
Returns the distance to the intersection by index.
Return -1.0 if index is out of range.
virtual int getPatchIndexAtIntersection | ( | awScene::NodeRef | node, |
int | index | ||
) | const [pure virtual] |
Returns the patch index at the intersection by index.
If there is no intersection, -1 is returned. Node is necessary in order to map back into the original file indices, instead of the potentially optimized one.
virtual awLinear::Point2 getUVAtIntersection | ( | int | index | ) | const [pure virtual] |
Returns the uv at the intersection by index.
If there is no intersection, then a zero vector is returned. You must make sure that the specified index is less than the hit count.
virtual bool intersectManips | ( | double | x, |
double | y, | ||
const awScene::NodeRef | startNode | ||
) | [pure virtual] |