Cavestory Mod API
Functions
Raycasting

Casting game rays. More...

Functions

CAVESTORY_MOD_API BOOL CSM_Raycasting_CastRay (GUI_POINT pPointStart, GUI_POINT pPointEnd, RAYCAST_QUERY *pInfo=NULL, bool bHitEndBlock=true, bool bHitStartBlock=true)
 Cast a ray in the game world. More...
 
CAVESTORY_MOD_API BOOL CSM_Raycasting_CastRay_Quick (int iStartX, int iStartY, int iEndX, int iEndY, unsigned int iHitMask, RAYCAST_QUERY *pInfo=NULL, bool bHitEndBlock=true, bool bHitStartBlock=true)
 Cast a ray in the game world, but faster. More...
 
CAVESTORY_MOD_API void CSM_Raycasting_SetBounds (GUI_RECT *pRect)
 Setup raycasting bounds. More...
 

Detailed Description

Casting game rays.

Game raycasting functions.

Function Documentation

◆ CSM_Raycasting_CastRay()

CAVESTORY_MOD_API BOOL CSM_Raycasting_CastRay ( GUI_POINT  pPointStart,
GUI_POINT  pPointEnd,
RAYCAST_QUERY pInfo = NULL,
bool  bHitEndBlock = true,
bool  bHitStartBlock = true 
)

Cast a ray in the game world.

Parameters
pPointStartThe ray's start point.
pPointEndThe ray's end point.
pInfoA pointer to a RAYCAST_QUERY object that will store the results of the raycast. Can be NULL.
bHitEndBlockWhether to hit the end block.
bHitStartBlockWhether to hit the start block.
Returns
Returns true on hit, false otherwise.
Note
Uses non-magnified, non-game-scaled points. AKA no '* magnification' and no '* 0x200' points are allowed.

◆ CSM_Raycasting_CastRay_Quick()

CAVESTORY_MOD_API BOOL CSM_Raycasting_CastRay_Quick ( int  iStartX,
int  iStartY,
int  iEndX,
int  iEndY,
unsigned int  iHitMask,
RAYCAST_QUERY pInfo = NULL,
bool  bHitEndBlock = true,
bool  bHitStartBlock = true 
)

Cast a ray in the game world, but faster.

Parameters
iStartXThe starting subpixel X coordinate.
iStartYThe starting subpixel Y coordinate.
iEndXThe ending subpixel X coordinate.
iEndYThe ending subpixel Y coordinate.
iHitMaskThe TileType mask to hit.
pInfoA pointer to a RAYCAST_QUERY object that will store the results of the raycast. Can be NULL.
bHitEndBlockWhether to hit the end block.
bHitStartBlockWhether to hit the start block.
Returns
Returns true on hit, false otherwise.
Note
Does not hit entities.
See also
CSM_Raycasting_CastRay

◆ CSM_Raycasting_SetBounds()

CAVESTORY_MOD_API void CSM_Raycasting_SetBounds ( GUI_RECT pRect)

Setup raycasting bounds.

Set the raycasting bounds. Casted rays cannot exceed these bounds.

Parameters
pRectThe bounds to use. If set to NULL, rays will not be bound.