Rebel Fork Framework
Urho3D::BaseIntegerVector2< T > Class Template Reference

Two-dimensional vector with integer values. More...

#include <Urho3D/Math/Vector2.h>

Inheritance diagram for Urho3D::BaseIntegerVector2< T >:
Urho3D::Detail::VectorTraits< T, 2 >

Public Member Functions

constexpr BaseIntegerVector2 () noexcept=default
 Construct a zero vector.
 
constexpr BaseIntegerVector2 (T x, T y) noexcept
 Construct from coordinates.
 
constexpr BaseIntegerVector2 (const T data[]) noexcept
 Construct from an array.
 
constexpr auto Tie () const
 Convert to tuple.
 
constexpr bool operator== (const BaseIntegerVector2 &rhs) const
 Test for equality with another vector.
 
constexpr bool operator!= (const BaseIntegerVector2 &rhs) const
 Test for inequality with another vector.
 
constexpr bool operator< (const BaseIntegerVector2 &rhs) const
 Lexicographic comparison for sorting.
 
constexpr BaseIntegerVector2 operator+ (const BaseIntegerVector2 &rhs) const
 Add a vector.
 
constexpr BaseIntegerVector2 operator- () const
 Return negation.
 
constexpr BaseIntegerVector2 operator- (const BaseIntegerVector2 &rhs) const
 Subtract a vector.
 
constexpr BaseIntegerVector2 operator* (T rhs) const
 Multiply with a scalar.
 
constexpr BaseIntegerVector2 operator* (const BaseIntegerVector2 &rhs) const
 Multiply with a vector.
 
constexpr BaseIntegerVector2 operator/ (T rhs) const
 Divide by a scalar.
 
constexpr BaseIntegerVector2 operator/ (const BaseIntegerVector2 &rhs) const
 Divide by a vector.
 
constexpr BaseIntegerVector2operator+= (const BaseIntegerVector2 &rhs)
 Add-assign a vector.
 
constexpr BaseIntegerVector2operator-= (const BaseIntegerVector2 &rhs)
 Subtract-assign a vector.
 
constexpr BaseIntegerVector2operator*= (T rhs)
 Multiply-assign a scalar.
 
constexpr BaseIntegerVector2operator*= (const BaseIntegerVector2 &rhs)
 Multiply-assign a vector.
 
constexpr BaseIntegerVector2operator/= (T rhs)
 Divide-assign a scalar.
 
constexpr BaseIntegerVector2operator/= (const BaseIntegerVector2 &rhs)
 Divide-assign a vector.
 
constexpr const T * Data () const
 Return integer data.
 
constexpr T * MutableData ()
 Return integer data.
 
ea::string ToString () const
 Return as string.
 
unsigned ToHash () const
 Return hash value for HashSet & HashMap.
 
template<class OtherVectorType >
constexpr OtherVectorType Cast (typename OtherVectorType::ScalarType z={}, typename OtherVectorType::ScalarType w={}) const
 Cast vector to different type.
 
template<class OtherVectorType >
constexpr OtherVectorType CastXZ (typename OtherVectorType::ScalarType z={}, typename OtherVectorType::ScalarType w={}) const
 Cast vector to different type. Y and Z components are shuffled.
 
Vector2 ToVector2 () const
 Return Vector2 vector.
 
IntVector3 ToIntVector3 (int z=0) const
 Return IntVector3 vector.
 
Vector3 ToVector3 (float z=0.0f) const
 Return Vector3 vector.
 
Vector4 ToVector4 (float z=0.0f, float w=0.0f) const
 Return Vector4 vector.
 
Length () const
 Return length.
 

Public Attributes

x_ {}
 X coordinate.
 
y_ {}
 Y coordinate.
 

Static Public Attributes

static const BaseIntegerVector2< T > ZERO {T{0}, T{0}}
 Zero vector.
 
static const BaseIntegerVector2< T > LEFT {T{-1}, T{0}}
 (-1,0) vector.
 
static const BaseIntegerVector2< T > RIGHT {T{1}, T{0}}
 (1,0) vector.
 
static const BaseIntegerVector2< T > UP {T{0}, T{1}}
 (0,1) vector.
 
static const BaseIntegerVector2< T > DOWN {T{0}, T{-1}}
 (0,-1) vector.
 
static const BaseIntegerVector2< T > ONE {T{1}, T{1}}
 (1,1) vector.
 
- Static Public Attributes inherited from Urho3D::Detail::VectorTraits< T, 2 >
static constexpr int NumComponents
 Number of compo.
 

Additional Inherited Members

- Public Types inherited from Urho3D::Detail::VectorTraits< T, 2 >
using ScalarType = T
 Underlying scalar type.
 

Detailed Description

template<class T>
class Urho3D::BaseIntegerVector2< T >

Two-dimensional vector with integer values.


The documentation for this class was generated from the following files: