Add the hit function to get the closest non negative hit, and add some mecanisme to test that properly and report when no valid hit occur.
This commit is contained in:
@@ -21,6 +21,9 @@ public:
|
||||
|
||||
public:
|
||||
Intersection(double t, Object *object) : t(t), object(object) { };
|
||||
bool nothing() { return (this->object == nullptr); };
|
||||
|
||||
bool operator==(const Intersection &b) const { return ((this->t == b.t) && (this->object == b.object)); };
|
||||
};
|
||||
|
||||
#endif //DORAYME_INTERSECTION_H
|
||||
|
||||
Reference in New Issue
Block a user