35 lines
676 B
C++
35 lines
676 B
C++
#ifndef Segment_h_
|
|
#define Segment_h_
|
|
|
|
#include <ostream>
|
|
|
|
#include "glm/vec2.hpp"
|
|
#include "glm/geometric.hpp"
|
|
|
|
struct Segment
|
|
{
|
|
|
|
glm::vec2 start, end;
|
|
|
|
Segment();
|
|
Segment(const glm::vec2&);
|
|
Segment(const glm::vec2&, const glm::vec2&);
|
|
glm::vec2 get_start() const;
|
|
void set_start(const glm::vec2&);
|
|
glm::vec2 get_end() const;
|
|
void set_end(const glm::vec2&);
|
|
bool intersect(const Segment&);
|
|
bool intersect(const Segment&, glm::vec2&);
|
|
float get_dx();
|
|
float get_length();
|
|
void move(const glm::vec2&);
|
|
glm::vec2 get_center();
|
|
|
|
};
|
|
|
|
std::ostream& operator<<(std::ostream&, const Segment&);
|
|
|
|
#include "extension.hpp"
|
|
|
|
#endif
|