DDraceNetwork Docs
CCollision Class Reference

#include <collision.h>

Collaboration diagram for CCollision:
[legend]

Public Member Functions

 CCollision ()
 
 ~CCollision ()
 
void Init (CLayers *pLayers)
 
void Unload ()
 
void FillAntibot (CAntibotMapData *pMapData) const
 
bool CheckPoint (float x, float y) const
 
bool CheckPoint (vec2 Pos) const
 
int GetCollisionAt (float x, float y) const
 
int GetWidth () const
 
int GetHeight () const
 
int IntersectLine (vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision) const
 
int IntersectLineTeleWeapon (vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision, int *pTeleNr=nullptr) const
 
int IntersectLineTeleHook (vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision, int *pTeleNr=nullptr) const
 
void MovePoint (vec2 *pInoutPos, vec2 *pInoutVel, float Elasticity, int *pBounces) const
 
void MoveBox (vec2 *pInoutPos, vec2 *pInoutVel, vec2 Size, vec2 Elasticity, bool *pGrounded=nullptr) const
 
bool TestBox (vec2 Pos, vec2 Size) const
 
void SetCollisionAt (float x, float y, int Index)
 
void SetDCollisionAt (float x, float y, int Type, int Flags, int Number)
 
int GetDTileIndex (int Index) const
 
int GetDTileFlags (int Index) const
 
int GetDTileNumber (int Index) const
 
int GetFCollisionAt (float x, float y) const
 
int IntersectNoLaser (vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision) const
 
int IntersectNoLaserNW (vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision) const
 
int IntersectAir (vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision) const
 
int GetIndex (int x, int y) const
 
int GetIndex (vec2 PrevPos, vec2 Pos) const
 
int GetFIndex (int x, int y) const
 
int GetMoveRestrictions (CALLBACK_SWITCHACTIVE pfnSwitchActive, void *pUser, vec2 Pos, float Distance=18.0f, int OverrideCenterTileIndex=-1) const
 
int GetMoveRestrictions (vec2 Pos, float Distance=18.0f) const
 
int GetTile (int x, int y) const
 
int GetFTile (int x, int y) const
 
int Entity (int x, int y, int Layer) const
 
int GetPureMapIndex (float x, float y) const
 
int GetPureMapIndex (vec2 Pos) const
 
std::vector< int > GetMapIndices (vec2 PrevPos, vec2 Pos, unsigned MaxIndices=0) const
 
int GetMapIndex (vec2 Pos) const
 
bool TileExists (int Index) const
 
bool TileExistsNext (int Index) const
 
vec2 GetPos (int Index) const
 
int GetTileIndex (int Index) const
 
int GetFTileIndex (int Index) const
 
int GetTileFlags (int Index) const
 
int GetFTileFlags (int Index) const
 
int IsTeleport (int Index) const
 
int IsEvilTeleport (int Index) const
 
bool IsCheckTeleport (int Index) const
 
bool IsCheckEvilTeleport (int Index) const
 
int IsTeleportWeapon (int Index) const
 
int IsTeleportHook (int Index) const
 
int IsTeleCheckpoint (int Index) const
 
int IsSpeedup (int Index) const
 
int IsTune (int Index) const
 
void GetSpeedup (int Index, vec2 *pDir, int *pForce, int *pMaxSpeed) const
 
int GetSwitchType (int Index) const
 
int GetSwitchNumber (int Index) const
 
int GetSwitchDelay (int Index) const
 
int IsSolid (int x, int y) const
 
bool IsThrough (int x, int y, int OffsetX, int OffsetY, vec2 Pos0, vec2 Pos1) const
 
bool IsHookBlocker (int x, int y, vec2 Pos0, vec2 Pos1) const
 
int IsWallJump (int Index) const
 
int IsNoLaser (int x, int y) const
 
int IsFNoLaser (int x, int y) const
 
int IsTimeCheckpoint (int Index) const
 
int IsFTimeCheckpoint (int Index) const
 
int IsMover (int x, int y, int *pFlags) const
 
vec2 CpSpeed (int index, int Flags=0) const
 
const CLayersLayers () const
 
const CTileGameLayer () const
 
const CTeleTileTeleLayer () const
 
const CSpeedupTileSpeedupLayer () const
 
const CTileFrontLayer () const
 
const CSwitchTileSwitchLayer () const
 
const CTuneTileTuneLayer () const
 
vec2 TeleAllGet (int Number, size_t Offset)
 
size_t TeleAllSize (int Number)
 
const std::vector< vec2 > & TeleIns (int Number)
 
const std::vector< vec2 > & TeleOuts (int Number)
 
const std::vector< vec2 > & TeleCheckOuts (int Number)
 
const std::vector< vec2 > & TeleOthers (int Number)
 

Public Attributes

int m_HighestSwitchNumber
 

Private Attributes

CLayersm_pLayers
 
int m_Width
 
int m_Height
 
CTilem_pTiles
 
CTeleTilem_pTele
 
CSpeedupTilem_pSpeedup
 
CTilem_pFront
 
CSwitchTilem_pSwitch
 
CTuneTilem_pTune
 
CDoorTilem_pDoor
 
std::map< int, std::vector< vec2 > > m_TeleIns
 
std::map< int, std::vector< vec2 > > m_TeleOuts
 
std::map< int, std::vector< vec2 > > m_TeleCheckOuts
 
std::map< int, std::vector< vec2 > > m_TeleOthers
 

Constructor & Destructor Documentation

◆ CCollision()

CCollision::CCollision ( )

◆ ~CCollision()

CCollision::~CCollision ( )

Member Function Documentation

◆ CheckPoint() [1/2]

bool CCollision::CheckPoint ( float  x,
float  y 
) const
inline

◆ CheckPoint() [2/2]

bool CCollision::CheckPoint ( vec2  Pos) const
inline

◆ CpSpeed()

vec2 CCollision::CpSpeed ( int  index,
int  Flags = 0 
) const

◆ Entity()

int CCollision::Entity ( int  x,
int  y,
int  Layer 
) const

◆ FillAntibot()

void CCollision::FillAntibot ( CAntibotMapData pMapData) const

◆ FrontLayer()

const CTile * CCollision::FrontLayer ( ) const
inline

◆ GameLayer()

const CTile * CCollision::GameLayer ( ) const
inline

◆ GetCollisionAt()

int CCollision::GetCollisionAt ( float  x,
float  y 
) const
inline

◆ GetDTileFlags()

int CCollision::GetDTileFlags ( int  Index) const

◆ GetDTileIndex()

int CCollision::GetDTileIndex ( int  Index) const

◆ GetDTileNumber()

int CCollision::GetDTileNumber ( int  Index) const

◆ GetFCollisionAt()

int CCollision::GetFCollisionAt ( float  x,
float  y 
) const
inline

◆ GetFIndex()

int CCollision::GetFIndex ( int  x,
int  y 
) const

◆ GetFTile()

int CCollision::GetFTile ( int  x,
int  y 
) const

◆ GetFTileFlags()

int CCollision::GetFTileFlags ( int  Index) const

◆ GetFTileIndex()

int CCollision::GetFTileIndex ( int  Index) const

◆ GetHeight()

int CCollision::GetHeight ( ) const
inline

◆ GetIndex() [1/2]

int CCollision::GetIndex ( int  x,
int  y 
) const

◆ GetIndex() [2/2]

int CCollision::GetIndex ( vec2  PrevPos,
vec2  Pos 
) const

◆ GetMapIndex()

int CCollision::GetMapIndex ( vec2  Pos) const

◆ GetMapIndices()

std::vector< int > CCollision::GetMapIndices ( vec2  PrevPos,
vec2  Pos,
unsigned  MaxIndices = 0 
) const

◆ GetMoveRestrictions() [1/2]

int CCollision::GetMoveRestrictions ( CALLBACK_SWITCHACTIVE  pfnSwitchActive,
void *  pUser,
vec2  Pos,
float  Distance = 18.0f,
int  OverrideCenterTileIndex = -1 
) const

◆ GetMoveRestrictions() [2/2]

int CCollision::GetMoveRestrictions ( vec2  Pos,
float  Distance = 18.0f 
) const
inline

◆ GetPos()

vec2 CCollision::GetPos ( int  Index) const

◆ GetPureMapIndex() [1/2]

int CCollision::GetPureMapIndex ( float  x,
float  y 
) const

◆ GetPureMapIndex() [2/2]

int CCollision::GetPureMapIndex ( vec2  Pos) const
inline

◆ GetSpeedup()

void CCollision::GetSpeedup ( int  Index,
vec2 pDir,
int *  pForce,
int *  pMaxSpeed 
) const

◆ GetSwitchDelay()

int CCollision::GetSwitchDelay ( int  Index) const

◆ GetSwitchNumber()

int CCollision::GetSwitchNumber ( int  Index) const

◆ GetSwitchType()

int CCollision::GetSwitchType ( int  Index) const

◆ GetTile()

int CCollision::GetTile ( int  x,
int  y 
) const

◆ GetTileFlags()

int CCollision::GetTileFlags ( int  Index) const

◆ GetTileIndex()

int CCollision::GetTileIndex ( int  Index) const

◆ GetWidth()

int CCollision::GetWidth ( ) const
inline

◆ Init()

void CCollision::Init ( CLayers pLayers)

◆ IntersectAir()

int CCollision::IntersectAir ( vec2  Pos0,
vec2  Pos1,
vec2 pOutCollision,
vec2 pOutBeforeCollision 
) const

◆ IntersectLine()

int CCollision::IntersectLine ( vec2  Pos0,
vec2  Pos1,
vec2 pOutCollision,
vec2 pOutBeforeCollision 
) const

◆ IntersectLineTeleHook()

int CCollision::IntersectLineTeleHook ( vec2  Pos0,
vec2  Pos1,
vec2 pOutCollision,
vec2 pOutBeforeCollision,
int *  pTeleNr = nullptr 
) const

◆ IntersectLineTeleWeapon()

int CCollision::IntersectLineTeleWeapon ( vec2  Pos0,
vec2  Pos1,
vec2 pOutCollision,
vec2 pOutBeforeCollision,
int *  pTeleNr = nullptr 
) const

◆ IntersectNoLaser()

int CCollision::IntersectNoLaser ( vec2  Pos0,
vec2  Pos1,
vec2 pOutCollision,
vec2 pOutBeforeCollision 
) const

◆ IntersectNoLaserNW()

int CCollision::IntersectNoLaserNW ( vec2  Pos0,
vec2  Pos1,
vec2 pOutCollision,
vec2 pOutBeforeCollision 
) const

◆ IsCheckEvilTeleport()

bool CCollision::IsCheckEvilTeleport ( int  Index) const

◆ IsCheckTeleport()

bool CCollision::IsCheckTeleport ( int  Index) const

◆ IsEvilTeleport()

int CCollision::IsEvilTeleport ( int  Index) const

◆ IsFNoLaser()

int CCollision::IsFNoLaser ( int  x,
int  y 
) const

◆ IsFTimeCheckpoint()

int CCollision::IsFTimeCheckpoint ( int  Index) const

◆ IsHookBlocker()

bool CCollision::IsHookBlocker ( int  x,
int  y,
vec2  Pos0,
vec2  Pos1 
) const

◆ IsMover()

int CCollision::IsMover ( int  x,
int  y,
int *  pFlags 
) const

◆ IsNoLaser()

int CCollision::IsNoLaser ( int  x,
int  y 
) const

◆ IsSolid()

int CCollision::IsSolid ( int  x,
int  y 
) const

◆ IsSpeedup()

int CCollision::IsSpeedup ( int  Index) const

◆ IsTeleCheckpoint()

int CCollision::IsTeleCheckpoint ( int  Index) const

◆ IsTeleport()

int CCollision::IsTeleport ( int  Index) const

◆ IsTeleportHook()

int CCollision::IsTeleportHook ( int  Index) const

◆ IsTeleportWeapon()

int CCollision::IsTeleportWeapon ( int  Index) const

◆ IsThrough()

bool CCollision::IsThrough ( int  x,
int  y,
int  OffsetX,
int  OffsetY,
vec2  Pos0,
vec2  Pos1 
) const

◆ IsTimeCheckpoint()

int CCollision::IsTimeCheckpoint ( int  Index) const

◆ IsTune()

int CCollision::IsTune ( int  Index) const

◆ IsWallJump()

int CCollision::IsWallJump ( int  Index) const

◆ Layers()

const CLayers * CCollision::Layers ( ) const
inline

◆ MoveBox()

void CCollision::MoveBox ( vec2 pInoutPos,
vec2 pInoutVel,
vec2  Size,
vec2  Elasticity,
bool *  pGrounded = nullptr 
) const

◆ MovePoint()

void CCollision::MovePoint ( vec2 pInoutPos,
vec2 pInoutVel,
float  Elasticity,
int *  pBounces 
) const

◆ SetCollisionAt()

void CCollision::SetCollisionAt ( float  x,
float  y,
int  Index 
)

◆ SetDCollisionAt()

void CCollision::SetDCollisionAt ( float  x,
float  y,
int  Type,
int  Flags,
int  Number 
)

◆ SpeedupLayer()

const CSpeedupTile * CCollision::SpeedupLayer ( ) const
inline

◆ SwitchLayer()

const CSwitchTile * CCollision::SwitchLayer ( ) const
inline

◆ TeleAllGet()

vec2 CCollision::TeleAllGet ( int  Number,
size_t  Offset 
)

Index all teleporter types (in, out and checkpoints) as one consecutive list.

Parameters
Numberis the teleporter number (one less than what is shown in game)
Offsetpicks the n'th occurence of that teleporter in the map
Returns
The coordinates of the teleporter in the map or (-1, -1) if not found

◆ TeleAllSize()

size_t CCollision::TeleAllSize ( int  Number)
Parameters
Numberis the teleporter number (one less than what is shown in game)
Returns
The amount of occurences of that teleporter across all types (in, out, checkpoint)

◆ TeleCheckOuts()

const std::vector< vec2 > & CCollision::TeleCheckOuts ( int  Number)
inline

◆ TeleIns()

const std::vector< vec2 > & CCollision::TeleIns ( int  Number)
inline

◆ TeleLayer()

const CTeleTile * CCollision::TeleLayer ( ) const
inline

◆ TeleOthers()

const std::vector< vec2 > & CCollision::TeleOthers ( int  Number)
inline

◆ TeleOuts()

const std::vector< vec2 > & CCollision::TeleOuts ( int  Number)
inline

◆ TestBox()

bool CCollision::TestBox ( vec2  Pos,
vec2  Size 
) const

◆ TileExists()

bool CCollision::TileExists ( int  Index) const

◆ TileExistsNext()

bool CCollision::TileExistsNext ( int  Index) const

◆ TuneLayer()

const CTuneTile * CCollision::TuneLayer ( ) const
inline

◆ Unload()

void CCollision::Unload ( )

Member Data Documentation

◆ m_Height

int CCollision::m_Height
private

◆ m_HighestSwitchNumber

int CCollision::m_HighestSwitchNumber

◆ m_pDoor

CDoorTile* CCollision::m_pDoor
private

◆ m_pFront

CTile* CCollision::m_pFront
private

◆ m_pLayers

CLayers* CCollision::m_pLayers
private

◆ m_pSpeedup

CSpeedupTile* CCollision::m_pSpeedup
private

◆ m_pSwitch

CSwitchTile* CCollision::m_pSwitch
private

◆ m_pTele

CTeleTile* CCollision::m_pTele
private

◆ m_pTiles

CTile* CCollision::m_pTiles
private

◆ m_pTune

CTuneTile* CCollision::m_pTune
private

◆ m_TeleCheckOuts

std::map<int, std::vector<vec2> > CCollision::m_TeleCheckOuts
private

◆ m_TeleIns

std::map<int, std::vector<vec2> > CCollision::m_TeleIns
private

◆ m_TeleOthers

std::map<int, std::vector<vec2> > CCollision::m_TeleOthers
private

◆ m_TeleOuts

std::map<int, std::vector<vec2> > CCollision::m_TeleOuts
private

◆ m_Width

int CCollision::m_Width
private

The documentation for this class was generated from the following files: