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

Feat/bvh improvements #50

Merged
merged 51 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
656a5d6
refactor: move bvh utility code to separate code files
Silverlan Feb 10, 2024
0b3b8ca
feat: add hitbox bvh component
Silverlan Feb 10, 2024
2cf9cdf
feat(bvh): update code for v2 of bvh library
Silverlan Feb 10, 2024
9585464
feat(bvh): minor improvements and changes
Silverlan Feb 11, 2024
b4f8b1b
feat: implement obb bvh (wip)
Silverlan Feb 11, 2024
3081679
feat(lua): add math.Quaternion:ToMatrix3
Silverlan Feb 11, 2024
b3f1d01
feat(bvh): implement hitbox bvh raycast intersection
Silverlan Feb 12, 2024
70e74cb
fix: fix no uuid being assigned when copying sub-mesh
Silverlan Feb 12, 2024
367d38e
feat(bvh): implement hitbox bvh raycast intersection
Silverlan Feb 12, 2024
b688ac8
feat(bvh): add support for multiple meshes per hitbox
Silverlan Feb 12, 2024
51e9d5d
refactor: change parameters for DrawBox debug function
Silverlan Feb 12, 2024
ca455d2
feat(bvh): clean up code
Silverlan Feb 12, 2024
4abcbee
feat(bvh): add refitting for hitbox bvh
Silverlan Feb 13, 2024
098f0df
feat(bvh): add hitbox bvh debug functions
Silverlan Feb 13, 2024
bfab55a
fix(bvh): fix hitbox bvh skipping some meshes
Silverlan Feb 13, 2024
927db10
feat(bvh): incompatible bvh meshes are now ignored
Silverlan Feb 13, 2024
37ecce0
feat(bvh): raycast against hitbox bvh now returns early if raycast do…
Silverlan Feb 13, 2024
52856f3
feat(bvh): add hitbox model cache
Silverlan Feb 13, 2024
fe4386f
feat(bvh): update hitbox bvh mesh trees when render meshes change
Silverlan Feb 13, 2024
f2383c6
feat(bvh): add hitbox mesh bvh serialization
Silverlan Feb 15, 2024
cf4fb84
fix(bvh): fix missing data when deserializing bvh data
Silverlan Feb 15, 2024
d87349b
feat(bvh): hitbox bvh updates are now multi-threaded
Silverlan Feb 16, 2024
60577b6
feat(bvh): hitbox mesh bvh generation is now multi-threaded
Silverlan Feb 16, 2024
6261e30
refactor(bvh): minor core restructuring
Silverlan Feb 16, 2024
ff6c6b2
feat(bvh): use normalized model for hitbox bvh cache
Silverlan Feb 16, 2024
cd13c1f
fix: fix model lod information not being saved / loaded
Silverlan Feb 17, 2024
7fd7405
feat: Model::GenerateHitboxes now returns boolean indicating if hitbo…
Silverlan Feb 17, 2024
7412bb1
fix: fix Model::GetSubMeshes returning incorrect result
Silverlan Feb 17, 2024
babe09d
feat: minor improvements to Model::GenerateLowLevelLODs
Silverlan Feb 17, 2024
d23dfdb
feat: hitbox bvh mesh cache initialization is now multi-threaded
Silverlan Feb 17, 2024
40f5e25
feat(bvh): feat hitbox bvh tree is now updated automatically
Silverlan Feb 17, 2024
65c2c85
feat: add mapping from new to original vertex indices for mesh simpli…
Silverlan Feb 17, 2024
165ecd9
feat: apply changes for Silverlan/mathutil@885b75a0
Silverlan Feb 17, 2024
40700c0
build: update submodule "pr_unirender"
Silverlan Feb 17, 2024
0065a36
feat: add lua bindings
Silverlan Feb 17, 2024
1753518
fix(linux): fix clang build error
Silverlan Feb 18, 2024
eeaebfe
feat(bvh): add option to specify custom intersection test handler
Silverlan Feb 18, 2024
401c0af
feat(bvh): various raycast changes
Silverlan Feb 18, 2024
6045f64
feat: add intersection handler component
Silverlan Feb 19, 2024
2cd411b
feat(bvh): update bvh library to newer version
Silverlan Feb 19, 2024
f6a8f08
feat(lua): add server-side debug mesh draw function
Silverlan Feb 19, 2024
e9e9624
fix(bvh): fix bvh raycast returning incorrect primitive index
Silverlan Feb 20, 2024
8578629
fix: fix changing pose of debug renderer object not updating model ma…
Silverlan Feb 20, 2024
37fbad6
fix: fix CGame::DrawBox ignoring origin parameter
Silverlan Feb 20, 2024
30dfd71
feat(bvh): add debug drawing functions
Silverlan Feb 20, 2024
e646055
feat(bvh): minor changes to how hitbox meshes are generated
Silverlan Feb 20, 2024
e2f9243
fix(bvh): fix refitting issues
Silverlan Feb 20, 2024
863e909
feat: update click component to use intersection handler
Silverlan Feb 20, 2024
89a8213
feat: gui_3d input callbacks are no longer called if entity is not vi…
Silverlan Feb 20, 2024
8782eb1
feat: add gui_3d horizontal drag scroll mode
Silverlan Feb 20, 2024
6c3f4a2
build: update submodule "filmmaker"
Silverlan Feb 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ set(DEPENDENCY_RECTANGLEBINPACK_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/third_party_li
search_lib_recursive(DEPENDENCY_RECTANGLEBINPACK_LIBRARY third_party_libs/rectangle_bin_pack/${BINARY_PRAGMA_DIR} rectangle_bin_pack STATIC)

set(DEPENDENCY_MINIBALL_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/third_party_libs/miniball/cpp/main CACHE PATH "Path to include directory.")
set(DEPENDENCY_BVH_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/third_party_libs/bvh/include CACHE PATH "Path to include directory.")
set(DEPENDENCY_BVH_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/third_party_libs/bvh/src CACHE PATH "Path to include directory.")

set(DEPENDENCY_VTFLIB_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/third_party_libs/vtflib/src CACHE PATH "Path to include directory.")
set(DEPENDENCY_VTFLIB_BUILD_INCLUDE ${CMAKE_CURRENT_BINARY_DIR}/third_party_libs/vtflib/src CACHE PATH "Path to include directory.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,12 @@ function ents.GUI3D:InitializeGUICallbacks()
if util.is_valid(self.m_pGui) == false then
return util.EVENT_REPLY_UNHANDLED
end

local renderC = self:GetEntityComponent(ents.COMPONENT_RENDER)
if renderC == nil or renderC:GetSceneRenderPass() == game.SCENE_RENDER_PASS_NONE then
return util.EVENT_REPLY_UNHANDLED
end

local bt
if action == input.ACTION_ATTACK then
bt = input.MOUSE_BUTTON_LEFT
Expand Down Expand Up @@ -379,15 +385,29 @@ function ents.GUI3D:InitializeGUICallbacks()
if util.is_valid(self.m_pGui) == false then
return
end

local renderC = self:GetEntityComponent(ents.COMPONENT_RENDER)
if renderC == nil or renderC:GetSceneRenderPass() == game.SCENE_RENDER_PASS_NONE then
return util.EVENT_REPLY_UNHANDLED
end

local pos = self:CalcCursorPos()
if pos ~= nil then
self.m_pGui:InjectScrollInput(pos, Vector2(x, y) * 10.0)
return false
end
return false
end)
end
function ents.GUI3D:InjectKeyboardInput(key, state)
log.info("Injecting keyboard input with key = " .. key .. ", state = " .. state .. " into 3D UI element...")
log.info(
"Injecting keyboard input with key = "
.. key
.. ", state = "
.. state
.. " into 3D UI element '"
.. tostring(self:GetEntity())
.. "'..."
)
local elFocus = gui.get_focused_element()
self.m_pGui:InjectKeyboardInput(key, state, self.m_keyMods)
-- We don't want the element focus to change to any of the 3D elements, so we'll restore the focus back
Expand All @@ -400,6 +420,17 @@ function ents.GUI3D:DoInjectMouseInput(bt, state, pos)
if pos == nil then
return util.EVENT_REPLY_UNHANDLED
end
log.info(
"Injecting mouse input with button = "
.. bt
.. ", state = "
.. state
.. ", pos = "
.. tostring(pos)
.. " into 3D UI element '"
.. tostring(self:GetEntity())
.. "'..."
)
local elFocus = gui.get_focused_element()
local res = self.m_pGui:InjectMouseInput(pos, bt, state)
if res == util.EVENT_REPLY_UNHANDLED then
Expand All @@ -413,15 +444,6 @@ function ents.GUI3D:DoInjectMouseInput(bt, state, pos)
return res
end
function ents.GUI3D:InjectMouseInput(bt, state, pos, useCursor)
log.info(
"Injecting mouse input with button = "
.. bt
.. ", state = "
.. state
.. ", pos = "
.. tostring(pos)
.. " into 3D UI element..."
)
if pos == nil then
local fGetCursorPos
if useCursor then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@ function Component:UpdateDragScrolling()
return
end
self.m_dragScrollingCursorTracker:Update(newPos)
if self.m_dragScrollingCursorTracker:HasExceededMoveThreshold(60) then
if self.m_dragScrollingCursorTracker:HasExceededMoveThreshold(60, math.AXIS_Y) then
self:StartDragScrolling()
elseif self.m_dragScrollingCursorTracker:HasExceededMoveThreshold(60, math.AXIS_X) then
-- If the user has dragged the mouse horizontally, we'll assume they want an UI input.
-- We need to do this, otherwise interacting with sliders would not be possible.
-- This isn't ideal, but other solutions would require changes to the GUI system.
local bt = self.m_dragScrollingButton
local pos = self.m_dragGetCursorPos()
self:StopDragScrolling()
self:DoInjectMouseInput(bt, input.STATE_PRESS, pos)
end
end
if self.m_lastDragCursorPos ~= nil then
Expand Down Expand Up @@ -51,7 +59,7 @@ function Component:HandleDragScrollingMouseInput(bt, state, fGetCursorPos)
return util.EVENT_REPLY_HANDLED
end
if state == input.STATE_PRESS and self:IsDragScrollingEnabled() then
return self:InitDragScrollingMode(fGetCursorPos) and util.EVENT_REPLY_HANDLED or util.EVENT_REPLY_UNHANDLED
return self:InitDragScrollingMode(bt, fGetCursorPos) and util.EVENT_REPLY_HANDLED or util.EVENT_REPLY_UNHANDLED
end
if state == input.STATE_RELEASE and self.m_dragScrollingCursorTracker ~= nil then
self.m_dragScrollingCursorTracker = nil
Expand All @@ -60,11 +68,12 @@ function Component:HandleDragScrollingMouseInput(bt, state, fGetCursorPos)
end
return util.EVENT_REPLY_UNHANDLED
end
function Component:InitDragScrollingMode(fGetCursorPos)
function Component:InitDragScrollingMode(bt, fGetCursorPos)
local pos = fGetCursorPos()
if pos == nil then
return false
end
self.m_dragScrollingButton = bt
self.m_dragScrollingCursorTracker = gui.CursorTracker(pos)
self.m_dragGetCursorPos = fGetCursorPos
return true
Expand All @@ -79,6 +88,7 @@ function Component:StartDragScrolling()
self.m_lastDragCursorPos = fDragGetCursorPos()
end
function Component:StopDragScrolling()
self.m_dragScrollingButton = nil
self.m_lastDragCursorPos = nil
self.m_dragScrollingCursorTracker = nil
self.m_dragGetCursorPos = nil
Expand Down
65 changes: 35 additions & 30 deletions assets/lua/entities/components/click/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,15 @@ function ents.ClickComponent.find_entities_in_kdop(planes, filter)
local entPl = pl:GetEntity()

debug.start_profiling_task("click_find_entities_in_kdop")
local flags = bit.bor(
ents.BvhComponent.BVH_INTERSECTION_FLAG_BIT_RETURN_PRIMITIVES,
ents.BvhComponent.BVH_INTERSECTION_FLAG_BIT_DISCONTINUE_ON_FIRST_HIT_PER_MESH
)
local flags = ents.IntersectionHandlerComponent.INTERSECTION_FLAG_BIT_RETURN_MESHES
local results = {}
local entToResultIdx = {}
local meshMap = {}
local function populate_results(c, indices)
for _, idx in ipairs(indices) do
local ent, subMesh = c:FindPrimitiveMeshInfo(idx)
if ent ~= nil then
local function populate_results(meshes)
for _, meshInfo in ipairs(meshes) do
local ent = meshInfo.entity
local subMesh = meshInfo.mesh
if subMesh ~= nil then
local idx = entToResultIdx[ent]
if idx == nil then
table.insert(results, {
Expand All @@ -236,25 +234,28 @@ function ents.ClickComponent.find_entities_in_kdop(planes, filter)
end
end
for ent, c in ents.citerator(ents.COMPONENT_STATIC_BVH_CACHE) do
local localPlanes = get_local_planes(planes, ent)
local r, indices = c:IntersectionTestKDop(localPlanes, flags)
if r ~= false then
populate_results(c, indices)
local intersectionC = ent:GetComponent(ents.COMPONENT_INTERSECTION_HANDLER)
if intersectionC ~= nil then
local localPlanes = get_local_planes(planes, ent)
local r, meshes = intersectionC:IntersectionTestKDop(localPlanes, flags)
if r ~= false then
populate_results(meshes)
end
end
end

for ent, c in
ents.citerator(ents.COMPONENT_BVH, {
ents.citerator(ents.COMPONENT_INTERSECTION_HANDLER, {
ents.IteratorFilterComponent(ents.COMPONENT_CLICK),
ents.IteratorFilterComponent(ents.COMPONENT_MODEL),
ents.IteratorFilterComponent(ents.COMPONENT_RENDER),
})
do
if should_entity_pass(ent, entPl, filter) then
local localPlanes = get_local_planes(planes, ent)
local r, indices = c:IntersectionTestKDop(localPlanes, flags)
local r, meshes = c:IntersectionTestKDop(localPlanes, flags)
if r ~= false then
populate_results(c, indices)
populate_results(meshes)
end
end
end
Expand Down Expand Up @@ -284,18 +285,21 @@ function ents.ClickComponent.raycast(pos, dir, filter, maxDist)

-- Check static BVH caches
for ent, c in ents.citerator(ents.COMPONENT_STATIC_BVH_CACHE) do
local hitData = c:IntersectionTest(pos, dir, 0.0, maxDist)
if
hitData ~= nil
and ents.ClickComponent.is_entity_valid(hitData.entity)
and (filter == nil or filter(hitData.entity))
then
if hitData.distance < distClosest then -- and hitData.distance > 0.0) then
--debug.print("Clicked actor: ",hitData.entity)
distClosest = hitData.distance
hitPos = pos + dir * hitData.distance
actorClosest = hitData.entity
hitDataClosest = hitData
local intersectionC = ent:GetComponent(ents.COMPONENT_INTERSECTION_HANDLER)
if intersectionC ~= nil then
local hitData = intersectionC:IntersectionTest(pos, dir, 0.0, maxDist)
if
hitData ~= nil
and ents.ClickComponent.is_entity_valid(hitData.entity)
and (filter == nil or filter(hitData.entity))
then
if hitData.distance < distClosest then -- and hitData.distance > 0.0) then
--debug.print("Clicked actor: ",hitData.entity)
distClosest = hitData.distance
hitPos = pos + dir * hitData.distance
actorClosest = hitData.entity
hitDataClosest = hitData
end
end
end
end
Expand All @@ -321,8 +325,8 @@ function ents.ClickComponent.raycast(pos, dir, filter, maxDist)
local lMaxDist = ldir:Length()
ldir = ldir / lMaxDist

local bvhC = ent:GetComponent(ents.COMPONENT_BVH)
local hitData = bvhC:IntersectionTest(lpos, ldir, 0.0, lMaxDist)
local intersectionHandlerC = ent:GetComponent(ents.COMPONENT_INTERSECTION_HANDLER)
local hitData = intersectionHandlerC:IntersectionTest(lpos, ldir, 0.0, lMaxDist)
if hitData ~= nil then
local clickC = ent:GetComponent(ents.COMPONENT_CLICK)
local priority = (clickC ~= nil) and clickC:GetPriority() or 0
Expand Down Expand Up @@ -364,7 +368,7 @@ function ents.ClickComponent.raycast(pos, dir, filter, maxDist)
local entCache = {}
for ent in
ents.iterator({
ents.IteratorFilterComponent(ents.COMPONENT_BVH),
ents.IteratorFilterComponent(ents.COMPONENT_INTERSECTION_HANDLER),
ents.IteratorFilterComponent(ents.COMPONENT_CLICK),
ents.IteratorFilterComponent(ents.COMPONENT_MODEL),
ents.IteratorFilterComponent(ents.COMPONENT_RENDER),
Expand Down Expand Up @@ -414,6 +418,7 @@ function ents.ClickComponent.raycast(pos, dir, filter, maxDist)
end
function ents.ClickComponent.find_actor_under_cursor(filter)
local pos, dir, vpData = ents.ClickComponent.get_ray_data()
--print("find_actor_under_cursor: ", pos, dir)
if pos == nil then
return
end
Expand Down
4 changes: 2 additions & 2 deletions build_scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ def execbuildscript(filepath):
)
add_pragma_module(
name="pr_unirender",
commitSha="e082d0a94f01823aa05b61f1ed61658872f1f3a5",
commitSha="1f0df83e5d529078b598db974b9906b92145313c",
repositoryUrl="https://github.com/Silverlan/pr_cycles.git"
)
add_pragma_module(
Expand Down Expand Up @@ -983,7 +983,7 @@ def download_addon(name,addonName,url,commitId=None):
curDir = os.getcwd()
if not skip_repository_updates:
if with_pfm:
download_addon("PFM","filmmaker","https://github.com/Silverlan/pfm.git","fb881fe5604016b7a3225124bbdeb4a99c545e4c")
download_addon("PFM","filmmaker","https://github.com/Silverlan/pfm.git","946fc73a03ec481df24c0ae9ec5daad7f3085c25")
download_addon("model editor","tool_model_editor","https://github.com/Silverlan/pragma_model_editor.git","56d46dacb398fa7540e794359eaf1081c9df1edd")

if with_vr:
Expand Down
4 changes: 2 additions & 2 deletions build_scripts/scripts/external_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
get_submodule("iglfw","https://github.com/Silverlan/iglfw.git","e0531a55f5bdd9c9a1dadfbb7a8a610474d69d19")
get_submodule("luasystem","https://github.com/Silverlan/luasystem.git","e22584368ce0f9a5c0c223b8a632d968377d1ae3")
get_submodule("materialsystem","https://github.com/Silverlan/materialsystem.git","d900667907c42e64d70a9e49eab16fcb39073089")
get_submodule("mathutil","https://github.com/Silverlan/mathutil.git","ef63a91717cb53c74796b3594dc8bd231694caf0")
get_submodule("mathutil","https://github.com/Silverlan/mathutil.git","9ed30f22da26cfc0b9debdd4e0ac43ffa9e869b8")
get_submodule("networkmanager","https://github.com/Silverlan/networkmanager.git","68d2f5c")
get_submodule("panima","https://github.com/Silverlan/panima.git","9a32d345bdee87f5872e9d1b65de5772db996df3")
get_submodule("prosper","https://github.com/Silverlan/prosper.git","f405b5114f8abaf30ed5d92604e0b14854606cb1")
get_submodule("sharedutils","https://github.com/Silverlan/sharedutils.git","b308d6261cce0ebb9b8f44be17e72ab917992b3f")
get_submodule("sharedutils","https://github.com/Silverlan/sharedutils.git","9168116578a13b79faf24171322f3f8f9c23c931")
get_submodule("util_bsp","https://github.com/Silverlan/util_bsp.git","3c11053")
get_submodule("util_formatted_text","https://github.com/Silverlan/util_formatted_text.git","3bd9e2de37d0cb14bf8228fde5e25c97698e927b")
get_submodule("util_image","https://github.com/Silverlan/util_image.git","7a66f93")
Expand Down
2 changes: 1 addition & 1 deletion build_scripts/scripts/third_party_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
third_party_libs_dir = curDir +"/third_party_libs"
os.chdir(third_party_libs_dir)
get_submodule("7zpp","https://github.com/Silverlan/7zip-cpp.git","df81447")
get_submodule("bvh","https://github.com/madmann91/bvh.git","2fd0db6","v1")
get_submodule("bvh","https://github.com/madmann91/bvh.git","6130db6")
get_submodule("bzip2","https://github.com/sergiud/bzip2.git","c4a14bb87ee395fb2c69ef5dbb50762fe862517e","cmake")
get_submodule("clip2tri","https://github.com/raptor/clip2tri.git","f62a734d22733814b8a970ed8a68a4d94c24fa5f")
get_submodule("cppbepuik","https://github.com/Silverlan/cppbepuik.git","0e76ab441519b24a6142e22d251afdc9bc1e56a2")
Expand Down
1 change: 1 addition & 0 deletions core/client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ add_include_dir(freetype)
add_include_dir(pr_steamworks)
add_include_dir(steam_audio)
add_include_dir(tinygltf)
add_include_dir(bvh)

add_def(DLLCLIENT_EX)
add_def(WMS_STATIC)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace pragma {
std::vector<std::shared_ptr<ModelSubMesh>> renderMeshes;
std::vector<uint16_t> renderMeshIndices;
std::vector<MeshData> meshData;
std::vector<BvhTriangle> transformedTris;
std::vector<bvh::Primitive> transformedTris;
std::condition_variable completeCondition;
mutable std::mutex completeMutex;
uint32_t completeCount = 0;
Expand Down Expand Up @@ -52,7 +52,7 @@ namespace pragma {
CallbackHandle m_cbRebuildScheduled;
CallbackHandle m_cbOnBvhUpdateRequested;
CallbackHandle m_cbOnBvhRebuilt;
std::shared_ptr<BvhData> m_tmpBvhData = nullptr;
std::shared_ptr<bvh::MeshBvhTree> m_tmpBvhData = nullptr;
bool m_rebuildScheduled = false;
std::atomic<bool> m_cancelled = false;
std::atomic<bool> m_busy = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace pragma {
namespace rendering {
struct RenderBufferData;
};
struct HitInfo;
class DLLCLIENT CBvhComponent final : public BaseBvhComponent {
public:
static bool ShouldConsiderMesh(const ModelSubMesh &mesh, const rendering::RenderBufferData &bufferData);
Expand All @@ -26,7 +27,7 @@ namespace pragma {
virtual void OnRemove() override;
virtual void OnEntityComponentAdded(BaseEntityComponent &component) override;
virtual void OnEntityComponentRemoved(BaseEntityComponent &component) override;
virtual bool IntersectionTest(const Vector3 &origin, const Vector3 &dir, float minDist, float maxDist, BvhHitInfo &outHitInfo) const override;
virtual bool IntersectionTest(const Vector3 &origin, const Vector3 &dir, float minDist, float maxDist, HitInfo &outHitInfo) const override;
using BaseBvhComponent::IntersectionTest;
private:
void UpdateBvhStatus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ namespace pragma {
virtual void OnEntitySpawn() override;
virtual void OnRemove() override;
virtual void OnTick(double tDelta) override;

void SetHitboxColor(BoneId boneId, const std::optional<Color> &color);
protected:
void InitializeDebugObjects();
void ClearDebugObjects();
std::vector<std::shared_ptr<DebugRenderer::BaseObject>> m_debugObjects;
std::unordered_map<BoneId, Color> m_hitboxColors;
bool m_dirty = false;
};
};

Expand Down
Loading
Loading