src/tools/values/veMath.h

Go to the documentation of this file.
00001 /*
00002 
00003 *************************************************************************
00004 
00005 ArmageTron -- Just another Tron Lightcycle Game in 3D.
00006 Copyright (C) 2000  Manuel Moos (manuel@moosnet.de)
00007 
00008 **************************************************************************
00009 
00010 This program is free software; you can redistribute it and/or
00011 modify it under the terms of the GNU General Public License
00012 as published by the Free Software Foundation; either version 2
00013 of the License, or (at your option) any later version.
00014 
00015 This program is distributed in the hope that it will be useful,
00016 but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 GNU General Public License for more details.
00019 
00020 You should have received a copy of the GNU General Public License
00021 along with this program; if not, write to the Free Software
00022 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00023 
00024 ***************************************************************************
00025 
00026 */
00027 
00030 
00031 #ifndef ARMAGETRON_veMath_h
00032 #define ARMAGETRON_veMath_h
00033 
00034 #include <math.h>
00035 #include "tRandom.h"
00036 
00037 long int ve_math_random();
00038 #include "values/vCore.h"
00039 #include "values/vebCFunction.h"
00040 
00041 
00042 namespace vValue {
00043 namespace Expr {
00044 namespace Math {
00045 
00046 class Add : public BinaryOp {
00047 public:
00048     Add(BasePtr lvalue, BasePtr rvalue) : BinaryOp(lvalue, rvalue) {}; 
00049     Add(BinaryOp const &other) : BinaryOp(other) {}; 
00050 
00051     virtual Variant GetValue(void) const; 
00052     virtual Base *copy(void) const; 
00053 };
00054 class Subtract : public BinaryOp {
00055 public:
00056     Subtract(BasePtr lvalue, BasePtr rvalue) : BinaryOp(lvalue, rvalue) {}; 
00057     Subtract(BinaryOp const &other) : BinaryOp(other) {}; 
00058 
00059     virtual Variant GetValue(void) const; 
00060     virtual Base *copy(void) const; 
00061 };
00062 class Multiply : public BinaryOp {
00063 public:
00064     Multiply(BasePtr lvalue, BasePtr rvalue) : BinaryOp(lvalue, rvalue) {}; 
00065     Multiply(BinaryOp const &other) : BinaryOp(other) {}; 
00066 
00067     virtual Variant GetValue(void) const; 
00068     virtual Base *copy(void) const; 
00069 };
00070 class Divide : public BinaryOp {
00071 public:
00072     Divide(BasePtr lvalue, BasePtr rvalue) : BinaryOp(lvalue, rvalue) {}; 
00073     Divide(BinaryOp const &other) : BinaryOp(other) {}; 
00074 
00075     virtual Variant GetValue(void) const; 
00076     virtual Base *copy(void) const; 
00077 };
00078 
00079 typedef Bindings::CFunction::fZeroary<long int, ve_math_random> Random;
00080 
00081 namespace Trig {
00082 
00083 typedef Bindings::CFunction::fUnary<float, float, sinf> Sin;
00084 
00085 }
00086 }
00087 }
00088 }
00089 
00090 #endif

Generated on Sat Mar 15 22:56:04 2008 for Armagetron Advanced by  doxygen 1.5.4