Back to index

libsfml  1.6+dfsg2
Functions
Vector2.inl File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename T >
Vector2< T > operator- (const Vector2< T > &V)
 Operator - overload ; returns the opposite of a vector /////////////////////////////////////////////////////////.
template<typename T >
Vector2< T > & operator+= (Vector2< T > &V1, const Vector2< T > &V2)
 Operator += overload ; add two vectors and assign to the first op /////////////////////////////////////////////////////////.
template<typename T >
Vector2< T > & operator-= (Vector2< T > &V1, const Vector2< T > &V2)
 Operator -= overload ; subtract two vectors and assign to the first op /////////////////////////////////////////////////////////.
template<typename T >
Vector2< T > operator+ (const Vector2< T > &V1, const Vector2< T > &V2)
 Operator + overload ; adds two vectors /////////////////////////////////////////////////////////.
template<typename T >
Vector2< T > operator- (const Vector2< T > &V1, const Vector2< T > &V2)
 Operator - overload ; subtracts two vectors /////////////////////////////////////////////////////////.
template<typename T >
Vector2< T > operator* (const Vector2< T > &V, T X)
 Operator * overload ; multiply a vector by a scalar value /////////////////////////////////////////////////////////.
template<typename T >
Vector2< T > operator* (T X, const Vector2< T > &V)
 Operator * overload ; multiply a scalar value by a vector /////////////////////////////////////////////////////////.
template<typename T >
Vector2< T > & operator*= (Vector2< T > &V, T X)
 Operator *= overload ; multiply-assign a vector by a scalar value /////////////////////////////////////////////////////////.
template<typename T >
Vector2< T > operator/ (const Vector2< T > &V, T X)
 Operator / overload ; divide a vector by a scalar value /////////////////////////////////////////////////////////.
template<typename T >
Vector2< T > & operator/= (Vector2< T > &V, T X)
 Operator /= overload ; divide-assign a vector by a scalar value /////////////////////////////////////////////////////////.
template<typename T >
bool operator== (const Vector2< T > &V1, const Vector2< T > &V2)
 Operator == overload ; compares the equality of two vectors /////////////////////////////////////////////////////////.
template<typename T >
bool operator!= (const Vector2< T > &V1, const Vector2< T > &V2)
 Operator != overload ; compares the difference of two vectors /////////////////////////////////////////////////////////.

Function Documentation

template<typename T >
bool operator!= ( const Vector2< T > &  V1,
const Vector2< T > &  V2 
)

Operator != overload ; compares the difference of two vectors /////////////////////////////////////////////////////////.

Definition at line 176 of file Vector2.inl.

{
    return (V1.x != V2.x) || (V1.y != V2.y);
}
template<typename T >
Vector2<T> operator* ( const Vector2< T > &  V,
X 
)

Operator * overload ; multiply a vector by a scalar value /////////////////////////////////////////////////////////.

Definition at line 110 of file Vector2.inl.

{
    return Vector2<T>(V.x * X, V.y * X);
}
template<typename T >
Vector2<T> operator* ( X,
const Vector2< T > &  V 
)

Operator * overload ; multiply a scalar value by a vector /////////////////////////////////////////////////////////.

Definition at line 120 of file Vector2.inl.

{
    return Vector2<T>(V.x * X, V.y * X);
}
template<typename T >
Vector2<T>& operator*= ( Vector2< T > &  V,
X 
)

Operator *= overload ; multiply-assign a vector by a scalar value /////////////////////////////////////////////////////////.

Definition at line 130 of file Vector2.inl.

{
    V.x *= X;
    V.y *= X;

    return V;
}
template<typename T >
Vector2<T> operator+ ( const Vector2< T > &  V1,
const Vector2< T > &  V2 
)

Operator + overload ; adds two vectors /////////////////////////////////////////////////////////.

Definition at line 90 of file Vector2.inl.

{
    return Vector2<T>(V1.x + V2.x, V1.y + V2.y);
}
template<typename T >
Vector2<T>& operator+= ( Vector2< T > &  V1,
const Vector2< T > &  V2 
)

Operator += overload ; add two vectors and assign to the first op /////////////////////////////////////////////////////////.

Definition at line 64 of file Vector2.inl.

{
    V1.x += V2.x;
    V1.y += V2.y;

    return V1;
}
template<typename T >
Vector2<T> operator- ( const Vector2< T > &  V)

Operator - overload ; returns the opposite of a vector /////////////////////////////////////////////////////////.

Definition at line 54 of file Vector2.inl.

{
    return Vector2<T>(-V.x, -V.y);
}
template<typename T >
Vector2<T> operator- ( const Vector2< T > &  V1,
const Vector2< T > &  V2 
)

Operator - overload ; subtracts two vectors /////////////////////////////////////////////////////////.

Definition at line 100 of file Vector2.inl.

{
    return Vector2<T>(V1.x - V2.x, V1.y - V2.y);
}
template<typename T >
Vector2<T>& operator-= ( Vector2< T > &  V1,
const Vector2< T > &  V2 
)

Operator -= overload ; subtract two vectors and assign to the first op /////////////////////////////////////////////////////////.

Definition at line 77 of file Vector2.inl.

{
    V1.x -= V2.x;
    V1.y -= V2.y;

    return V1;
}
template<typename T >
Vector2<T> operator/ ( const Vector2< T > &  V,
X 
)

Operator / overload ; divide a vector by a scalar value /////////////////////////////////////////////////////////.

Definition at line 143 of file Vector2.inl.

{
    return Vector2<T>(V.x / X, V.y / X);
}
template<typename T >
Vector2<T>& operator/= ( Vector2< T > &  V,
X 
)

Operator /= overload ; divide-assign a vector by a scalar value /////////////////////////////////////////////////////////.

Definition at line 153 of file Vector2.inl.

{
    V.x /= X;
    V.y /= X;

    return V;
}
template<typename T >
bool operator== ( const Vector2< T > &  V1,
const Vector2< T > &  V2 
)

Operator == overload ; compares the equality of two vectors /////////////////////////////////////////////////////////.

Definition at line 166 of file Vector2.inl.

{
    return (V1.x == V2.x) && (V1.y == V2.y);
}