feat(natives): backport colshape natives to fivem + rdr3 - #4081
Open
xalva98 wants to merge 1 commit into
Open
Conversation
|
We need thisssss |
xalva98
force-pushed
the
backport-colshape-legacy
branch
2 times, most recently
from
August 13, 2026 22:46
9de0adc to
9413b1c
Compare
Adds the enhanced colshape natives (create/query/delete, point-in-shape, and per-entity-type detection with onColshapeEnter/onColshapeExit) to legacy GTA5 and RedM, client and server, sharing one manager with a background-built BVH broad-phase. Shapes are owned by the resource that created them and dropped when it stops.
xalva98
force-pushed
the
backport-colshape-legacy
branch
from
August 13, 2026 22:52
9413b1c to
858fc22
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal of this PR
Make the enhanced colshape natives available on legacy GTA5 and RedM.
How is this PR achieving the goal
One shared manager (in
citizen-scripting-core) implements the colshapenatives and geometry; a small per-side entity feed (five/rdr3 client, server)
ticks it with nearby entities and it fires
onColshapeEnter/onColshapeExit.A background-built BVH does broad-phase so detection stays cheap with many
shapes. Shapes are tied to the resource that created them and removed when it
stops.
Native names/hashes and event shape match the enhanced API, so scripts written
for enhanced work unchanged.
In plain terms, the detection loop is:
(position + type). This is the only step that touches game state.
frame/tick is never blocked by the actual detection.
candidates first) and compares the result to the previous tick to find who just
entered or left.
onColshapeEnter/onColshapeExiton the game/tick thread.This PR applies to the following area(s)
FiveM, RedM, Natives, FxServer
Successfully tested on
Game builds: 3258 (FiveM), 1491 (RedM), FxServer
Platforms: Windows
Tested thoroughly on both games, client and server: full native/shape/getter
suite plus live enter/exit detection with moving peds, vehicles and objects and
per-entity-type gating. Create/query performance was compared against enhanced
and is roughly on par.
Checklist