Toggle navigation
PlayRho
0.9.0
GitHub
Main Page
Modules
Classes
Files
Examples
File List
File Members
Dynamics
ContactAtty.hpp
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 Louis Langholtz https://github.com/louis-langholtz/PlayRho
3
*
4
* This software is provided 'as-is', without any express or implied
5
* warranty. In no event will the authors be held liable for any damages
6
* arising from the use of this software.
7
*
8
* Permission is granted to anyone to use this software for any purpose,
9
* including commercial applications, and to alter it and redistribute it
10
* freely, subject to the following restrictions:
11
*
12
* 1. The origin of this software must not be misrepresented; you must not
13
* claim that you wrote the original software. If you use this software
14
* in a product, an acknowledgment in the product documentation would be
15
* appreciated but is not required.
16
* 2. Altered source versions must be plainly marked as such, and must not be
17
* misrepresented as being the original software.
18
* 3. This notice may not be removed or altered from any source distribution.
19
*/
20
21
#ifndef PLAYRHO_DYNAMICS_CONTACTATTY_HPP
22
#define PLAYRHO_DYNAMICS_CONTACTATTY_HPP
23
26
27
#include <
PlayRho/Dynamics/Contacts/Contact.hpp
>
28
29
namespace
playrho
{
30
namespace
d2 {
31
43
class
ContactAtty
44
{
45
private
:
46
48
static
Manifold
& GetMutableManifold(
Contact
& c) noexcept
49
{
50
return
c.GetMutableManifold();
51
}
52
54
static
void
CopyFlags(
Contact
& to,
const
Contact
& from) noexcept
55
{
56
to.m_flags = from.m_flags;
57
}
58
60
static
void
SetToi(
Contact
& c,
Real
value) noexcept
61
{
62
c.SetToi(value);
63
}
64
66
static
void
UnsetToi(
Contact
& c) noexcept
67
{
68
c.UnsetToi();
69
}
70
72
static
void
IncrementToiCount(
Contact
& c) noexcept
73
{
74
++c.m_toiCount;
75
}
76
78
static
void
SetToiCount(
Contact
& c,
Contact::substep_type
value) noexcept
79
{
80
c.SetToiCount(value);
81
}
82
84
static
void
ResetToiCount(
Contact
& c) noexcept
85
{
86
c.SetToiCount(0);
87
}
88
90
static
void
UnflagForFiltering(
Contact
& c) noexcept
91
{
92
c.UnflagForFiltering();
93
}
94
96
static
void
Update(
Contact
& c,
const
Contact::UpdateConf
& conf,
ContactListener
* listener)
97
{
98
c.Update(conf, listener);
99
}
100
102
static
bool
IsIslanded(
const
Contact
& c) noexcept
103
{
104
return
c.IsIslanded();
105
}
106
108
static
void
SetIslanded(
Contact
& c) noexcept
109
{
110
c.SetIslanded();
111
}
112
114
static
void
UnsetIslanded(
Contact
& c) noexcept
115
{
116
c.UnsetIslanded();
117
}
118
119
friend
class
World
;
120
};
121
122
}
// namespace d2
123
}
// namespace playrho
124
125
#endif // PLAYRHO_DYNAMICS_CONTACTATTY_HPP