|
|
constexpr | BaseVector2 () noexcept=default |
| | Construct a zero vector.
|
| |
|
constexpr | BaseVector2 (T x, T y) noexcept |
| | Construct from coordinates.
|
| |
|
constexpr | BaseVector2 (const T data[]) noexcept |
| | Construct from a scalar array.
|
| |
|
constexpr auto | Tie () const |
| | Convert to tuple.
|
| |
|
constexpr bool | operator== (const BaseVector2 &rhs) const |
| | Test for equality with another vector without epsilon.
|
| |
|
constexpr bool | operator!= (const BaseVector2 &rhs) const |
| | Test for inequality with another vector without epsilon.
|
| |
|
constexpr BaseVector2 | operator+ (const BaseVector2 &rhs) const |
| | Add a vector.
|
| |
|
constexpr BaseVector2 | operator- () const |
| | Return negation.
|
| |
|
constexpr BaseVector2 | operator- (const BaseVector2 &rhs) const |
| | Subtract a vector.
|
| |
|
constexpr BaseVector2 | operator* (T rhs) const |
| | Multiply with a scalar.
|
| |
|
constexpr BaseVector2 | operator* (const BaseVector2 &rhs) const |
| | Multiply with a vector.
|
| |
|
constexpr BaseVector2 | operator/ (T rhs) const |
| | Divide by a scalar.
|
| |
|
constexpr BaseVector2 | operator/ (const BaseVector2 &rhs) const |
| | Divide by a vector.
|
| |
|
constexpr BaseVector2 & | operator+= (const BaseVector2 &rhs) |
| | Add-assign a vector.
|
| |
|
constexpr BaseVector2 & | operator-= (const BaseVector2 &rhs) |
| | Subtract-assign a vector.
|
| |
|
constexpr BaseVector2 & | operator*= (T rhs) |
| | Multiply-assign a scalar.
|
| |
|
constexpr BaseVector2 & | operator*= (const BaseVector2 &rhs) |
| | Multiply-assign a vector.
|
| |
|
constexpr BaseVector2 & | operator/= (T rhs) |
| | Divide-assign a scalar.
|
| |
|
constexpr BaseVector2 & | operator/= (const BaseVector2 &rhs) |
| | Divide-assign a vector.
|
| |
|
void | Normalize () |
| | Normalize to unit length.
|
| |
| T | Length () const |
| |
| constexpr T | LengthSquared () const |
| |
|
constexpr T | DotProduct (const BaseVector2 &rhs) const |
| | Calculate dot product.
|
| |
|
T | AbsDotProduct (const BaseVector2 &rhs) const |
| | Calculate absolute dot product.
|
| |
|
constexpr T | CrossProduct (const BaseVector2 &rhs) const |
| | Calculate "cross product" aka z component of cross product of (x1, y1, 0) and (x2, y2, 0).
|
| |
|
T | ProjectOntoAxis (const BaseVector2 &axis) const |
| | Project vector onto axis.
|
| |
|
T | ProjectOntoLineScalar (const BaseVector2 &from, const BaseVector2 &to, bool clamped=false) const |
| | Project position vector onto line segment. Returns interpolation factor between line points.
|
| |
|
BaseVector2 | ProjectOntoLine (const BaseVector2 &from, const BaseVector2 &to, bool clamped=false) const |
| | Project position vector onto line segment. Returns new position.
|
| |
|
T | DistanceToPoint (const BaseVector2 &point) const |
| | Calculate distance to another position vector.
|
| |
|
constexpr T | ScalarCrossProduct (const BaseVector2 &rhs) const |
| | Return scalar cross product of 2D vectors.
|
| |
|
T | Angle (const BaseVector2 &rhs) const |
| | Returns the angle between this vector and another vector in degrees.
|
| |
|
T | SignedAngle (const BaseVector2 &rhs) const |
| | Returns signed angle between this vector and another vector in degrees. Clockwise direction is positive.
|
| |
|
BaseVector2 | Abs () const |
| | Return absolute vector.
|
| |
|
BaseVector2 | Lerp (const BaseVector2 &rhs, T t) const |
| | Linear interpolation with another vector.
|
| |
|
bool | Equals (const BaseVector2 &rhs, T eps=static_cast< T >(M_EPSILON)) const |
| | Test for equality with another vector with epsilon.
|
| |
|
bool | IsNaN () const |
| | Return whether any component is NaN.
|
| |
|
bool | IsInf () const |
| | Return whether any component is Inf.
|
| |
|
BaseVector2 | Normalized () const |
| | Return normalized to unit length.
|
| |
|
BaseVector2 | NormalizedOrDefault (const BaseVector2 &defaultValue=BaseVector2::ZERO, T eps=static_cast< T >(M_LARGE_EPSILON)) const |
| | Return normalized to unit length or zero if length is too small.
|
| |
|
BaseVector2 | ReNormalized (T minLength, T maxLength, const BaseVector2 &defaultValue=BaseVector2::ZERO, T eps=static_cast< T >(M_LARGE_EPSILON)) const |
| | Return normalized vector with length in given range.
|
| |
|
constexpr BaseVector2 | GetOrthogonalClockwise () const |
| | Return orthogonal vector (clockwise).
|
| |
|
constexpr BaseVector2 | GetOrthogonalCounterClockwise () const |
| | Return orthogonal vector (counter-clockwise).
|
| |
|
constexpr const T * | Data () const |
| | Return data.
|
| |
|
constexpr T * | MutableData () |
| | Return mutable 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.
|
| |
|
IntVector2 | ToIntVector2 () const |
| | Return IntVector2 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.
|
| |
template<class T>
class Urho3D::BaseVector2< T >
Two-dimensional vector with real-number values.