ODEJoint.h

Go to the documentation of this file.
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_ODE_JOINT_H
00029 #define OPAL_ODE_JOINT_H
00030 
00031 #include <ode/ode.h>
00032 #include "../Defines.h"
00033 #include "ODESolid.h"
00034 #include "../Joint.h"
00035 
00036 namespace opal
00037 {
00039     class ODEJoint : public Joint
00040     {
00041         public:
00042             ODEJoint( dWorldID worldID );
00043 
00044             virtual ~ODEJoint();
00045 
00049             virtual void OPAL_CALL init( const JointData& data );
00050 
00051             virtual real OPAL_CALL getAngle( int axisNum ) const;
00052 
00053             virtual real OPAL_CALL getDistance( int axisNum ) const;
00054 
00055             virtual real OPAL_CALL getVelocity( int axisNum ) const;
00056 
00057             virtual void OPAL_CALL setLimitsEnabled( int axisNum, bool e );
00058 
00059             virtual void OPAL_CALL setEnabled( bool e );
00060 
00061             virtual void OPAL_CALL setLimitRange( int axisNum, real low,
00062                                                   real high );
00063 
00064             virtual void OPAL_CALL setLimitHardness( int axisNum, real h );
00065 
00066             virtual void OPAL_CALL setLimitBounciness( int axisNum, real b );
00067 
00068             virtual JointAxis OPAL_CALL getAxis( int axisNum ) const;
00069 
00070             virtual Point3r OPAL_CALL getAnchor() const;
00071 
00072             virtual void OPAL_CALL internal_update();
00073 
00074             virtual void OPAL_CALL internal_setDesiredVel( int axisNum,
00075                     real value );
00076 
00077             virtual void OPAL_CALL internal_setMaxTorque( int axisNum,
00078                     real value );
00079 
00081             dJointID OPAL_CALL internal_getJointID() const;
00082 
00083         protected:
00084             virtual void setAxis( int axisNum, const JointAxis& axis );
00085 
00086             virtual void setAnchor( const Point3r& anchor );
00087 
00090             void setJointParam( int parameter, dReal value );
00091 
00093             virtual real calcStress();
00094 
00096             virtual void attachODEBodies( Solid* s0, Solid* s1 );
00097 
00099 
00103             void filterSolidForStaticness( Solid* s0, Solid* s1 );
00104 
00106             dJointID mJointID;
00107 
00109             dJointID mAMotorID;
00110 
00112             dWorldID mWorldID;
00113 
00117             dJointFeedback mJointFeedback;
00118 
00119         private:
00120     };
00121 }
00122 
00123 #endif

Generated on Tue May 16 17:49:51 2006 for OPAL by  doxygen 1.4.6-NO