CollisionInfo class
Stores collision data for PhysicalEntity.
There are two types of collisions, solid and non-solid.
Solid collisions are only considered if their PhysicalEntity.tags overlaps with this entity's PhysicalEntity.solidTags. These could be ground tiles, walls, ceilings or other characters, enememies or movable obstacles. Pretty much anything that normal physical entities can't phase through. Any time an entity collides with another solid entity, the VelocityBehavior handles properly updating the position so they never overlap, but they will still be considered a collision.
Non-solid collisions are other entities which overlap with the PhysicalEntity, such as other moving characters, enemies, power-ups, etc.
The upCollision, downCollision, leftCollision, and rightCollision are the first solid collision in each direction.
allCollisions include all current solid and plus all non-solid entities that currently overlap or phased through.
Constructors
Properties
-
allCollisions
→ List<
PhysicalEntity< LeapGame> > -
Both solid & non-solid collisions. The solid collisions will be
touching but not overlapping.
no setter
- down → bool
-
Is currently colliding on bottom
no setter
-
downCollision
→ PhysicalEntity<
LeapGame> ? -
First solid entity that this is colliding with on bottom.
no setter
-
downCollisions
→ List<
PhysicalEntity< LeapGame> > -
All solid entities that this is colliding with on bottom.
no setter
- empty → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- left → bool
-
Is currently colliding on left
no setter
-
leftCollision
→ PhysicalEntity<
LeapGame> ? -
First solid entity that this is colliding with on left.
no setter
-
leftCollisions
→ List<
PhysicalEntity< LeapGame> > -
All solid entities that this is colliding with on left.
no setter
-
nonSolidCollisions
→ List<
PhysicalEntity< LeapGame> > -
Non-solid collisions, overlapping.
no setter
- onSlope → bool
-
no setter
- right → bool
-
Is currently colliding on right
no setter
-
rightCollision
→ PhysicalEntity<
LeapGame> ? -
First solid entity that this is colliding with on right.
no setter
-
rightCollisions
→ List<
PhysicalEntity< LeapGame> > -
All solid entities that this is colliding with on right.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- up → bool
-
Is currently colliding on top
no setter
-
upCollision
→ PhysicalEntity<
LeapGame> ? -
First solid entity that this is colliding with on top.
no setter
-
upCollisions
→ List<
PhysicalEntity< LeapGame> > -
All solid entities that this is colliding with on top.
no setter
Methods
-
addDownCollision(
PhysicalEntity< LeapGame> c) → void -
addLeftCollision(
PhysicalEntity< LeapGame> c) → void -
addNonSolidCollision(
PhysicalEntity< LeapGame> c) → void -
addRightCollision(
PhysicalEntity< LeapGame> c) → void -
addUpCollision(
PhysicalEntity< LeapGame> c) → void - Order will be maintained, and the first up collision will become the upCollision property
-
copyFrom(
CollisionInfo other) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited