Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tg-samples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Philip Trettner
tg-samples
Commits
61ed3bac
Commit
61ed3bac
authored
4 years ago
by
Philip Trettner
Browse files
Options
Downloads
Patches
Plain Diff
frustum test
parent
b07b36ec
No related branches found
No related tags found
No related merge requests found
Pipeline
#17604
passed
4 years ago
Stage: Build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
extern/typed-geometry
+1
-1
1 addition, 1 deletion
extern/typed-geometry
tests/feature/objects/frustum.cc
+27
-0
27 additions, 0 deletions
tests/feature/objects/frustum.cc
with
28 additions
and
1 deletion
typed-geometry
@
6dd433f3
Subproject commit
284afd6d95f579066d800345648367e7d986d8cf
Subproject commit
6dd433f303977ebd6c92759041590d41288b25a1
This diff is collapsed.
Click to expand it.
tests/feature/objects/frustum.cc
0 → 100644
+
27
−
0
View file @
61ed3bac
#include
"test.hh"
TG_FUZZ_TEST
(
Frustum
,
BasicFuzzer
)
{
auto
const
bb
=
tg
::
aabb3
(
-
10
,
10
);
auto
const
eye
=
uniform
(
rng
,
bb
);
auto
const
target
=
uniform
(
rng
,
bb
);
auto
const
view
=
tg
::
look_at_opengl
(
eye
,
target
,
tg
::
dir3
::
pos_y
);
auto
const
proj
=
tg
::
perspective_opengl
(
uniform
(
rng
,
30
_deg
,
80
_deg
),
uniform
(
rng
,
0.5
f
,
2.0
f
),
uniform
(
rng
,
0.1
f
,
1.
f
),
uniform
(
rng
,
100.
f
,
500.
f
));
auto
const
view_proj
=
proj
*
view
;
auto
const
inv_view_proj
=
inverse
(
view_proj
);
auto
const
frustum
=
tg
::
frustum3
::
from_view_proj
(
view_proj
);
for
(
auto
p
:
frustum
.
vertices
)
CHECK
(
contains
(
frustum
,
p
,
0.01
f
));
for
(
auto
i
=
0
;
i
<
10
;
++
i
)
{
auto
const
p
=
inv_view_proj
*
uniform
(
rng
,
tg
::
aabb3
::
minus_one_to_one
);
CHECK
(
contains
(
frustum
,
p
,
0.01
f
));
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment