67 : x( scaler), y( scaler )
72 : x( afCoordinate[0] ),
77 inline explicit Vector2(
const int afCoordinate[2] )
79 x = (
Real)afCoordinate[0];
80 y = (
Real)afCoordinate[1];
84 : x( r[0] ), y( r[1] )
96 inline Real operator [] (
const size_t i )
const
103 inline Real& operator [] (
const size_t i )
143 return ( x == rkVector.
x && y == rkVector.
y );
148 return ( x != rkVector.
x || y != rkVector.
y );
182 assert( fScalar != 0.0 );
184 Real fInv = 1.0f / fScalar;
212 fScalar * rkVector.
x,
213 fScalar * rkVector.
y);
219 fScalar / rkVector.
x,
220 fScalar / rkVector.
y);
302 assert( fScalar != 0.0 );
304 Real fInv = 1.0f / fScalar;
344 return x * x + y * y;
356 return (*
this - rhs).length();
371 return (*
this - rhs).squaredLength();
390 return x * vec.
x + y * vec.
y;
410 if ( fLength >
Real(0.0f) )
412 Real fInvLength = 1.0f / fLength;
426 ( x + vec.
x ) * 0.5f,
427 ( y + vec.
y ) * 0.5f );
435 if( x < rhs.
x && y < rhs.
y )
443 inline bool operator > (
const Vector2& rhs )
const
445 if( x > rhs.
x && y > rhs.
y )
459 if( cmp.
x < x ) x = cmp.
x;
460 if( cmp.
y < y ) y = cmp.
y;
472 if( cmp.
x > x ) x = cmp.
x;
473 if( cmp.
y > y ) y = cmp.
y;
493 return x * rkVector.
y - y * rkVector.
x;
513 return Vector2(cosa * x - sina * y,
514 sina * x + cosa * y);
520 Real sqlen = (x * x) + (y * y);
521 return (sqlen < (1e-06 * 1e-06));
539 return Vector2( *
this - ( 2 * this->dotProduct(normal) * normal ) );
556 if(lenProduct < 1e-6f)
559 Ogre::Real f = dotProduct(other) / lenProduct;
574 if (crossProduct(other)<0)
590 inline _OgreExport friend std::ostream&
operator <<
593 o <<
"Vector2(" << v.x <<
", " << v.y <<
")";