Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getModelRenderBounds, getCollisionBounds, getRotatedAABB #2010

Merged
merged 2 commits into from
Feb 27, 2025

Conversation

Cheatoid
Copy link
Contributor

Add Entity:getModelRenderBounds, Entity:getCollisionBounds, and Entity:getRotatedAABB (shared) functions.

(untested)

-- @return Vector Minimum extent of the AABB relative to entity's position.
-- @return Vector Maximum extent of the AABB relative to entity's position.
function ents_methods:getRotatedAABB(min, max)
local minvec, maxvec = Ent_GetRotatedAABB(getent(self), vunwrap1(min), vunwrap1(max))
Copy link
Owner

@thegrb93 thegrb93 Feb 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second vunwrap1 needs to be vunwrap2, otherwise they both write to the same cached vector.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to add to line 70,73 as well

@thegrb93 thegrb93 merged commit 8438052 into thegrb93:master Feb 27, 2025
1 check passed
github-actions bot added a commit that referenced this pull request Feb 27, 2025
* Add getModelRenderBounds, getCollisionBounds, getRotatedAABB

* Fix

---------

Co-authored-by: thegrb93 <[email protected]> 8438052
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants