00001 #ifndef _ODE_FLUID_H 00002 #define _ODE_FLUID_H 00003 00004 #include "MercuryODE.h" 00005 00006 class ODEFluid : public MercuryODEObjectLoadable 00007 { 00008 public: 00009 ODEFluid() { } 00010 ODEFluid( const MString & sName ) { SetName( sName ); } 00011 ~ODEFluid(); 00012 00013 virtual bool LoadFromINI( MercuryINI & pINI, const MString & sShapeName, const dWorldID & oWorld ); 00014 virtual void Update( const float dTime ); 00015 virtual void PreCycleUpdate( const float dTime ); 00016 virtual bool Collide( MercuryODEObject * pHit, dContact & pContact, MercuryODEWorld * pWorld ); 00017 CLASS_RTTI( ODEFluid, MercuryODEObjectLoadable ); 00018 private: 00019 float m_fViscosity; 00020 MercuryPoint m_pDirection; 00021 MercuryPoint m_pForce; 00022 00023 struct HitObject 00024 { 00025 HitObject() {} 00026 00027 MVector< MercuryPoint > m_pAtForces; 00028 MVector< float > m_pDirectionForce; 00029 00030 float fFric; //Amount of reflexive viscosity; lower numbers = less effect. 00031 }; 00032 00033 std::map< dBodyID, HitObject > m_pHitObjects; 00034 }; 00035 00036 #endif 00037 00038 /* 00039 * Copyright (c) 2006, Charles Lohr 00040 * All rights reserved. 00041 * 00042 * Redistribution and use in source and binary forms, with or 00043 * without modification, are permitted provided that the following 00044 * conditions are met: 00045 * - Redistributions of source code must retain the above 00046 * copyright notice, this list of conditions and the following disclaimer. 00047 * - Redistributions in binary form must reproduce the above copyright 00048 * notice, this list of conditions and the following disclaimer in 00049 * the documentation and/or other materials provided with the distribution. 00050 * - Neither the name of the Mercury Engine nor the names of its 00051 * contributors may be used to endorse or promote products derived from 00052 * this software without specific prior written permission. 00053 * 00054 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00055 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00056 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00057 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 00058 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00059 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00060 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00061 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00062 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 00063 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00064 */