Whoops, do need a default constructor since I provide another constructor. Also fixed Vec3 init, since I renamed the vars x,y,z to be lowercase. Don't want the user to have to use shift everytime they access a vec3, seems silly.
This commit is contained in:
parent
747fc8a5cd
commit
4fd8dfb9f1
2 changed files with 31 additions and 9 deletions
|
@ -20,7 +20,8 @@
|
||||||
|
|
||||||
BaseType x, y, z;
|
BaseType x, y, z;
|
||||||
|
|
||||||
TVector3( BaseType x, BaseType y, BaseType z );
|
TVector3( void );
|
||||||
|
TVector3( BaseType X, BaseType Y, BaseType Z );
|
||||||
|
|
||||||
virtual ~TVector3( void ) { }
|
virtual ~TVector3( void ) { }
|
||||||
|
|
||||||
|
@ -54,10 +55,15 @@
|
||||||
|
|
||||||
|
|
||||||
template< typename BaseType >
|
template< typename BaseType >
|
||||||
inline TVector3< BaseType >::TVector3( BaseType x, BaseType y, BaseType z )
|
inline TVector3< BaseType >::TVector3( void )
|
||||||
: this->x( x )
|
{
|
||||||
, this->y( y )
|
}
|
||||||
, this->z( z )
|
|
||||||
|
template< typename BaseType >
|
||||||
|
inline TVector3< BaseType >::TVector3( BaseType X, BaseType Y, BaseType Z )
|
||||||
|
: x( X )
|
||||||
|
, y( Y )
|
||||||
|
, z( Z )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
|
|
||||||
When( vector3_scalar_multiplied )
|
When( vector3_scalar_multiplied )
|
||||||
{
|
{
|
||||||
Then( it_should_multiply )
|
Then( it_should_be_correct )
|
||||||
{
|
{
|
||||||
value1.X = 1.f;
|
value1.x = 1.f;
|
||||||
value1.Y = 1.f;
|
value1.y = 1.f;
|
||||||
value1.Z = 1.f;
|
value1.z = 1.f;
|
||||||
|
|
||||||
value1 *= 2.f;
|
value1 *= 2.f;
|
||||||
|
|
||||||
|
@ -19,4 +19,20 @@
|
||||||
Vec3f value1;
|
Vec3f value1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
When( vector3_scalar_divided )
|
||||||
|
{
|
||||||
|
Then( it_should_be_correct )
|
||||||
|
{
|
||||||
|
value1.x = 2.f;
|
||||||
|
value1.y = 2.f;
|
||||||
|
value1.z = 2.f;
|
||||||
|
|
||||||
|
value1 /= 2.f;
|
||||||
|
|
||||||
|
Assert::That( value1, Equals( Vec3f( 1.f, 1.f, 1.f ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
Vec3f value1;
|
||||||
|
};
|
||||||
|
|
||||||
#endif //__TESTSVECTOR3_H__
|
#endif //__TESTSVECTOR3_H__
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue