package de.grogra.c4d;

import de.grogra.xl.query.AttributeListPattern;

public class RL extends BaseObject
{

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

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

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

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

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

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