package de.grogra.c4d;

import de.grogra.xl.query.AttributeListPattern;

public class RH extends BaseObject
{

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

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

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

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

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

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