Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
aegis2d::ecs::Contact Struct Reference

Two entities whose boxes overlap and whose layers interact. More...

#include <aegis2d/ecs/collision.hpp>

Public Attributes

Entity first
 Entity with the smaller handle.
 
Entity second
 Entity with the larger handle.
 
bool first_hits_second = false
 hits(first's collider, second's collider).
 
bool second_hits_first = false
 hits(second's collider, first's collider).
 

Friends

constexpr bool operator== (const Contact &, const Contact &) noexcept=default
 Compares the contacts.
 
constexpr std::strong_ordering operator<=> (const Contact &, const Contact &) noexcept=default
 Orders the contacts by entities, then flags.
 

Detailed Description

Two entities whose boxes overlap and whose layers interact.

The flags tell who hits whom, so the game knows what to do: a missile that hits an enemy damages it and disappears, an enemy that touches a player hurts the player.

Friends And Related Symbol Documentation

◆ operator<=>

constexpr std::strong_ordering operator<=> ( const Contact &  ,
const Contact &   
)
friend

Orders the contacts by entities, then flags.

◆ operator==

constexpr bool operator== ( const Contact &  ,
const Contact &   
)
friend

Compares the contacts.

Member Data Documentation

◆ first

Entity aegis2d::ecs::Contact::first

Entity with the smaller handle.

◆ first_hits_second

bool aegis2d::ecs::Contact::first_hits_second = false

hits(first's collider, second's collider).

◆ second

Entity aegis2d::ecs::Contact::second

Entity with the larger handle.

◆ second_hits_first

bool aegis2d::ecs::Contact::second_hits_first = false

hits(second's collider, first's collider).


The documentation for this struct was generated from the following file: