Loading LrEntity.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -62,3 +62,9 @@ LrMatrix LrEntity::getMat() const { return m_mat; } bool LrEntity::getIntersection(const LrRay &ray, LrHit *hit, int fragment, Real minBound, Real maxBound) const { return false; } LrEntity.h +18 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,24 @@ public: virtual bool getIntersection(const LrRay &ray, LrHit *hit, Real minBound=0, Real maxBound=INFINITY) const=0; /** * @brief Donne d'intersection entre un rayon et un fragment de la géométrie. * @param ray Référence d'un objet LrRay. * @param hit Adresse de l'objet LrHit dans lequel sera stocké le résultat. * @param fragment Fragment de la géométrie. * @param minBound Distance minimum par rapport à l'origine (défaut : 0). * @param maxBound Distance maximum par rapport à l'origine (défaut : INFINITY). * @return vrai si il y a une intersection, sinon faux. * * Cette méthode calcul l'intersection entre le rayon @a ray et le fragment * @a fragment la géométrie et stocke le résultat dans la sructure LrHit pointée * par @a hit si ce dernier n'est pas égal à NULL. On peut également spécifier * la portion du rayon, à l'aide des paramètres @a minBound @a maxBound , * à prendre en compte pour ce calcul. */ virtual bool getIntersection(const LrRay &ray, LrHit *hit, int fragment, Real minBound, Real maxBound) const; /** * @brief Donne le nombre de fragments de l'entitée. * @return Un entier. Loading LrEntityElementary.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,24 @@ bool LrEntityElementary::getIntersection(const LrRay &ray, LrHit *hit, } } bool LrEntityElementary::getIntersection(const LrRay &ray, LrHit *hit, int fragment, Real minBound, Real maxBound) const { if (m_geometry->getIntersection(ray,hit,fragment,m_transf,m_transfInv,m_transfInvTransp,minBound,maxBound)) { if (hit!=NULL) { hit->entity=(LrEntity*)this; hit->optic=m_optic; } return true; } else { return false; } } void LrEntityElementary::getMinMax(LrPoint &min, LrPoint &max) const { m_geometry->getMinMax(min,max,m_transf); Loading LrEntityElementary.h +18 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,24 @@ public: virtual bool getIntersection(const LrRay &ray, LrHit *hit, Real minBound=0, Real maxBound=INFINITY) const; /** * @brief Donne d'intersection entre un rayon et un fragment de la géométrie. * @param ray Référence d'un objet LrRay. * @param hit Adresse de l'objet LrHit dans lequel sera stocké le résultat. * @param fragment Fragment de la géométrie. * @param minBound Distance minimum par rapport à l'origine (défaut : 0). * @param maxBound Distance maximum par rapport à l'origine (défaut : INFINITY). * @return vrai si il y a une intersection, sinon faux. * * Cette méthode calcul l'intersection entre le rayon @a ray et le fragment * @a fragment la géométrie et stocke le résultat dans la sructure LrHit pointée * par @a hit si ce dernier n'est pas égal à NULL. On peut également spécifier * la portion du rayon, à l'aide des paramètres @a minBound @a maxBound , * à prendre en compte pour ce calcul. */ virtual bool getIntersection(const LrRay &ray, LrHit *hit, int fragment, Real minBound, Real maxBound) const; /** * @brief Donne le nombre de fragments de l'entitée. * @return Un entier. Loading Loading
LrEntity.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -62,3 +62,9 @@ LrMatrix LrEntity::getMat() const { return m_mat; } bool LrEntity::getIntersection(const LrRay &ray, LrHit *hit, int fragment, Real minBound, Real maxBound) const { return false; }
LrEntity.h +18 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,24 @@ public: virtual bool getIntersection(const LrRay &ray, LrHit *hit, Real minBound=0, Real maxBound=INFINITY) const=0; /** * @brief Donne d'intersection entre un rayon et un fragment de la géométrie. * @param ray Référence d'un objet LrRay. * @param hit Adresse de l'objet LrHit dans lequel sera stocké le résultat. * @param fragment Fragment de la géométrie. * @param minBound Distance minimum par rapport à l'origine (défaut : 0). * @param maxBound Distance maximum par rapport à l'origine (défaut : INFINITY). * @return vrai si il y a une intersection, sinon faux. * * Cette méthode calcul l'intersection entre le rayon @a ray et le fragment * @a fragment la géométrie et stocke le résultat dans la sructure LrHit pointée * par @a hit si ce dernier n'est pas égal à NULL. On peut également spécifier * la portion du rayon, à l'aide des paramètres @a minBound @a maxBound , * à prendre en compte pour ce calcul. */ virtual bool getIntersection(const LrRay &ray, LrHit *hit, int fragment, Real minBound, Real maxBound) const; /** * @brief Donne le nombre de fragments de l'entitée. * @return Un entier. Loading
LrEntityElementary.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,24 @@ bool LrEntityElementary::getIntersection(const LrRay &ray, LrHit *hit, } } bool LrEntityElementary::getIntersection(const LrRay &ray, LrHit *hit, int fragment, Real minBound, Real maxBound) const { if (m_geometry->getIntersection(ray,hit,fragment,m_transf,m_transfInv,m_transfInvTransp,minBound,maxBound)) { if (hit!=NULL) { hit->entity=(LrEntity*)this; hit->optic=m_optic; } return true; } else { return false; } } void LrEntityElementary::getMinMax(LrPoint &min, LrPoint &max) const { m_geometry->getMinMax(min,max,m_transf); Loading
LrEntityElementary.h +18 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,24 @@ public: virtual bool getIntersection(const LrRay &ray, LrHit *hit, Real minBound=0, Real maxBound=INFINITY) const; /** * @brief Donne d'intersection entre un rayon et un fragment de la géométrie. * @param ray Référence d'un objet LrRay. * @param hit Adresse de l'objet LrHit dans lequel sera stocké le résultat. * @param fragment Fragment de la géométrie. * @param minBound Distance minimum par rapport à l'origine (défaut : 0). * @param maxBound Distance maximum par rapport à l'origine (défaut : INFINITY). * @return vrai si il y a une intersection, sinon faux. * * Cette méthode calcul l'intersection entre le rayon @a ray et le fragment * @a fragment la géométrie et stocke le résultat dans la sructure LrHit pointée * par @a hit si ce dernier n'est pas égal à NULL. On peut également spécifier * la portion du rayon, à l'aide des paramètres @a minBound @a maxBound , * à prendre en compte pour ce calcul. */ virtual bool getIntersection(const LrRay &ray, LrHit *hit, int fragment, Real minBound, Real maxBound) const; /** * @brief Donne le nombre de fragments de l'entitée. * @return Un entier. Loading