Skip to content

Speedi13/BFV-OcclusionQueryManager

Repository files navigation

BFV-OcclusionQueryManager

I reversed how the game sets the m_occluded for the ClientSoldierEntity using the SoldierOcclusionQueryManager and build my own OcclusionQueryManager from that using the games WorldOcclusionQueryRenderModule.
My CustomOcclusionQueryManager can then be used to check a vehicle for occlusion.
Look at my other project for a working implementation
https://github.com/Speedi13/BFV-SimpleCheat
https://i.imgur.com/HOBbVYt.mp4

Reversed functions

All IDA-Pseudo code I generated to reverse the is here:
https://github.com/Speedi13/BFV-OcclusionQueryManager/blob/master/Reversed_Occlusion_functions.h

All IDA structs to import if you want to take a look too
https://github.com/Speedi13/BFV-OcclusionQueryManager/blob/master/Reversed_Occlusion_IDA_structs.h

CustomOcclusionQueryManager usage

Import the classes
https://github.com/Speedi13/BFV-OcclusionQueryManager/blob/master/Reversed_Occlusion_classes.h

//once every frame
CustomOcclusionQueryManager::GetInstance()->UpdateLocalTransform( &vLocalPos );
CustomOcclusionQueryManager* COcclusionQuery = CustomOcclusionQueryManager::GetInstance();

//in your entity loop
fb::LinearTransform_AABB TransformAABB = {};
pVehicle->GetTransformAABB( TransformAABB );
COcclusionQuery->Enter();
CustomOcclusionQueryManager::OcclusionQuery* pQuery = COcclusionQuery->GetQuery( pVehicle );
if (pQuery == NULL)
    pQuery = COcclusionQuery->AddQuery( pVehicle, NULL );
pQuery->UpdateQuery( &TransformAABB );

bVehicleVisible = pQuery->IsVisible();
COcclusionQuery->Leave();

About

BFV OcclusionQueryManager reversed

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages