Fx2D
A C++20 2D rigid-body physics engine
Loading...
Searching...
No Matches
FxContact Struct Reference

Contact data produced by the narrow phase and solver. More...

#include <Solver.h>

Collaboration diagram for FxContact:

Public Member Functions

 FxContact ()=default
 FxContact (bool valid)
bool is_valid (bool full_check=true) const
void set_valid (bool valid)

Public Attributes

size_t count = 0
FxVec2f position [2] = {{0.0f, 0.0f}, {0.0f, 0.0f}}
FxVec2f normal {0.0f, 0.0f}
float penetration_depth = FxInfinityf
float point_depth [2] = {FxInfinityf, FxInfinityf}
FxEntity * entity1 = nullptr
FxEntity * entity2 = nullptr
float jn_accumulated [2] = {0.0f, 0.0f}
float jt_accumulated [2] = {0.0f, 0.0f}
float jn_warm [2] = {0.0f, 0.0f}
float jt_warm [2] = {0.0f, 0.0f}
int32_t body1 = -1
int32_t body2 = -1
uint64_t pair_key = 0
uint32_t cache_slot = kNoCacheSlot

Static Public Attributes

static constexpr uint32_t kNoCacheSlot = 0xffffffffu

Detailed Description

Contact data produced by the narrow phase and solver.

Definition at line 71 of file Solver.h.

Constructor & Destructor Documentation

◆ FxContact() [1/2]

FxContact::FxContact ( )
default

◆ FxContact() [2/2]

FxContact::FxContact ( bool valid)
inline

Definition at line 115 of file Solver.h.

Member Function Documentation

◆ is_valid()

bool FxContact::is_valid ( bool full_check = true) const
inline

Definition at line 118 of file Solver.h.

◆ set_valid()

void FxContact::set_valid ( bool valid)
inline

Definition at line 123 of file Solver.h.

Member Data Documentation

◆ body1

int32_t FxContact::body1 = -1

Definition at line 104 of file Solver.h.

◆ body2

int32_t FxContact::body2 = -1

Definition at line 105 of file Solver.h.

◆ cache_slot

uint32_t FxContact::cache_slot = kNoCacheSlot

Definition at line 111 of file Solver.h.

◆ count

size_t FxContact::count = 0

Definition at line 79 of file Solver.h.

◆ entity1

FxEntity* FxContact::entity1 = nullptr

Definition at line 91 of file Solver.h.

◆ entity2

FxEntity* FxContact::entity2 = nullptr

Definition at line 92 of file Solver.h.

◆ jn_accumulated

float FxContact::jn_accumulated[2] = {0.0f, 0.0f}

Definition at line 95 of file Solver.h.

◆ jn_warm

float FxContact::jn_warm[2] = {0.0f, 0.0f}

Definition at line 99 of file Solver.h.

◆ jt_accumulated

float FxContact::jt_accumulated[2] = {0.0f, 0.0f}

Definition at line 96 of file Solver.h.

◆ jt_warm

float FxContact::jt_warm[2] = {0.0f, 0.0f}

Definition at line 100 of file Solver.h.

◆ kNoCacheSlot

uint32_t FxContact::kNoCacheSlot = 0xffffffffu
staticconstexpr

Definition at line 73 of file Solver.h.

◆ normal

FxVec2f FxContact::normal {0.0f, 0.0f}

Definition at line 82 of file Solver.h.

◆ pair_key

uint64_t FxContact::pair_key = 0

Definition at line 110 of file Solver.h.

◆ penetration_depth

float FxContact::penetration_depth = FxInfinityf

Definition at line 83 of file Solver.h.

◆ point_depth

float FxContact::point_depth[2] = {FxInfinityf, FxInfinityf}

Definition at line 86 of file Solver.h.

◆ position

FxVec2f FxContact::position[2] = {{0.0f, 0.0f}, {0.0f, 0.0f}}

Definition at line 80 of file Solver.h.


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