Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Philip Trettner
tg-samples
Commits
c8db7ef8
Commit
c8db7ef8
authored
Mar 13, 2020
by
Julian Schakib
Browse files
intersection tests for box and plane
parent
e6691ed6
Pipeline
#13780
failed with stage
in 6 minutes and 26 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
typed-geometry
@
b26a52a4
Subproject commit
71aeccbb4212dc12be6b1ff4eb14827d0a53feba
Subproject commit
b26a52a4e77285201be41172b75839938efcf48b
tests/feature/intersections/plane-intersect.cc
View file @
c8db7ef8
...
...
@@ -330,6 +330,8 @@ TG_FUZZ_TEST(Plane, Intersect)
// plane3 - box3
{
auto
const
origins
=
tg
::
aabb3
(
tg
::
pos3
(
-
10
),
tg
::
pos3
(
10
));
auto
half_extents
=
tg
::
mat3
();
half_extents
[
0
]
=
tg
::
dir3
::
pos_x
;
half_extents
[
1
]
=
tg
::
dir3
::
pos_y
;
...
...
@@ -360,8 +362,15 @@ TG_FUZZ_TEST(Plane, Intersect)
half_extents
[
1
]
=
ny
*
uniform
(
rng
,
1.0
f
,
10.0
f
);
half_extents
[
2
]
=
nz
*
uniform
(
rng
,
1.0
f
,
10.0
f
);
auto
const
box
box
=
tg
::
box3
(
uniform
(
rng
,
origins
),
half_extents
);
auto
const
plane
=
tg
::
plane3
(
tg
::
uniform
<
tg
::
dir3
>
(
rng
),
tg
::
pos3
::
zero
)
{
auto
const
plane
=
tg
::
plane3
(
nx
,
tg
::
pos3
(
box
.
center
+
half_extents
[
0
]
*
1.1
f
));
CHECK
(
!
intersects
(
plane
,
box
));
}
{
auto
const
plane
=
tg
::
plane3
(
nx
,
tg
::
pos3
(
box
.
center
+
half_extents
[
0
]
*
0.9
f
));
CHECK
(
intersects
(
plane
,
box
));
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment