-
Notifications
You must be signed in to change notification settings - Fork 68
Obb calculation with debug draw #975
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
b635208
Dummy
a81c999
Merge branch 'master' into obb_calculation
e5cf6fb
Merge branch 'new_debug_draw' into obb_calculation_with_debug_draw
12164ac
Implement getTransformOBB for DrawAABB extension
5a30e80
Move OBB Calculation into its own file
b6e9c03
Fix create axis aligned bounding box
f09e2bc
Merge branch 'obb_calculation' into obb_calculation_with_debug_draw
229457c
Fix Imgui to always render
d572645
Merge branch 'master' into obb_calculation_with_debug_draw
b2e73a4
Move obb into its own file
afb4558
Recover missing COBBGenerator.h file
d5f7011
Refactor obb calculation and some fixes
32cbb36
Update CDrawAABB::computeOBBTransform to return float32_t3x4
be4630b
Fix sqDist calculation
00affbc
Delete reimplemented code
d79c703
Remove reimplemented code
9f18a1f
Fix indentation
a76f40c
Change calculateOBB interface to use template
2adc7f4
Add inline specifier
d23cde3
Change obb to use matrix as member
02f5bfe
Remove CDrawAABB::getTransformFromOBB
bcb5276
Merge branch 'master' into obb_calculation_with_debug_draw
AnastaZIuk 0e74738
Fix bug
34d231e
Merge remote-tracking branch 'origin/obb_calculation_with_debug_draw'…
cd78818
Merge branch 'master' into obb_calculation_with_debug_draw
kevyuu 153ba1a
Fix bug regarding LargeBaseTriangle computation
cb71a4b
Add some comment regarding references and credit to the original auth…
03cb423
Fix bug regarding finding the furthest point from base triangle
0dc95ef
Add some comment
6d1cfb2
Add epsilon as argument for computeOBB
626b802
Merge remote-tracking branch 'origin/obb_calculation_with_debug_draw'…
b5daf19
Remove old commented code regarding obb calculation
ccdf991
update examples_tests submodule
AnastaZIuk b589759
update examples_tests submodule
AnastaZIuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
|
|
||
| // Copyright (C) 2018-2023 - DevSH Graphics Programming Sp. z O.O. | ||
| // This file is part of the "Nabla Engine". | ||
| // For conditions of distribution and use, see copyright notice in nabla.h | ||
|
|
||
| #ifndef _NBL_ASSET_C_OBB_GENERATOR_H_INCLUDED_ | ||
| #define _NBL_ASSET_C_OBB_GENERATOR_H_INCLUDED_ | ||
|
|
||
| #include "nbl/asset/utils/CPolygonGeometryManipulator.h" | ||
| #include "nbl/builtin/hlsl/shapes/obb.hlsl" | ||
|
|
||
| namespace nbl::asset | ||
| { | ||
| class COBBGenerator | ||
| { | ||
| public: | ||
|
|
||
| using VertexCollection = CPolygonGeometryManipulator::VertexCollection; | ||
|
|
||
| static hlsl::shapes::OBB<> compute(const VertexCollection& vertices); | ||
|
|
||
| }; | ||
| } | ||
|
|
||
| #endif | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,6 +60,7 @@ struct AABB | |
| point_t maxVx; | ||
| }; | ||
|
|
||
|
|
||
| namespace util | ||
| { | ||
| namespace impl | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| // Copyright (C) 2018-2023 - DevSH Graphics Programming Sp. z O.O. | ||
| // This file is part of the "Nabla Engine". | ||
| // For conditions of distribution and use, see copyright notice in nabla.h | ||
| #ifndef _NBL_BUILTIN_HLSL_SHAPES_OBB_INCLUDED_ | ||
| #define _NBL_BUILTIN_HLSL_SHAPES_OBB_INCLUDED_ | ||
|
|
||
| namespace nbl | ||
| { | ||
| namespace hlsl | ||
| { | ||
| namespace shapes | ||
| { | ||
|
|
||
| template<int16_t D=3, typename Scalar=float32_t> | ||
| struct OBB | ||
| { | ||
| using scalar_t = Scalar; | ||
| using point_t = vector<Scalar,D>; | ||
|
|
||
| static OBB createAxisAligned(point_t mid, point_t len) | ||
| { | ||
| OBB ret; | ||
| ret.mid = mid; | ||
| ret.ext = len * 0.5f; | ||
| for (auto dim_i = 0; dim_i < D; dim_i++) | ||
| { | ||
| ret.axes[dim_i] = point_t(0); | ||
| ret.axes[dim_i][dim_i] = 1; | ||
| } | ||
| return ret; | ||
| } | ||
|
|
||
| point_t mid; | ||
| std::array<point_t, D> axes; | ||
AnastaZIuk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| point_t ext; | ||
AnastaZIuk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.