00001 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- 00002 this file is part of rcssserver3D 00003 Fri May 9 2003 00004 Copyright (C) 2003 Koblenz University 00005 $Id: angularmotor.h,v 1.2 2004/05/01 11:30:31 rollmark Exp $ 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; version 2 of the License. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 */ 00020 #ifndef OXYGEN_ANGULARMOTOR_H 00021 #define OXYGEN_ANGULARMOTOR_H 00022 00023 #include "joint.h" 00024 00025 namespace oxygen 00026 { 00027 class Body; 00028 00034 class AngularMotor : public Joint 00035 { 00036 public: 00037 enum EMotorMode 00038 { 00039 MM_USER = dAMotorUser, 00040 MM_EULER = dAMotorEuler 00041 }; 00042 00043 enum EAxisAnchor 00044 { 00045 AA_GLOBAL = 0, 00046 AA_FIRSTBODY = 1, 00047 AA_SECONDBODY = 2 00048 }; 00049 00050 public: 00051 AngularMotor(); 00052 virtual ~AngularMotor(); 00053 00061 void SetMode(EMotorMode mode); 00062 00064 EMotorMode GetMode(); 00065 00071 void SetNumAxes(int num); 00072 00075 int GetNumAxes(); 00076 00087 void SetMotorAxis(EAxisIndex idx, EAxisAnchor anchor, 00088 const salt::Vector3f& axis); 00089 00091 salt::Vector3f GetMotorAxis(EAxisIndex idx); 00092 00095 EAxisAnchor GetAxisAnchor(EAxisIndex idx); 00096 00101 void SetAxisAngle(EAxisIndex idx, float degAngle); 00102 00108 float GetAxisAngle(EAxisIndex idx); 00109 00115 float GetAxisAngleRate(EAxisIndex idx); 00116 00117 protected: 00119 virtual void OnLink(); 00120 00122 virtual void SetParameter(int parameter, float value); 00123 00125 virtual float GetParameter(int parameter); 00126 }; 00127 00128 DECLARE_CLASS(AngularMotor); 00129 00130 } // namespace oxygen 00131 00132 #endif // OXYGEN_ANGULARMOTOR_H