template class EE::Math::tOriginPoint

Overview

Helper class to define the origin point of a translation/rotation/scaling. More…

#include <originpoint.hpp>

template <typename T>
class tOriginPoint: public EE::Math::Vector2 {
public:
    // enums

    enum OriginTypes;

    // fields

    OriginTypes OriginType;

    // construction

    tOriginPoint();
    tOriginPoint(T X, T Y);
    tOriginPoint(OriginTypes type);

    // methods

    std::string toString() const;
    tOriginPoint<T>& operator=(const Vector2<T>& v);
    const std::string& getXEq() const;
    void setXEq(const std::string& xEq);
    const std::string& getYEq() const;
    void setYEq(const std::string& yEq);
};

Inherited Members

public:
    // fields

    static const Vector2<T> Zero = Vector2<T>(0, 0);
    static const Vector2<T> One = Vector2<T>(1, 1);
    T x;
    T y;

    // methods

    Vector2<T> copy();
    T dot(const Vector2<T>& V2) const;
    T cross(const Vector2<T>& V2) const;
    Vector2<T> perp() const;
    Vector2<T> rPerp() const;
    Vector2<T> rotate(const Vector2<T>& V2) const;
    Vector2<T> unrotate(const Vector2<T>& V2) const;
    T length() const;
    T lengthSq() const;
    void normalize();
    void clamp(T len);
    Vector2<T> forAngle(const T& a) const;
    T toAngle();
    void rotate(const T& Angle);
    void rotate(const T& Angle, const Vector2<T>& RotationCenter);
    T distance(const Vector2<T>& Vec) const;
    T distanceSq(const Vector2<T>& Vec) const;
    bool nearDist(const Vector2<T>& Vec, T Dist) const;
    Vector2<T> sphericalLerp(const Vector2<T>& Vec, T Time) const;
    Vector2<T> sphericalLerpConst(const Vector2<T>& Vec, T Angle) const;
    Vector2<T> lerp(const Vector2<T>& Vec, T Time) const;
    Vector2<T> lerpConst(const Vector2<T>& Vec, T Dist) const;
    void scale(const Vector2<T>& scale, const Vector2<T>& Center);
    void scale(const T& scale, const Vector2<T>& Center);
    Vector2<T> ceil() const;
    Vector2<T> floor() const;
    Vector2<T> round() const;
    Vector2<T> roundUp() const;
    Vector2<T> roundDown() const;
    Vector2<T> abs() const;
    Vector2<Float> asFloat() const;
    Vector2<int> asInt() const;
    Vector2<T>& operator=(const Vector2<T>& right);

Detailed Documentation

Helper class to define the origin point of a translation/rotation/scaling.

Construction

tOriginPoint()

By default creates a origin point centered

tOriginPoint(T X, T Y)

Creates a custom origin point

tOriginPoint(OriginTypes type)

Creates a origin point type