Unofficial community resource. Not affiliated with, maintained by, or endorsed by WOWCube / Cubios Inc. Cubios Inc. does not guarantee the accuracy or completeness of this content. Official WOWCube Development Kit

WOWCube Docs logo
WOWCube Docs
Mission Control
Section Shortcuts
APIExamplesSourceWOWConnectChangelogDeveloper Toolkit
Filters
SDK and language defaults persist in cookies.
SDK version
Navigation Tree
Collapsed by default, focused on the active path.

Unofficial community resource. Not affiliated with, maintained by, or endorsed by WOWCube / Cubios Inc. Cubios Inc. does not guarantee the accuracy or completeness of this content. For official documentation and the SDK, see the WOWCube Development Kit.

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
VersionSDK 6.3SDK 6.2SDK 6.1
Report issue

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.

Trust & provenance

Document status

Source
Math-Vec2 · installed SDK headers
Classification
API reference
Verification
Community-maintained · verify against installed SDK

Catalog updated Oct 20, 2018

Structured index

Symbols on this page

Names and signatures are extracted from this SDK-derived page. Signature hashes detect accidental changes.

Cubios::Math::Vec2Class
ConstructorsMember
Vec2Member
Public MembersMember
XMember
YMember
OperatorsMember
Public MethodsMember
SetMember
LenMember
NormMember
IsEqualMember
CompareMember

Used in SDK snippets

Cubios::Math::Vec2→Star.hVec2→Star.hCubios::Math::Vec2→Twinkle.hVec2→Twinkle.hVec2→Circles.cpp
Jump Grid

On This Page

ConstructorsVec2Public MembersXYOperatorsPublic MethodsSetLenNormIsEqualCompare
Back to top ↑
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