2011-m2s3-city-builder/geometry/segment.hh
2012-01-19 22:11:55 +01:00

24 lines
501 B
C++

#ifndef _GEOMETRY_SEGMENT_HH_
#define _GEOMETRY_SEGMENT_HH_
#include "all_includes.hh"
class Segment {
public :
Vertex u;
Vertex v;
public :
Segment(Vertex u, Vertex v);
float length();
float width();
float height();
Vertex center();
Vertex at(float);
Segment reduce(float value);
Vertex randomPos(int seed, int n, float a, float b); // Renvoie un vertex sur le segment [u,v], à une position entre a et b.
friend Segment operator+(const Segment& t, const Vertex& v);
};
#endif