00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OpenSpace3D 00004 For the latest info, see http://www.openspace3d.com 00005 00006 Copyright (c) 2010 I-maginer 00007 00008 This program is free software; you can redistribute it and/or modify it under 00009 the terms of the GNU Lesser General Public License as published by the Free Software 00010 Foundation; either version 2 of the License, or (at your option) any later 00011 version. 00012 00013 This program is distributed in the hope that it will be useful, but WITHOUT 00014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00015 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License along with 00018 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00019 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00020 http://www.gnu.org/copyleft/lesser.txt 00021 00022 You may alternatively use this source under the terms of a specific version of 00023 the OpenSpace3D Unrestricted License provided you have obtained such a license from 00024 I-maginer. 00025 ----------------------------------------------------------------------------- 00026 */ 00027 00036 #ifndef __SO3MATERIALPAIR_H__ 00037 #define __SO3MATERIALPAIR_H__ 00038 00039 #include "..\SCOLBasic\SO3Std.h" 00040 00041 namespace SO3 00042 { 00043 00044 class SMaterialPair: private OgreNewt::ContactCallback 00045 { 00046 public: 00047 protected: 00048 OgreNewt::MaterialPair * O3MaterialPair; 00049 SMaterialID* mMat1; 00050 SMaterialID* mMat2; 00051 SScene* mScene; 00052 00053 private: 00054 bool contactCallbackActivated; 00055 bool overlapStartedCallbackActivated; 00056 bool overlapEndedCallbackActivated; 00057 00058 public: 00059 SMaterialPair(SScene* scene, SMaterialID* mat1, SMaterialID* mat2); 00060 ~SMaterialPair(); 00061 00064 int getID1(); 00065 00068 int getID2(); 00069 00072 bool GetContactCallbackActivated(); 00073 00076 void SetContactCallbackActivated(bool state); 00077 00080 bool GetOverlapStartedCallbackActivated(); 00081 00084 void SetOverlapStartedCallbackActivated(bool state); 00085 00088 bool GetOverlapEndedCallbackActivated(); 00089 00092 void SetOverlapEndedCallbackActivated(bool state); 00093 00096 void SetDefaultSurfaceThickness(Ogre::Real value); 00097 00100 void SetDefaultElasticity(Ogre::Real value); 00101 00104 void SetDefaultFriction(Ogre::Real stat, Ogre::Real kin); 00105 00108 void SetDefaultSoftness(Ogre::Real value); 00109 00112 void SetDefaultCollidable(bool enable); 00113 00116 void SetContinuousCollisionMode(bool enable); 00117 00120 SScene* GetParentScene(); 00121 00124 virtual int onAABBOverlap( OgreNewt::Body* body0, OgreNewt::Body* body1, int threadIndex ); 00125 00128 virtual void contactsProcess( OgreNewt::ContactJoint &contactJoint, Ogre::Real timeStep, int threadIndex ); 00129 protected: 00130 }; 00131 00132 } 00133 00134 #endif
1.6.3