double getTheta(vec4 pos)
{

	vec2 reference = vec2(1.0,0.0) ;
	vec2 planar_angle = vec2(pos.x, pos.z) ;

	float dotPdt = dot( reference, planar_angle ) ;

	double theta = acos(dotPdt/(length(reference)*length(planar_angle)));


	if ( pos.z < 0.0 )
	{
		theta = 2 * M_PI - theta ;
	}

	return theta ;

}
Ejemplo n.º 2
0
/**
 * Updates the size of the screen.
 * @param x The new width.
 * @param y The new height.
 */
void Screen::size( int x, int y ) {
  size( vec2( x, y ) );
}