Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

VectorValue.h

Go to the documentation of this file.
00001 // VectorValue.h: interface for the CVectorValue class.
00002 /*
00003  * Copyright (c) 1996-2000 Erwin Coumans <[email protected]>

00004  *
00005  * Permission to use, copy, modify, distribute and sell this software

00006  * and its documentation for any purpose is hereby granted without fee,

00007  * provided that the above copyright notice appear in all copies and

00008  * that both that copyright notice and this permission notice appear

00009  * in supporting documentation.  Erwin Coumans makes no

00010  * representations about the suitability of this software for any

00011  * purpose.  It is provided "as is" without express or implied warranty.

00012  *
00013  */
00014 #if !defined _VECTORVALUE_H
00015 #define _VECTORVALUE_H
00016 
00017 
00018 #include "Value.h"
00019 
00020 #define KX_X 0
00021 #define KX_Y 1
00022 #define KX_Z 2
00023 
00024 
00025 class CVectorValue : public CPropValue  
00026 {
00027         //PLUGIN_DECLARE_SERIAL(CVectorValue,CValue)
00028 
00029 public:
00030         //void Transform(rcMatrix4x4 mat);
00031         virtual void SetValue(CValue* newval);
00032         void SetVector(double newvec[]);
00033         void Configure(CValue* menuvalue);
00034         virtual double* GetVector3(bool bGetTransformedVec=false);
00035         virtual float           GetNumber();
00036         
00037         CValue*         Calc(VALUE_OPERATOR op, CValue *val) {
00038                 return val->CalcFinal(VALUE_VECTOR_TYPE, op, this);
00039         }
00040         
00041         CValue*         CVectorValue::CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val);
00042         
00043         
00044         CVectorValue(double vec[],CCString name,AllocationTYPE alloctype=CValue::HEAPVALUE);
00045         CVectorValue() {};
00046 
00047         CVectorValue(double vec[],AllocationTYPE alloctype=CValue::HEAPVALUE);
00048         CVectorValue(float x,float y,float z, AllocationTYPE alloctype = CValue::HEAPVALUE);
00049         virtual ~CVectorValue();
00050         //virtual bool ExportT3D(File *txtfile,bool bNoName=false);
00051         void AddConfigurationData(CValue* menuvalue);
00052         
00053 
00054 
00055         virtual CValue* GetReplica();
00056         virtual const CCString & GetText();
00057 
00058 /*
00059         void                    SnapPoint(float num,int snap)

00060         {

00061                 if (num > 0) num += ((float)snap / 2);

00062                 else num -= ((float)snap / 2);

00063                 num = (long)(((long)(num / snap)) * snap);

00064         };

00065 
00066         void SnapPosition(const double snapvec[])

00067         {

00068                 

00069                 if (snapvec[KX_X] >= 1)

00070                         SnapPoint(m_vec[KX_X],snapvec[KX_X]);

00071                 if (snapvec[KX_Y] >= 1)

00072                         SnapPoint(m_vec[KX_Y],snapvec[KX_Y]);

00073                 if (snapvec[KX_Z] >= 1)

00074                         SnapPoint(m_vec[KX_Z],snapvec[KX_Z]);

00075                         

00076         }

00077 */
00078         
00079 protected:
00080         double                          m_vec[3];
00081         double                          m_transformedvec[3];
00082 };
00083 
00084 #endif // !defined _VECTORVALUE_H
00085 

Generated at Thu Feb 1 13:03:13 2001 for Ketsji Game Engine by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000