00001 /************************************************************************* 00002 * * 00003 * Open Physics Abstraction Layer * 00004 * Copyright (C) 2004-2005 * 00005 * Alan Fischer alan.fischer@gmail.com * 00006 * Andres Reinot andres@reinot.com * 00007 * Tyler Streeter tylerstreeter@gmail.com * 00008 * All rights reserved. * 00009 * Web: opal.sourceforge.net * 00010 * * 00011 * This library is free software; you can redistribute it and/or * 00012 * modify it under the terms of EITHER: * 00013 * (1) The GNU Lesser General Public License as published by the Free * 00014 * Software Foundation; either version 2.1 of the License, or (at * 00015 * your option) any later version. The text of the GNU Lesser * 00016 * General Public License is included with this library in the * 00017 * file license-LGPL.txt. * 00018 * (2) The BSD-style license that is included with this library in * 00019 * the file license-BSD.txt. * 00020 * * 00021 * This library is distributed in the hope that it will be useful, * 00022 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 00024 * license-LGPL.txt and license-BSD.txt for more details. * 00025 * * 00026 *************************************************************************/ 00027 00028 #ifndef OPAL_SPRING_MOTOR_DATA_H 00029 #define OPAL_SPRING_MOTOR_DATA_H 00030 00031 #include "Defines.h" 00032 #include "MotorData.h" 00033 00034 namespace opal 00035 { 00037 enum SpringMotorMode 00038 { 00040 LINEAR_MODE, 00041 00043 ANGULAR_MODE, 00044 00047 LINEAR_AND_ANGULAR_MODE 00048 }; 00049 00051 class SpringMotorData : public MotorData 00052 { 00053 public: 00054 OPAL_DECL SpringMotorData() 00055 : MotorData() 00056 { 00057 mType = SPRING_MOTOR; 00058 solid = NULL; 00059 internal_solidIndex = 0; 00060 solidBlueprintRefName = ""; 00061 mode = LINEAR_MODE; 00062 // "attachOffset" is initialized in its own constructor. 00063 // "desiredPos" is initialized in its own constructor. 00064 desiredForward = defaults::motor::spring::desiredForward; 00065 desiredUp = defaults::motor::spring::desiredUp; 00066 desiredRight = defaults::motor::spring::desiredRight; 00067 linearKd = defaults::motor::spring::linearKd; 00068 linearKs = defaults::motor::spring::linearKs; 00069 angularKd = defaults::motor::spring::angularKd; 00070 angularKs = defaults::motor::spring::angularKs; 00071 } 00072 00074 OPAL_DECL SpringMotorData(const SpringMotorData& data) 00075 { 00076 (*this) = data; 00077 } 00078 00079 OPAL_DECL virtual ~SpringMotorData() 00080 { 00081 } 00082 00084 OPAL_DECL virtual void OPAL_CALL operator=( 00085 const SpringMotorData& data) 00086 { 00087 mType = data.mType; 00088 enabled = data.enabled; 00089 name = data.name; 00090 solid = data.solid; 00091 internal_solidIndex = data.internal_solidIndex; 00092 solidBlueprintRefName = data.solidBlueprintRefName; 00093 mode = data.mode; 00094 attachOffset = data.attachOffset; 00095 desiredPos = data.desiredPos; 00096 desiredForward = data.desiredForward; 00097 desiredUp = data.desiredUp; 00098 desiredRight = data.desiredRight; 00099 linearKd = data.linearKd; 00100 linearKs = data.linearKs; 00101 angularKd = data.angularKd; 00102 angularKs = data.angularKs; 00103 } 00104 00106 Solid* solid; 00107 00109 int internal_solidIndex; 00110 00112 std::string solidBlueprintRefName; 00113 00115 SpringMotorMode mode; 00116 00120 Point3r attachOffset; 00121 00124 Point3r desiredPos; 00125 00128 Vec3r desiredForward; 00129 00132 Vec3r desiredUp; 00133 00136 Vec3r desiredRight; 00137 00139 real linearKd; 00140 00142 real linearKs; 00143 00145 real angularKd; 00146 00148 real angularKs; 00149 00150 protected: 00151 00152 private: 00153 }; 00154 } 00155 00156 #endif