SO3Engine
include
SO3PhysicGraph
SO3MaterialPair.h
Go to the documentation of this file.
1
/*
2
-----------------------------------------------------------------------------
3
This source file is part of OpenSpace3D
4
For the latest info, see http://www.openspace3d.com
5
6
Copyright (c) 2012 I-maginer
7
8
This program is free software; you can redistribute it and/or modify it under
9
the terms of the GNU Lesser General Public License as published by the Free Software
10
Foundation; either version 2 of the License, or (at your option) any later
11
version.
12
13
This program is distributed in the hope that it will be useful, but WITHOUT
14
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17
You should have received a copy of the GNU Lesser General Public License along with
18
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19
Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20
http://www.gnu.org/copyleft/lesser.txt
21
22
-----------------------------------------------------------------------------
23
*/
24
33
#ifndef __SO3MATERIALPAIR_H__
34
#define __SO3MATERIALPAIR_H__
35
36
#include "
SCOLBasic/SO3Prerequisites.h
"
37
#include <
External/ogrenewt/OgreNewt.h
>
38
39
namespace
SO3
40
{
41
42
class
SMaterialPair
:
private
OgreNewt::ContactCallback
43
{
44
public
:
45
protected
:
46
OgreNewt::MaterialPair
*
O3MaterialPair
;
47
SMaterialID
*
mMat1
;
48
SMaterialID
*
mMat2
;
49
SScene
*
mScene
;
50
private
:
51
bool
contactCallbackActivated;
52
bool
overlapStartedCallbackActivated;
53
bool
overlapEndedCallbackActivated;
54
55
public
:
58
SMaterialPair
(
SScene
* scene,
SMaterialID
* mat1,
SMaterialID
* mat2);
59
62
~SMaterialPair
();
63
66
int
getID1
();
67
70
int
getID2
();
71
74
bool
GetContactCallbackActivated
();
75
78
void
SetContactCallbackActivated
(
const
bool
& state);
79
82
bool
GetOverlapStartedCallbackActivated
();
83
86
void
SetOverlapStartedCallbackActivated
(
const
bool
& state);
87
90
bool
GetOverlapEndedCallbackActivated
();
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
118
SScene
*
GetParentScene
();
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);
127
protected
:
128
};
129
130
}
131
132
#endif
OgreNewt.h
SO3Prerequisites.h
librairies include
OgreNewt::Body
main class for all Rigid Bodies in the system.
Definition
OgreNewt_Body.h:39
OgreNewt::ContactCallback
custom contact behavior
Definition
OgreNewt_ContactCallback.h:31
OgreNewt::ContactJoint
with this class you can iterate through all contacts
Definition
OgreNewt_ContactJoint.h:33
OgreNewt::MaterialPair
define interaction between materials
Definition
OgreNewt_MaterialPair.h:32
SO3::SMaterialID
Definition
SO3MaterialID.h:45
SO3::SMaterialPair
Definition
SO3MaterialPair.h:43
SO3::SMaterialPair::getID2
int getID2()
Definition
SO3MaterialPair.cpp:48
SO3::SMaterialPair::mMat1
SMaterialID * mMat1
Definition
SO3MaterialPair.h:47
SO3::SMaterialPair::SetContactCallbackActivated
void SetContactCallbackActivated(const bool &state)
Definition
SO3MaterialPair.cpp:58
SO3::SMaterialPair::~SMaterialPair
~SMaterialPair()
Definition
SO3MaterialPair.cpp:38
SO3::SMaterialPair::onAABBOverlap
virtual int onAABBOverlap(OgreNewt::Body *body0, OgreNewt::Body *body1, int threadIndex)
user-defined AABB-overlap function
Definition
SO3MaterialPair.cpp:114
SO3::SMaterialPair::GetOverlapStartedCallbackActivated
bool GetOverlapStartedCallbackActivated()
Definition
SO3MaterialPair.cpp:63
SO3::SMaterialPair::mMat2
SMaterialID * mMat2
Definition
SO3MaterialPair.h:48
SO3::SMaterialPair::SetOverlapStartedCallbackActivated
void SetOverlapStartedCallbackActivated(const bool &state)
Definition
SO3MaterialPair.cpp:68
SO3::SMaterialPair::SetDefaultSoftness
void SetDefaultSoftness(const Ogre::Real &value)
Definition
SO3MaterialPair.cpp:99
SO3::SMaterialPair::getID1
int getID1()
Definition
SO3MaterialPair.cpp:43
SO3::SMaterialPair::contactsProcess
virtual void contactsProcess(OgreNewt::ContactJoint &contactJoint, Ogre::Real timeStep, int threadIndex)
user-defined Process function
Definition
SO3MaterialPair.cpp:166
SO3::SMaterialPair::O3MaterialPair
OgreNewt::MaterialPair * O3MaterialPair
Definition
SO3MaterialPair.h:46
SO3::SMaterialPair::mScene
SScene * mScene
Definition
SO3MaterialPair.h:49
SO3::SMaterialPair::SetDefaultElasticity
void SetDefaultElasticity(const Ogre::Real &value)
Definition
SO3MaterialPair.cpp:88
SO3::SMaterialPair::SetOverlapEndedCallbackActivated
void SetOverlapEndedCallbackActivated(const bool &state)
Definition
SO3MaterialPair.cpp:78
SO3::SMaterialPair::GetOverlapEndedCallbackActivated
bool GetOverlapEndedCallbackActivated()
Definition
SO3MaterialPair.cpp:73
SO3::SMaterialPair::SetDefaultFriction
void SetDefaultFriction(const Ogre::Real &stat, const Ogre::Real &kin)
Definition
SO3MaterialPair.cpp:93
SO3::SMaterialPair::GetContactCallbackActivated
bool GetContactCallbackActivated()
Definition
SO3MaterialPair.cpp:53
SO3::SMaterialPair::SetDefaultSurfaceThickness
void SetDefaultSurfaceThickness(const Ogre::Real &value)
Definition
SO3MaterialPair.cpp:83
SO3::SMaterialPair::GetParentScene
SScene * GetParentScene()
Definition
SO3MaterialPair.cpp:109
SO3::SMaterialPair::SetDefaultCollidable
void SetDefaultCollidable(const bool &enable)
Definition
SO3MaterialPair.cpp:104
SO3::SScene
Definition
SO3Scene.h:125
SO3
Definition
SO3DataScol.h:38
Generated by
1.9.8