-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix example code so it compiles as is (#260)
* Fix example code so it compiles as is * Add missing includes * Make intro example actually do something sensible, and move to intro.cpp * Add building the example code to the CI Signed-off-by: Cary Phillips <[email protected]> * Add missing add_test Signed-off-by: Cary Phillips <[email protected]> Signed-off-by: Cary Phillips <[email protected]>
- Loading branch information
Showing
19 changed files
with
72 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include <Imath/ImathColor.h> | ||
#include <cassert> | ||
|
||
void | ||
color3_example () | ||
|
This file contains 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include <Imath/ImathColor.h> | ||
#include <cassert> | ||
|
||
void | ||
color4_example () | ||
|
This file contains 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 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include <Imath/ImathFrustum.h> | ||
#include <cassert> | ||
|
||
void | ||
frustum_example () | ||
|
This file contains 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include <Imath/ImathInterval.h> | ||
#include <cassert> | ||
|
||
void | ||
interval_example () | ||
|
This file contains 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include <Imath/ImathLine.h> | ||
#include <cassert> | ||
|
||
void | ||
line3_example () | ||
|
This file contains 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#include <Imath/ImathMatrix.h> | ||
#include <Imath/ImathMatrixAlgo.h> | ||
#include <cassert> | ||
|
||
void | ||
matrix22_example () | ||
|
This file contains 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#include <Imath/ImathMatrix.h> | ||
#include <Imath/ImathMatrixAlgo.h> | ||
#include <cassert> | ||
|
||
void | ||
matrix33_example () | ||
|
This file contains 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#include <Imath/ImathMatrix.h> | ||
#include <Imath/ImathMatrixAlgo.h> | ||
#include <cassert> | ||
|
||
void | ||
matrix44_example () | ||
|
This file contains 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include <Imath/ImathPlane.h> | ||
#include <cassert> | ||
|
||
void | ||
plane3_example () | ||
|
This file contains 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include <Imath/ImathQuat.h> | ||
#include <cassert> | ||
|
||
void | ||
quat_example () | ||
|
This file contains 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include <Imath/ImathSphere.h> | ||
#include <cassert> | ||
|
||
void | ||
sphere3_example () | ||
|
This file contains 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include <Imath/ImathVec.h> | ||
#include <cassert> | ||
|
||
void | ||
vec2_example () | ||
|
This file contains 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include <Imath/ImathVec.h> | ||
#include <cassert> | ||
|
||
void | ||
vec3_example () | ||
|
This file contains 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include <Imath/ImathVec.h> | ||
#include <cassert> | ||
|
||
void | ||
vec4_example () | ||
|
This file contains 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,24 @@ | ||
#include <Imath/ImathMatrix.h> | ||
#include <Imath/ImathVec.h> | ||
#include <iostream> | ||
#include <cassert> | ||
|
||
int | ||
main() | ||
{ | ||
const Imath::V3f v (3.0f, 4.0f, 5.0f); | ||
|
||
Imath::M44f M; | ||
const Imath::V3f t(1.0f, 2.0f, 3.0f); | ||
M.translate (t); | ||
|
||
Imath::V3f p; | ||
M.multVecMatrix(v, p); | ||
|
||
std::cout << "What's your vector, Victor? " << p << std::endl; | ||
|
||
Imath::V3f vt = v + t; | ||
assert (p.equalWithAbsError(vt, 1e-6f)); | ||
|
||
return 0; | ||
} |
This file contains 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