00001 /* 00002 toxic - A Global Illumination Renderer 00003 Copyright (C) 2003-2004 Francois Beaune 00004 Contact: http://toxicengine.sourceforge.net/ 00005 00006 This file is part of toxic. 00007 00008 toxic is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 2 of the License, or 00011 (at your option) any later version. 00012 00013 toxic is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with toxic; if not, write to the Free Software 00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 */ 00022 00023 #ifndef TOXIC_RENDERER_HIT_H 00024 #define TOXIC_RENDERER_HIT_H 00025 00026 #include "common/math/point3.h" 00027 #include "common/math/real.h" 00028 #include "common/math/vector3.h" 00029 #include "globals.h" 00030 #include "iobject.h" 00031 #include "ray.h" 00032 00033 namespace toxic { 00034 00035 class IObject; 00036 00037 class Hit { 00038 public: 00039 //! Hit object. 00040 const IObject *m_object; 00041 00042 //! Intersection point in ray space, expressed in world space. 00043 sheep::Real m_abscissa; 00044 00045 //! Geometric normal vector at intersection point, expressed in object space. 00046 //! Not necessarily unit-length. 00047 sheep::Vector3 m_geometric_normal; 00048 00049 //! Shading normal vector at intersection point, expressed in object space. 00050 //! Not necessarily unit-length. 00051 sheep::Vector3 m_shading_normal; 00052 00053 //! Planar texture coordinates, expressed in object space. 00054 sheep::Real m_u, m_v; 00055 00056 //! 'ray' must be expressed in world space. 00057 //! Any of 'point', 'geometric_normal' and 'shading_normal' can be set to 0 00058 //! in order to disable computation of the corresponding feature. 00059 //! 'point', 'geometric_normal' and 'shading_normal' are expressed in world space. 00060 void ExtractIntersection( 00061 const Ray &ray, //!< World space. 00062 sheep::Point3 *point, //!< World space. 00063 sheep::Vector3 *geometric_normal, //!< World space. 00064 sheep::Vector3 *shading_normal //!< World space. 00065 ) const; 00066 }; 00067 00068 #include "hit.inl" 00069 00070 } 00071 00072 #endif // !TOXIC_RENDERER_HIT_H
1.3.6