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_IBOUNDEDOBJECT_H 00024 #define TOXIC_RENDERER_IBOUNDEDOBJECT_H 00025 00026 #include "common/math/aabb3.h" 00027 #include "common/math/matrix4.h" 00028 #include "common/math/point2.h" 00029 #include "common/math/point3.h" 00030 #include "common/math/vector3.h" 00031 #include "globals.h" 00032 #include "iobject.h" 00033 00034 #include <vector> 00035 00036 namespace toxic { 00037 00038 class ISurfaceShader; 00039 class Scene; 00040 00041 const sheep::Vector3 OBJECT_AABB_EXTENSION(1.0e-3); 00042 00043 class IBoundedObject : public IObject { 00044 public: 00045 //! m is the object space to world space transformation matrix. 00046 //! The 'surface_shader' pointer may be null because some objects 00047 //! (like the Collection and Octree objects) don't need a shader. 00048 IBoundedObject( 00049 const sheep::Matrix4 &m, 00050 const ISurfaceShader *surface_shader = 0, 00051 IntersectionMask intersection_mask = INTERSECT_ALL_RAYS); 00052 00053 virtual ~IBoundedObject() {} 00054 00055 //! Returns the Axis Aligned Bounding Box of this object. The AABB is 00056 //! expressed in world space. 00057 virtual const sheep::AABB3 &GetAABB() const = 0; 00058 00059 //! Computes the surface area of this object. 00060 virtual sheep::Real ComputeSurfaceArea() const = 0; 00061 00062 //! Given a point in the unit square (the set of points in [0..1]^2), 00063 //! this method computes the corresponding surface point and normal 00064 //! (both are expressed in world space). 00065 virtual void EvaluateSurface( 00066 const sheep::Point2 &input, 00067 sheep::Point3 *point, 00068 sheep::Vector3 *geometric_normal 00069 ) const = 0; 00070 }; 00071 00072 #include "iboundedobject.inl" 00073 00074 } 00075 00076 #endif // !TOXIC_RENDERER_IBOUNDEDOBJECT_H
1.3.6