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
a0252484
Commit
a0252484
authored
4 years ago
by
Philip Trettner
Browse files
Options
Downloads
Patches
Plain Diff
compose test
parent
fac9f5fa
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#16136
passed
4 years ago
Stage: Build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
extern/typed-geometry
+1
-1
1 addition, 1 deletion
extern/typed-geometry
tests/feature/matrix/compose.cc
+57
-0
57 additions, 0 deletions
tests/feature/matrix/compose.cc
with
58 additions
and
1 deletion
typed-geometry
@
bb4235d2
Subproject commit
23d12b23ad62e2c0bef0be2d569e100dca2ce846
Subproject commit
bb4235d244995d800e7aec5a3e7de5155bd90d3d
This diff is collapsed.
Click to expand it.
tests/feature/matrix/compose.cc
0 → 100644
+
57
−
0
View file @
a0252484
#include
"test.hh"
TG_FUZZ_TEST
(
Mat4
,
DecomposeUniform
)
{
auto
t0
=
uniform_vec
(
rng
,
tg
::
aabb3
(
-
10
,
10
));
auto
s0
=
uniform
(
rng
,
.1
f
,
2.
f
);
auto
R0
=
tg
::
rotation_around
(
tg
::
uniform
<
tg
::
dir3
>
(
rng
),
tg
::
uniform
<
tg
::
angle
>
(
rng
));
auto
M
=
tg
::
translation
(
t0
)
*
R0
*
tg
::
scaling
<
3
>
(
s0
);
auto
MM
=
tg
::
compose_transformation
(
t0
,
tg
::
mat3
(
R0
),
s0
);
auto
p
=
uniform
(
rng
,
tg
::
aabb3
(
-
10
,
10
));
tg
::
vec3
t1
;
tg
::
mat3
R1
;
float
s1
;
tg
::
decompose_transformation
(
M
,
t1
,
R1
,
s1
);
CHECK
(
t1
==
approx
(
t0
,
0.01
f
));
CHECK
(
s1
==
approx
(
s0
).
epsilon
(
0.01
f
));
auto
q0
=
M
*
p
;
auto
q1
=
tg
::
pos3
(
R1
*
(
s1
*
tg
::
vec3
(
p
))
+
t1
);
auto
q2
=
MM
*
p
;
CHECK
(
q1
==
approx
(
q0
,
0.01
f
));
CHECK
(
q2
==
approx
(
q0
,
0.01
f
));
}
TG_FUZZ_TEST
(
Mat4
,
DecomposeNonUniform
)
{
auto
t0
=
uniform_vec
(
rng
,
tg
::
aabb3
(
-
10
,
10
));
auto
s0
=
tg
::
size3
(
uniform
(
rng
,
tg
::
aabb3
(
0.1
f
,
2.
f
)));
auto
R0
=
tg
::
rotation_around
(
tg
::
uniform
<
tg
::
dir3
>
(
rng
),
tg
::
uniform
<
tg
::
angle
>
(
rng
));
auto
M
=
tg
::
translation
(
t0
)
*
R0
*
tg
::
scaling
(
s0
);
auto
MM
=
tg
::
compose_transformation
(
t0
,
tg
::
mat3
(
R0
),
s0
);
auto
p
=
uniform
(
rng
,
tg
::
aabb3
(
-
10
,
10
));
tg
::
vec3
t1
;
tg
::
mat3
R1
;
tg
::
size3
s1
;
tg
::
decompose_transformation
(
M
,
t1
,
R1
,
s1
);
CHECK
(
t1
==
approx
(
t0
,
0.01
f
));
CHECK
(
s1
==
approx
(
s0
,
0.01
f
));
auto
q0
=
M
*
p
;
auto
q1
=
tg
::
pos3
(
R1
*
(
tg
::
vec3
(
p
)
*
s1
)
+
t1
);
auto
q2
=
MM
*
p
;
CHECK
(
q1
==
approx
(
q0
,
0.01
f
));
CHECK
(
q2
==
approx
(
q0
,
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