00001 #ifndef COM_M4NKIND_Equ_XYZD_Virtual_H 00002 #define COM_M4NKIND_Equ_XYZD_Virtual_H 00003 00004 #include "BaseObject.h" 00005 #include "PackFloat.h" 00006 #include "VirtualEquation.h" 00007 class MarchinCubeSpace; 00008 00009 /*! 00010 \class Equ_XYZD_Virtual 00011 \ingroup BaseObjectInherited_VedaLibDemo 00012 \brief virtual class Defining an equation of the form: result = func(x,y,z,time) 00013 for class Object3DMarchCube. 00014 */ 00015 class Equ_XYZD_Virtual : public VirtualEquation 00016 { 00017 /*================================================================== 00018 PUBLIC 00019 ==================================================================*/ 00020 public: 00021 /*! 00022 \brief Constructor. There should only be members initialisation there. 00023 */ 00024 Equ_XYZD_Virtual(void); 00025 /*! 00026 \brief Class Inheritance Descriptors. Also forces a destructor. See BASEOBJECT_DECLARE_... in .cpp 00027 */ 00028 BASEOBJECT_DEFINE_VIRTUALCLASS(Equ_XYZD_Virtual); 00029 00030 /*! 00031 \brief Set the framedate, and compute all terms with a constant date. 00032 pass a int which must be equal to 0 at start. 00033 \param _date in seconds 00034 \param _iTermIndex an index of the equation term to process. 00035 \param _pbound a 6 float table, xmin,xman,ymin,ymax,zmin,mzmax of the cube where values are !=1.0 00036 \return false if index is out of bounds. 00037 */ 00038 virtual bool SetFrameDate( float _date, unsigned int _iTermIndex,float _pbound[6] )=0; 00039 //virtual float SetYZ( float _y,float _z )=0; 00040 /*! 00041 \brief set X and Y constant. If it return false, all values are 1.0f 00042 and ComputeByX() is false. 00043 \param 00044 */ 00045 virtual bool SetYZConstant( float _y,float _z)=0; 00046 /*! 00047 \brief 00048 \param 00049 */ 00050 virtual float ComputeByX( float _x)=0; 00051 00052 /*! 00053 \brief Compute a scalar value according to a parameter list (X,Y,Z,D). 00054 \param _OutgoingParameterTable result table. elements are writen or not according to the equation. 00055 \param _IncomingParameterTable. float table, the (X,Y,Z,D) parameters. 00056 \return scalar value in space. 00057 */ 00058 float Compute( float _x,float _y,float _z ); 00059 /*! 00060 \brief VirtualEquation 's virtual method redirection 00061 \param _OutgoingParameterTable result table. elements are writen or not according to the equation. 00062 \param _IncomingParameterTable. float table, the (X,Y,Z,D) parameters. 00063 */ 00064 virtual void Compute( float _OutgoingParameterTable[4] , const float _IncomingParameterTable[4] ); 00065 00066 #ifdef _ENGINE_EDITABLE_ 00067 /*! 00068 \brief a GUI could need to play, draw, print, or output from any way, a preview of a 00069 created object. This is done with this method. sub classes can implement it (or not) in 00070 any way, to explicit current shape of an object.<br> 00071 00072 \param _frameDate a date, in second, which defines the effect cinematic. 00073 \param _pPreviewViewPort the viewport to render. Can't be 0L. 00074 \param _pPreviewConfiguration 00075 */ 00076 //virtual void ProcessPreview(double _frameDate,VirtualMachine::InternalViewPort *_pPreviewViewPort,const PreviewConfiguration *_pPreviewConfiguration); 00077 #endif 00078 /*! 00079 \brief Tool: make an inverted parabolic curve that look like sqrt between 0 and 1. 00080 if >1, 1 is returned. 00081 \param _vv value 00082 \return 1-((1-_vv)^2) 00083 */ 00084 static inline float QuickSqrtM(float _vv) 00085 { 00086 register const float v1p0=/*PackFloat::m_1p0*/1.0f; // 1.0f 00087 if(_vv>v1p0) return v1p0; 00088 _vv = v1p0-_vv; 00089 _vv = _vv*_vv; 00090 return v1p0-_vv ; 00091 }; 00092 00093 /*================================================================== 00094 PROTECTED 00095 ==================================================================*/ 00096 protected: 00097 //! the constant Y parameter set by SetYZConstant() 00098 float m_y; 00099 //! the constant Z parameter set by SetYZConstant() 00100 float m_z; 00101 //! for allegeance to VirtualEquation Compte() system, we can keep the last date used for SetFrameDate() 00102 float m_LastComputedDate; 00103 00104 #ifdef _ENGINE_EDITABLE_ 00105 /*! 00106 \brief protected extention for ProcessPreview() that allows to draw the equation on a bitmap. 00107 \param _frameDate a date, in second, which defines the effect cinematic. 00108 */ 00109 //virtual void ProcessPreview_Equation(double _frameDate); 00110 #endif 00111 }; 00112 #endif
/\/\ 4 N k ! N D _______ _ __ ___ _____ ___ _ _ ____ ___________ __//___ /________ |/ / ___________\_______/ \ / _ _ \/ _ / _ / _/_/____/ _ __ / / / / / / / \ \/ / / \ \ / \\___/___/___/ ¯ _____/_____/ ______\___/_____/\________\\ \________/_ ___ __ l____\ /elD! http://www.m4nkind.com \____/