27 lines
537 B
C++
27 lines
537 B
C++
#pragma once
|
|
|
|
#include "math/vector.hpp"
|
|
#include "shape.hpp"
|
|
|
|
namespace shapes
|
|
{
|
|
|
|
class Line : public Shape
|
|
{
|
|
public:
|
|
Line(const math::Vector& p0, const math::Vector& p1) : m_p0(p0), m_p1(p1)
|
|
{
|
|
}
|
|
|
|
void Translate(const math::Vector& offset) override;
|
|
void Rotate(const math::Vector& center, float angle) override;
|
|
void Scale(const math::Vector& center, float factor) override;
|
|
|
|
void Draw(Renderer& renderer) const override;
|
|
|
|
private:
|
|
math::Vector m_p0;
|
|
math::Vector m_p1;
|
|
};
|
|
|
|
} // namespace shapes
|