22 tf2::Vector3 X1 = line.
line.
p1;
23 tf2::Vector3 X2 = line.
line.
p2;
24 tf2::Vector3 z(0, 0, 1);
25 tf2::Vector3 y = (X2-X1) / tf2::tf2Distance(X1, X2);
26 tf2::Vector3 x = tf2::tf2Cross(y, z);
33 vector<tf2::Vector3> coord(4);
36 coord[2] = coord[1] - H*(cos(psi)*z - sin(psi)*x);
37 coord[3] = coord[0] - H*(cos(psi)*z - sin(psi)*x);
41 ostream &
operator<<(ostream &stream,
const tf2::Vector3 &v)
43 stream <<
"(x=" << v.getX() <<
" ; y=" << v.getY() <<
" ; z=" << v.getZ() <<
")";
tf2::Vector3 position
Position of the alga on the line.
Declaration of common structures and functions for farm simulator.
float width
Width of the alga.
tf2::Vector3 p1
Position of the first extremity of the rope.
tf2::Vector3 p2
Position of the second extremity of the rope.
Rope line
Rope on wich the algae grow.
float length
Length of the alga.
ostream & operator<<(ostream &stream, const tf2::Vector3 &v)
Line on which algae grow.
std::vector< tf2::Vector3 > get_alga_coord(const AlgaeLine &line, const Alga &alga)
Computes the corner coordinates of an alga.
float orientation
Orientation of the alga.