/// <summary> /// Creates a Rotater. This removes any existing nlerpers and rotaters attached to the lthing. /// </summary> /// <param name="owner">What lthing are we affecting?</param> /// <param name="duration">How long as we going to rotate?</param> /// <param name="angle">Rotation angle</param> /// <param name="mode">Rotation axis mode</param> /// <returns>The new rotater</returns> public Rotater CreateRotater(LThing owner, float duration, Radian angle, RotaterAxisMode mode) { RemoveRotater(owner); Rotater newRotater = new Rotater(owner, duration, angle, mode); Rotaters.TryAdd(owner, newRotater); return newRotater; }
/// <summary> /// Creates a Rotater. This removes any existing nlerpers and rotaters attached to the lthing. /// </summary> /// <param name="owner">What lthing are we affecting?</param> /// <param name="duration">How long as we going to rotate?</param> /// <param name="angle">Rotation angle</param> /// <param name="axis">Axis of rotation</param> /// <param name="mode">Rotation axis mode</param> /// <returns>The new rotater</returns> public Rotater CreateRotater(LThing owner, float duration, Radian angle, Vector3 axis, RotaterAxisMode mode = RotaterAxisMode.Explicit) { RemoveRotater(owner); RemoveNlerper(owner); Rotater newRotater = new Rotater(owner, duration, angle, axis, mode); Rotaters.TryAdd(owner, newRotater); return newRotater; }
/// <summary> /// USE THE LThingHelperManager FOR THIS! /// </summary> public Rotater(LThing thingToRotate, float duration, Radian angle, Vector3 axis, RotaterAxisMode mode = RotaterAxisMode.Explicit) { this.thing = thingToRotate; this.duration = duration; this.angle = angle; this.axis = axis; this.mode = mode; orient = new Quaternion(); PhysicsMain.PreSimulate += PreSimulate; }
/// <summary> /// USE THE LThingHelperManager FOR THIS! /// </summary> public Rotater(LThing thingToRotate, float duration, Radian angle, RotaterAxisMode mode) : this(thingToRotate, duration, angle, default(Vector3), mode) { }