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 BaseIntegerVector2 & operator+= (const BaseIntegerVector2 &rhs)
 Add-assign a vector.
constexpr BaseIntegerVector2 & operator-= (const BaseIntegerVector2 &rhs)
 Subtract-assign a vector.
constexpr BaseIntegerVector2 & operator*= (T rhs)
 Multiply-assign a scalar.
constexpr BaseIntegerVector2 & operator*= (const BaseIntegerVector2 &rhs)
 Multiply-assign a vector.
constexpr BaseIntegerVector2 & operator/= (T rhs)
 Divide-assign a scalar.
constexpr BaseIntegerVector2 & operator/= (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.
T Length () const
 Return length.

Public Attributes

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

Static Public Attributes

static const BaseIntegerVector2< T > ZERO
 Zero vector.
static const BaseIntegerVector2< T > LEFT
 (-1,0) vector.
static const BaseIntegerVector2< T > RIGHT
 (1,0) vector.
static const BaseIntegerVector2< T > UP
 (0,1) vector.
static const BaseIntegerVector2< T > DOWN
 (0,-1) vector.
static const BaseIntegerVector2< T > ONE
 (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
 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:
  • Urho3D/Math/MathDefs.h
  • Urho3D/Math/Vector2.h
  • Urho3D/Math/Vector3.h
  • Urho3D/Math/Vector4.h