Jypeli
9
The simple game programming library
OneWayPlatformIgnorer.cs
Siirry tämän tiedoston dokumentaatioon.
1
namespace
Jypeli.Physics
2
{
6
public
class
OneWayPlatformIgnorer
:
Ignorer
7
{
8
double
depthAllowed
;
9
10
public
OneWayPlatformIgnorer
(
double
depthAllowed
)
11
{
12
this.depthAllowed =
depthAllowed
;
13
}
14
15
public
override
bool
BothNeeded
16
{
17
get
18
{
19
return
false
;
20
}
21
}
22
23
public
override
bool
CanCollide
(
IPhysicsBody
thisBody,
IPhysicsBody
otherBody,
Ignorer
other)
24
{
25
if
(otherBody.
IgnoresPhysicsLogics
)
26
// || otherBody.IsBroadPhaseOnly)
27
{
28
return
true
;
29
}
30
31
return
thisBody.
Position
.
Y
-
depthAllowed
> otherBody.
Position
.
Y
;
32
}
33
}
34
}
Jypeli.Physics.OneWayPlatformIgnorer.depthAllowed
double depthAllowed
Definition:
OneWayPlatformIgnorer.cs:8
Jypeli.Physics.IPhysicsBody.Position
Vector Position
Definition:
IPhysicsBody.cs:18
Jypeli.Physics.OneWayPlatformIgnorer.BothNeeded
override bool BothNeeded
Definition:
OneWayPlatformIgnorer.cs:16
Jypeli.Physics.OneWayPlatformIgnorer.OneWayPlatformIgnorer
OneWayPlatformIgnorer(double depthAllowed)
Definition:
OneWayPlatformIgnorer.cs:10
Jypeli.Physics.OneWayPlatformIgnorer.CanCollide
override bool CanCollide(IPhysicsBody thisBody, IPhysicsBody otherBody, Ignorer other)
Definition:
OneWayPlatformIgnorer.cs:23
Jypeli.Ignorer
Base class for Collision Ignorers to impliment.
Definition:
Ignorer.cs:40
Jypeli.Physics.IPhysicsBody
Definition:
IPhysicsBody.cs:4
Jypeli.Physics.OneWayPlatformIgnorer
Allows us to have platforms that are one way.
Definition:
OneWayPlatformIgnorer.cs:7
Jypeli.Physics
Definition:
Collision.cs:4
Jypeli.Physics.IPhysicsBody.IgnoresPhysicsLogics
bool IgnoresPhysicsLogics
Definition:
IPhysicsBody.cs:31
Jypeli.Vector.Y
double Y
Definition:
Vector.cs:313
Jypeli
Physics
Ignorers
OneWayPlatformIgnorer.cs
Generoinut projektille Jypeli Sat Oct 17 2020 19:03:16
1.8.20