OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Classes | Functions | Variables
Collisions.h File Reference
#include "Engine/Pid.h"
#include "Engine/Time/Duration.h"
#include "Library/Geometry/Vec.h"
#include "Library/Geometry/BBox.h"

Classes

struct  CollisionState
 

Functions

void CollideIndoorWithGeometry (bool ignore_ethereal)
 
void CollideOutdoorWithModels (bool ignore_ethereal)
 
void CollideIndoorWithDecorations ()
 
void CollideOutdoorWithDecorations (Vec2i gridPos)
 
bool CollideIndoorWithPortals ()
 
bool CollideWithActor (int actor_idx, int override_radius)
 
void _46ED8A_collide_against_sprite_objects (Pid pid)
 
void CollideWithParty (bool jagged_top)
 
void ProcessActorCollisionsBLV (Actor &actor, bool isAboveGround, bool isFlying)
 
void ProcessActorCollisionsODM (Actor &actor, bool isFlying)
 
void ProcessPartyCollisionsBLV (int sectorId, int min_party_move_delta_sqr, int *faceId, int *faceEvent)
 
void ProcessPartyCollisionsODM (Vec3f *partyNewPos, Vec3f *partyInputSpeed, int *floorFaceId, bool *partyNotOnModel, bool *partyHasHitModel, int *triggerID)
 
bool hasShorterSolution (const float a, const float b, const float c, const float curSoln, float *outNewSoln, bool inside=false)
 

Variables

CollisionState collision_state
 

Function Documentation

◆ _46ED8A_collide_against_sprite_objects()

void _46ED8A_collide_against_sprite_objects ( Pid  pid)

◆ CollideIndoorWithDecorations()

void CollideIndoorWithDecorations ( )
Original binary offset:
0x0046E0B2.

◆ CollideIndoorWithGeometry()

void CollideIndoorWithGeometry ( bool  ignore_ethereal)
Original binary offset:
0x0046E44E.

Performs collisions with level geometry in indoor levels. Updates collision_state.

Parameters
ignore_etherealWhether ethereal faces should be ignored by this function.

◆ CollideIndoorWithPortals()

bool CollideIndoorWithPortals ( )
Original binary offset:
0x0046F04E.

Performs collision checks with portals. Updates collision_state. If the collision did happen, then adjusted_move_distance member is set to 0xFFFFFF (basically a large number).

Returns
True if there were no collisions with portals.

◆ CollideOutdoorWithDecorations()

void CollideOutdoorWithDecorations ( Vec2i  gridPos)
Original binary offset:
0x0046E26D.
Parameters
gridPosGrid coordinates.

◆ CollideOutdoorWithModels()

void CollideOutdoorWithModels ( bool  ignore_ethereal)
Original binary offset:
0x0046E889.

Performs collisions with models in outdoor levels. Updates collision_state.

Parameters
ignore_etherealWhether ethereal faces should be ignored by this function.

◆ CollideWithActor()

bool CollideWithActor ( int  actor_idx,
int  override_radius 
)
Original binary offset:
0x0046DF1A.
Parameters
actor_idxActor index.
override_radiusOverride actor's radius. Pass zero to use original radius.
Returns
Whether the collision is possible.

◆ CollideWithParty()

void CollideWithParty ( bool  jagged_top)
Original binary offset:
0x0046EF01.
Parameters
jagged_topMakes collision happen even if the monster would end up above the party. However, for the collision to happen, corresponding bounding boxes still need to intersect.

◆ hasShorterSolution()

bool hasShorterSolution ( const float  a,
const float  b,
const float  c,
const float  curSoln,
float *  outNewSoln,
bool  inside = false 
)

Finds whether this quadratic (of the form AX^2 + BX + C = 0) can be solved and if the solution is smaller than out current solution. Returns true if a smaller non negative solution is found.

Parameters
aA component of quadratic.
bB component of quadratic.
cC component of quadratic.
curSolnCurrent input smallest solution to test against.
[out]outNewSolnNew smallest non negative solution. This value is not set if the function returns false.
insideIf you want collision with any point inside radius - for cylinder decorations/party
Returns
True if the quadratic has a valid solution that is smaller than the input curSoln.

◆ ProcessActorCollisionsBLV()

void ProcessActorCollisionsBLV ( Actor actor,
bool  isAboveGround,
bool  isFlying 
)

Handles actor movement - performs collision detection, updates actor's position, handles sliding on slopes, deceleration, etc.

Parameters
actorActor to move.
isAboveGroundWhether the actor is currently above ground (stands on air, basically).
isFlyingWhether the actor is a flying creature that can fly (e.g. not paralyzed).

◆ ProcessActorCollisionsODM()

void ProcessActorCollisionsODM ( Actor actor,
bool  isFlying 
)

◆ ProcessPartyCollisionsBLV()

void ProcessPartyCollisionsBLV ( int  sectorId,
int  min_party_move_delta_sqr,
int *  faceId,
int *  faceEvent 
)

◆ ProcessPartyCollisionsODM()

void ProcessPartyCollisionsODM ( Vec3f partyNewPos,
Vec3f partyInputSpeed,
int *  floorFaceId,
bool *  partyNotOnModel,
bool *  partyHasHitModel,
int *  triggerID 
)

Variable Documentation

◆ collision_state

CollisionState collision_state
extern