00001 00007 #pragma once 00008 #ifndef QUADRIC_H 00009 #define QUADRIC_H 00010 00011 #include "Types.h" 00012 #include "Rendernode.h" 00013 00014 namespace RenderTools { 00015 00016 class Quadric : public Rendernode { 00017 public: 00018 00019 Quadric( void ); 00020 virtual ~Quadric( void ); 00021 00022 virtual Mat4 findSurfaceGlobal( const Vec3 & global, int iterations = 10 ) const = 0; 00023 virtual Mat4 findSurfaceLocal( const Vec3 & local, int iterations = 10 ) const = 0; 00024 00025 const Vec4 & getSize( void ) const; 00026 void setSize( const Vec4 & v, bool send = true ); 00027 00028 const Vec2 & getExponents( void ) const; 00029 void setExponents( const Vec2 & v, bool send = true ); 00030 00031 const Vec2 & getRoundness( void ) const; 00032 void setRoundness( const Vec2 & v, bool send = true ); 00033 00034 const Vec3 & getSubdivisions( void ) const; 00035 void setSubdivisions( const Vec3 & v, bool send = true ); 00036 00037 const bool getCorrectUV( void ) const; 00038 void setCorrectUV( bool state, bool send = true ); 00039 00040 protected: 00041 double cvn( double v, double n ); 00042 double sgnf( double x ); 00043 double svn( double v, double n ); 00044 00045 Vec4 m_size; 00046 Vec2 m_exponents; 00047 Vec2 m_roundness; 00048 Vec3 m_subdiv; 00049 bool m_correctUV; 00050 }; 00051 00052 }; // namespace RenderTools 00053 00054 #endif
1.5.8