Facepunch / garrysmod-requests

Feature requests for Garry's Mod
83 stars 24 forks source link

Add PVS and Clusters Bindings #386

Open ghost opened 9 years ago

ghost commented 9 years ago

int engine->GetClusterForOrigin( Vector origin ) int engine->GetClusterCount() int engine->GetAllClusterBounds( bbox_t pBBoxList, int maxBBox ) int engine->GetPVSForCluster( int cluster, int outputpvslength, byte outputpvs ) see https://developer.valvesoftware.com/wiki/PVS

They can be useful for doing custom PVS or stencil parts of the map.

ZehMatt commented 8 years ago

Perhaps also bool engine->CheckBoxInPVS( Vector mins, Vector maxs, byte *checkpvs, int checkpvssize ) void engine->AddOriginToPVS( Vector origin )

piqey commented 1 month ago

int engine->GetClusterForOrigin( Vector origin ) int engine->GetClusterCount() int engine->GetAllClusterBounds( bbox_t pBBoxList, int maxBBox ) int engine->GetPVSForCluster( int cluster, int outputpvslength, byte outputpvs ) see https://developer.valvesoftware.com/wiki/PVS

They can be useful for doing custom PVS or stencil parts of the map.

I appear to be nearly 10 years late, but if you're still interested (and for posterity) I've written a C++ binary module for servers that provides Lua API access to a few of these engine functions via PVS interfaces/objects.

Perhaps also bool engine->CheckBoxInPVS( Vector mins, Vector maxs, byte *checkpvs, int checkpvssize ) void engine->AddOriginToPVS( Vector origin )

As far as AddOriginToPVS is concerned, it appears there already exists a Lua API endpoint for it (though this was probably introduced long after your post.)