Example #1
0
    public InvertRotation(IRotRigElement parent, InvertedState invertedState)
    {
        ParentNode = parent;
        ParentNode.AddModifier(this);

        InvertedState = invertedState;
    }
    /// <summary>
    /// Automaticaly adds itself to element's modifiers
    /// </summary>
    public ClampModifier(IRotRigElement element, Vector3 minValues, Vector3 maxValues)
    {
        ParentNode = element;
        ParentNode.AddModifier(this);

        MinValues = minValues;
        MaxValues = maxValues;
    }
    /// <summary>
    /// Automaticaly adds itself to element's modifiers
    /// </summary>
    public FrameDelayModifier(IRotRigElement element, int frameDelay)
    {
        ParentNode = element;
        ParentNode.AddModifier(this);

        _historyLength = frameDelay;
        _history       = new Queue <IEnumerable <Quaternion> >(frameDelay);
    }
    /// <summary>
    /// Automaticaly adds itself to element's modifiers
    /// </summary>
    public RotationOffsetModif(IRotRigElement element)
    {
        if (element == null)
        {
            throw new ArgumentNullException();
        }

        Rotation = new Quaternion[] { new Quaternion() };

        ParentNode = element;
        ParentNode.AddModifier(this);

        UseFirstOnAll = true;
    }
Example #5
0
    public RotationSet(IRotRigElement parent, Transform elem)
    {
        if (elem == null)
        {
            throw new ArgumentNullException();
        }

        BoundObject = elem;

        ParentNode = parent;
        ParentNode.AddModifier(this);

        Rotation = new Vector3(float.NaN, float.NaN, float.NaN);
    }
    /// <summary>
    /// Automaticaly adds itself to element's modifiers
    /// </summary>
    public WeightRotModif(IRotRigElement element, float alpha)
    {
        ParentNode = element;
        ParentNode.AddModifier(this);

        Alpha = alpha;

        var objs = ParentNode.BoundObjects;

        _initialRotationsLocal  = new Quaternion[objs.Length];
        _initialRotationsGlobal = new Quaternion[objs.Length];

        for (int i = 0; i < objs.Length; i++)
        {
            _initialRotationsLocal[i]  = objs[i].localRotation;
            _initialRotationsGlobal[i] = objs[i].rotation;
        }
    }