Playing around with some additional math functions and testing. I know I'm probably not doing the testing entirely correctly, or at least my naming of the tests sucks. Would love feedback, though of course I'll be doing research on it. With the addition of cmpf, Vector is clearly intended to be used with a floating point type, float, double, or long double. I may or may not change this. In my commercial ready version the class would support virtually any type, even a custom number class (fixed point).
This commit is contained in:
parent
ce04edb8cb
commit
bf29fa91e7
5 changed files with 47 additions and 21 deletions
|
@ -8,6 +8,7 @@ using namespace igloo;
|
|||
#include "math/Vector3.h"
|
||||
|
||||
// Testing headers:
|
||||
#include "tests/TestsMathDefs.h"
|
||||
#include "tests/TestsVector3.h"
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ solution "tests"
|
|||
kind "ConsoleApp"
|
||||
language "C++"
|
||||
targetdir "bin"
|
||||
files { "../src/**.cpp", "main.cpp", "tests/*.h" }
|
||||
files { "../src/**.h", "../src/**.cpp", "main.cpp", "tests/*.h" }
|
||||
|
||||
includedirs {
|
||||
"../include",
|
||||
|
|
|
@ -3,6 +3,18 @@
|
|||
|
||||
# include "math/Vector3.h"
|
||||
|
||||
When( vector3_negate )
|
||||
{
|
||||
Then( it_should_be_correct )
|
||||
{
|
||||
value1 = -Vec3f( 1.f, 1.f, 1.f );
|
||||
|
||||
Assert::That( value1, Equals( Vec3f( -1.f, -1.f, -1.f ) ) );
|
||||
}
|
||||
|
||||
Vec3f value1;
|
||||
};
|
||||
|
||||
When( vector3_scalar_multiplied )
|
||||
{
|
||||
Then( it_should_be_correct )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue