WOWCube Docs logo
WOWCube Docs
Mission Control
Section Shortcuts
APIExamplesSourceWOWConnectChangelog
Filters
SDK and language defaults persist in cookies.
SDK version
Navigation Tree
Collapsed by default, focused on the active path.
Made byMcKay Seamons
GitHub
  1. Home
  2. Docs
  3. API
  4. Cubios::Math::Vec2
Mission NodeSDK 6.3C++gfx engine

Cubios::Math::Vec2

Cubios::Math::Vec2 Constructors Vec2 Summary Constructs a two component vector object Synopsis Vec2(); Arguments x x component value y y component value Syno...

API / SDK 6.3 / C++ / gfx engine

Cubios::Math::Vec2

Constructors

Vec2

Summary

Constructs a two-component vector object

Synopsis

Cubios::Math::Vec2
CPP
1Vec2();
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Arguments

  • x - x component value
  • y - y component value

Synopsis

Cubios::Math::Vec2
CPP
1Vec2(const float _x, const float _y);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Arguments

  • vec - a source vector

Synopsis

Cubios::Math::Vec2
CPP
1Vec2(const Vec2& vec);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Arguments

  • p - a pointer to an array of floating point values

Synopsis

Cubios::Math::Vec2
CPP
1Vec2(const float* p);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Synopsis

Cubios::Math::Vec2
CPP
1Vec2(const Vec2& vec);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Arguments

  • p - a pointer to an array of floating point values

Synopsis

Cubios::Math::Vec2
CPP
1Vec2(const float* p);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Public Members

X

Summary

X component of a vector

Y

Summary

Y component of a vector

Operators

Summary

Addition of two vectors

Synopsis

Cubios::Math::Vec2
CPP
1Vec2 operator +(const Vec2& v0, const Vec2& v1);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Summary

Subtraction of two vectors

Synopsis

Cubios::Math::Vec2
CPP
1Vec2 operator +(const Vec2& v0, const Vec2& v1);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Summary

Multiply a vector by a number

Synopsis

Cubios::Math::Vec2
CPP
1Vec2 operator *(const Vec2& v0, const float s);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Summary

Negation of a vector

Synopsis

Cubios::Math::Vec2
CPP
1Vec2 operator -(const Vec2& v);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Summary

Dot product of two vectors

Synopsis

Cubios::Math::Vec2
CPP
1float operator %(const Vec2& v0, const Vec2& v1);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Summary

Other operations

Synopsis

Cubios::Math::Vec2
CPP
1void operator+=(const Vec2& v0);
2void operator-=(const Vec2& v0);
3void operator*=(const float s);
4void operator/=(const float s);
5
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Public Methods

Set

Summary

Sets values to a vector

Arguments

  • x - x component value
  • y - y component value

Synopsis

Cubios::Math::Vec2
CPP
1void Set(const float x, const float y)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Arguments

  • vec - the vector that holds values to be set

Synopsis

Cubios::Math::Vec2
CPP
1void Set(const Vec2& vec)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Arguments

  • p - a pointer to an array of floating point values

Synopsis

Cubios::Math::Vec2
CPP
1void Set(const float* p)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Len

Summary

Returns a length of the vector

Synopsis

Cubios::Math::Vec2
CPP
1float Len() const
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Norm

Summary

Performs vector normalization

Synopsis

Cubios::Math::Vec2
CPP
1void Norm()
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

IsEqual

Summary

Checks an equality of with a given vector

Arguments

  • v - vector to compare with
  • tol - comparison tolerance

Output

True if vectors are tolerantly equal, otherwise false

Synopsis

Cubios::Math::Vec2
CPP
1bool IsEqual(const Vec2& v, const float tol) const
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Compare

Summary

Performs fuzzy comparison of vectors

Arguments

  • v - vector to compare with
  • tol - comparison tolerance

Output

  • -1 if current vector is shorter
  • 0 if vectors are identical
  • 1 if current vector is longer

Synopsis

Cubios::Math::Vec2
CPP
1int Compare(const Vec2& v, float tol) const;
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Jump Grid

On This Page

ConstructorsVec2Public MembersXYOperatorsPublic MethodsSetLenNormIsEqualCompare
Context Rail

Related nodes

Cubios::Math
API / SDK 6.3 / C++ / gfx engine
Cubios::Math::Transform
API / SDK 6.3 / C++ / gfx engine
Cubios::Math::Color
API / SDK 6.3 / C++ / gfx engine
Cubios::Gfx::Colors
API / SDK 6.3 / C++ / gfx engine
Previous Node
Cubios::Math
API / SDK 6.3 / C++ / gfx engine
Next Node
Cubios::Math::Transform
API / SDK 6.3 / C++ / gfx engine