Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

kickeffector_c.cpp

Go to the documentation of this file.
00001 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
00002 
00003    this file is part of rcssserver3D
00004    Fri May 9 2003
00005    Copyright (C) 2002,2003 Koblenz University
00006    Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group
00007    $Id: kickeffector_c.cpp,v 1.6 2004/05/14 16:40:23 fruit Exp $
00008 
00009    This program is free software; you can redistribute it and/or modify
00010    it under the terms of the GNU General Public License as published by
00011    the Free Software Foundation; version 2 of the License.
00012 
00013    This program is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with this program; if not, write to the Free Software
00020    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00021 */
00022 
00023 #include "kickeffector.h"
00024 
00025 using namespace oxygen;
00026 
00027 FUNCTION(KickEffector,setKickMargin)
00028 {
00029     float inMargin;
00030 
00031     if (
00032         (in.GetSize() != 1) ||
00033         (! in.GetValue(in.begin(), inMargin))
00034         )
00035         {
00036             return false;
00037         }
00038 
00039     obj->SetKickMargin(inMargin);
00040     return true;
00041 }
00042 
00043 FUNCTION(KickEffector,setForceFactor)
00044 {
00045     float inForceFactor;
00046 
00047     if (
00048         (in.GetSize() != 1) ||
00049         (! in.GetValue(in.begin(), inForceFactor))
00050         )
00051         {
00052             return false;
00053         }
00054 
00055     obj->SetForceFactor(inForceFactor);
00056     return true;
00057 }
00058 
00059 FUNCTION(KickEffector,setTorqueFactor)
00060 {
00061     float inTorqueFactor;
00062 
00063     if (
00064         (in.GetSize() != 1) ||
00065         (! in.GetValue(in.begin(), inTorqueFactor))
00066         )
00067         {
00068             return false;
00069         }
00070 
00071     obj->SetTorqueFactor(inTorqueFactor);
00072     return true;
00073 }
00074 
00075 FUNCTION(KickEffector,setSteps)
00076 {
00077     int steps;
00078 
00079     if (
00080         (in.GetSize() != 1) ||
00081         (! in.GetValue(in[0], steps))
00082         )
00083         {
00084             return false;
00085         }
00086 
00087     obj->SetSteps(steps);
00088     return true;
00089 }
00090 
00091 FUNCTION(KickEffector,setNoiseParams)
00092 {
00093     float inForce;
00094     float inTheta;
00095     float inPhiEnd;
00096     float inPhiMid;
00097 
00098     if (
00099         (in.GetSize() != 4) ||
00100         (! in.GetValue(in[0], inForce)) ||
00101         (! in.GetValue(in[1], inTheta)) ||
00102         (! in.GetValue(in[2], inPhiEnd)) ||
00103         (! in.GetValue(in[3], inPhiMid))
00104         )
00105         {
00106             return false;
00107         }
00108 
00109     obj->SetNoiseParams(inForce,inTheta,inPhiEnd,inPhiMid);
00110     return true;
00111 }
00112 
00113 FUNCTION(KickEffector,setMaxPower)
00114 {
00115     float inMaxPower;
00116 
00117     if (
00118         (in.GetSize() != 1) ||
00119         (! in.GetValue(in.begin(), inMaxPower))
00120         )
00121         {
00122             return false;
00123         }
00124 
00125     obj->SetMaxPower(inMaxPower);
00126     return true;
00127 }
00128 
00129 FUNCTION(KickEffector,setAngleRange)
00130 {
00131     float inMin;
00132     float inMax;
00133 
00134     if (
00135         (in.GetSize() != 2) ||
00136         (! in.GetValue(in[0], inMin)) ||
00137         (! in.GetValue(in[1], inMax))
00138         )
00139         {
00140             return false;
00141         }
00142 
00143     obj->SetAngleRange(inMin,inMax);
00144     return true;
00145 }
00146 
00147 void CLASS(KickEffector)::DefineClass()
00148 {
00149     DEFINE_BASECLASS(oxygen/Effector);
00150     DEFINE_FUNCTION(setKickMargin);
00151     DEFINE_FUNCTION(setForceFactor);
00152     DEFINE_FUNCTION(setTorqueFactor);
00153     DEFINE_FUNCTION(setSteps);
00154     DEFINE_FUNCTION(setNoiseParams);
00155     DEFINE_FUNCTION(setMaxPower);
00156     DEFINE_FUNCTION(setAngleRange);
00157 }

Generated on Thu Apr 6 15:25:38 2006 for rcssserver3d by  doxygen 1.4.4