Vec2
kn::Vec2 Declared in kraken/math/Math.hpp
At a glance
46 membersxvariableyvariableVec2function~Vec2functioncopyfunctionisZerofunctiongetLengthfunctiongetLengthSquaredfunctiongetAnglefunctionrotatefunctionrotatedfunctiontoPolarfunctionscaleToLengthfunctionscaledToLengthfunctionprojectfunctionrejectfunctionreflectfunctionnormalizefunctionnormalizedfunctiondistanceTofunctiondistanceSquaredTofunctionmoveTowardfunctionmovedTowardfunctionfloorfunctionflooredfunctionceilfunctionceiledfunctionroundfunctionroundedfunctionslidefunctionslidfunctionoperator-functionoperator+functionoperator*functionoperator/functionoperator+=functionoperator-=functionoperator*=functionoperator/=functionoperator==functionoperator!=functionoperator boolfunctionoperator SDL_Pointfunctionoperator SDL_FPointfunctionoperator b2Vec2functionoperator<<friendReference
C++ APIx
variabledouble x = 0.0No description in the source header.
y
variabledouble y = 0.0No description in the source header.
No description in the source header.
~Vec2
function~Vec2()=defaultNo description in the source header.
copy
functionVec2 copy() constNo description in the source header.
isZero
functionbool isZero(double tolerance=1e-8) constNo description in the source header.
getLength
functiondouble getLength() constNo description in the source header.
getLengthSquared
functiondouble getLengthSquared() constNo description in the source header.
getAngle
functiondouble getAngle() constNo description in the source header.
rotate
functionvoid rotate(double rad)No description in the source header.
rotated
functionVec2 rotated(double rad) constNo description in the source header.
toPolar
functionPolarCoordinate toPolar() constNo description in the source header.
scaleToLength
functionvoid scaleToLength(double scalar)No description in the source header.
scaledToLength
functionVec2 scaledToLength(double scalar) constNo description in the source header.
project
functionNo description in the source header.
reject
functionNo description in the source header.
reflect
functionNo description in the source header.
normalize
functionvoid normalize()No description in the source header.
normalized
functionVec2 normalized() constNo description in the source header.
distanceTo
functiondouble distanceTo(const Vec2 &other) constNo description in the source header.
distanceSquaredTo
functiondouble distanceSquaredTo(const Vec2 &other) constNo description in the source header.
moveToward
functionvoid moveToward(const Vec2 &target, double maxStep)No description in the source header.
movedToward
functionNo description in the source header.
floor
functionvoid floor()No description in the source header.
floored
functionVec2 floored() constNo description in the source header.
ceil
functionvoid ceil()No description in the source header.
ceiled
functionVec2 ceiled() constNo description in the source header.
round
functionvoid round()No description in the source header.
rounded
functionVec2 rounded() constNo description in the source header.
slide
functionvoid slide(const Vec2 &normal)No description in the source header.
slid
functionNo description in the source header.
No description in the source header.
operator+
functionNo description in the source header.
No description in the source header.
No description in the source header.
operator+=
functionNo description in the source header.
operator-=
functionNo description in the source header.
No description in the source header.
No description in the source header.
operator==
functionbool operator==(const Vec2 &other) constNo description in the source header.
operator!=
functionbool operator!=(const Vec2 &other) constNo description in the source header.
operator bool
functionoperator bool() constNo description in the source header.
operator SDL_Point
functionoperator SDL_Point() constNo description in the source header.
operator SDL_FPoint
functionoperator SDL_FPoint() constNo description in the source header.
operator b2Vec2
functionoperator b2Vec2() constNo description in the source header.
operator<<
friendstd::ostream & operator<<(std::ostream &os, const Vec2 &v)No description in the source header.