PointShape.cpp
Go to the documentation of this file.00001 /**<!--------------------------------------------------------------------> 00002 @file PointShape.cpp 00003 @author Travis Fischer (fisch0920@gmail.com) 00004 @author Matthew Jacobs (jacobs.mh@gmail.com) 00005 @date Fall 2008 00006 00007 @brief 00008 Representation of a single point in 3-space (used to represent point 00009 lights and pinhole cameras) 00010 <!-------------------------------------------------------------------->**/ 00011 00012 #include "PointShape.h" 00013 #include "SurfacePoint.h" 00014 #include <Random.h> 00015 00016 #include <GL/gl.h> 00017 00018 void PointShape::init() { 00019 m_objSpaceAABB.min = Vector3((m_transToWorld * Point3()).data); 00020 m_objSpaceAABB.max = m_objSpaceAABB.min; 00021 00022 Transformable::init(); 00023 } 00024 00025 real_t PointShape::getIntersection(const Ray &ray, SurfacePoint &pt) { 00026 return INFINITY; 00027 } 00028 00029 bool PointShape::intersects(const Ray &ray, real_t tMax) { 00030 return false; 00031 } 00032 00033 void PointShape::_getUV(SurfacePoint &pt) const { 00034 pt.uv.u = 0; 00035 pt.uv.v = 0; 00036 } 00037 00038 void PointShape::_getGeometricNormal(SurfacePoint &pt) const { 00039 ASSERT(0 && "should not be here; PointShapes do not have normals"); 00040 } 00041 00042 void PointShape::preview() { 00043 Transformable::preview(); 00044 00045 glBegin(GL_POINTS); 00046 00047 glVertex3f(0, 0, 0); 00048 00049 glEnd(); 00050 } 00051 00052 bool PointShape::hasNormal() const { 00053 return false; 00054 } 00055
Generated on 28 Feb 2009 for Milton by
1.5.6