static protected VFXExpression ConvertSpace(VFXExpression input, SpaceableType spaceType, VFXCoordinateSpace space)
        {
            VFXExpression matrix = null;

            if (space == VFXCoordinateSpace.Local)
            {
                matrix = VFXBuiltInExpression.WorldToLocal;
            }
            else if (space == VFXCoordinateSpace.World)
            {
                matrix = VFXBuiltInExpression.LocalToWorld;
            }
            else
            {
                throw new InvalidOperationException("Cannot Convert to unknown space");
            }

            if (spaceType == SpaceableType.Position)
            {
                input = new VFXExpressionTransformPosition(matrix, input);
            }
            else if (spaceType == SpaceableType.Direction)
            {
                input = new VFXExpressionTransformDirection(matrix, input);
            }
            else if (spaceType == SpaceableType.Matrix)
            {
                input = new VFXExpressionTransformMatrix(matrix, input);
            }
            else if (spaceType == SpaceableType.Vector)
            {
                input = new VFXExpressionTransformVector(matrix, input);
            }
            else
            {
                //Not a transformable subSlot
            }
            return(input);
        }
 public VFXAttribute(string name, VFXValueType type, VFXVariadic variadic = VFXVariadic.False, SpaceableType space = SpaceableType.None)
     : this(name, GetValueFromType(type), variadic, space)
 {
 }
 public VFXAttribute(string name, VFXValue value, VFXVariadic variadic = VFXVariadic.False, SpaceableType space = SpaceableType.None)
 {
     this.name     = name;
     this.value    = value;
     this.variadic = variadic;
     this.space    = space;
     if (space != SpaceableType.None && variadic != VFXVariadic.False)
     {
         throw new InvalidOperationException("Can't mix spaceable and variadic attributes : " + name);
     }
 }
Example #4
0
 public VFXSpaceAttribute(SpaceableType type)
 {
     this.type = type;
 }