Project

General

Profile

SO3Engine
SO3MaterialPair.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
33#ifndef __SO3MATERIALPAIR_H__
34#define __SO3MATERIALPAIR_H__
35
38
39namespace SO3
40{
41
43{
44public:
45protected:
50private:
51 bool contactCallbackActivated;
52 bool overlapStartedCallbackActivated;
53 bool overlapEndedCallbackActivated;
54
55public:
58 SMaterialPair(SScene* scene, SMaterialID* mat1, SMaterialID* mat2);
59
63
66 int getID1();
67
70 int getID2();
71
75
78 void SetContactCallbackActivated(const bool& state);
79
83
86 void SetOverlapStartedCallbackActivated(const bool& state);
87
91
94 void SetOverlapEndedCallbackActivated(const bool& state);
95
98 void SetDefaultSurfaceThickness(const Ogre::Real& value);
99
102 void SetDefaultElasticity(const Ogre::Real& value);
103
106 void SetDefaultFriction(const Ogre::Real& stat, const Ogre::Real& kin);
107
110 void SetDefaultSoftness(const Ogre::Real& value);
111
114 void SetDefaultCollidable(const bool& enable);
115
119
122 virtual int onAABBOverlap(OgreNewt::Body* body0, OgreNewt::Body* body1, int threadIndex);
123
126 virtual void contactsProcess(OgreNewt::ContactJoint& contactJoint, Ogre::Real timeStep, int threadIndex);
127protected:
128};
129
130}
131
132#endif
librairies include
main class for all Rigid Bodies in the system.
with this class you can iterate through all contacts
define interaction between materials
SMaterialID * mMat1
void SetContactCallbackActivated(const bool &state)
virtual int onAABBOverlap(OgreNewt::Body *body0, OgreNewt::Body *body1, int threadIndex)
user-defined AABB-overlap function
bool GetOverlapStartedCallbackActivated()
SMaterialID * mMat2
void SetOverlapStartedCallbackActivated(const bool &state)
void SetDefaultSoftness(const Ogre::Real &value)
virtual void contactsProcess(OgreNewt::ContactJoint &contactJoint, Ogre::Real timeStep, int threadIndex)
user-defined Process function
OgreNewt::MaterialPair * O3MaterialPair
void SetDefaultElasticity(const Ogre::Real &value)
void SetOverlapEndedCallbackActivated(const bool &state)
bool GetOverlapEndedCallbackActivated()
void SetDefaultFriction(const Ogre::Real &stat, const Ogre::Real &kin)
void SetDefaultSurfaceThickness(const Ogre::Real &value)
void SetDefaultCollidable(const bool &enable)