package de.grogra.c4d;

import de.grogra.xl.query.AttributeListPattern;

public class RU extends BaseObject
{

	public static class Pattern extends AttributeListPattern
	{
		public Pattern()
		{
			super(null, 1);
		}

		public static void signature (@In @Out RU n, double a)
		{
		}

		@Override
		protected double getDouble(Object o, int index)
		{
			return ((RU) o).getAngle();
		}
	}

	/**
	 * Creates a new <code>RU</code> node with an initial
	 * angle of 0 degrees.
	 */
	public RU()
	{
		this(0);
	}

	/**
	 * Creates a new <code>RU</code> node which performs
	 * a counter-clockwise rotation of <code>angle</code>
	 * degrees.
	 * 
	 * @param angle rotation angle in degrees
	 */
	public RU(double angle)
	{
		super(Constants.Onull);
		setRotation(0, Math.toRadians(angle), 0);
	}

	public double getAngle()
	{
		return Math.toDegrees(getRotation().y);
	}
}
