コード例 #1
0
        override protected VFXExpression[] BuildExpression(VFXExpression[] inputExpression)
        {
            VFXExpression c0 = inputExpression[0];
            VFXExpression c1 = inputExpression[1];
            VFXExpression c2 = inputExpression[2];
            VFXExpression c3 = inputExpression[3];

            VFXExpression matrix = new VFXExpressionVector4sToMatrix(c0, c1, c2, c3);

            return(new[] { matrix });
        }
コード例 #2
0
        public void ProcessExpressionVector4sToMatrix()
        {
            var x = new Vector4(1, 0, 0, 0);
            var y = new Vector4(0, 1, 0, 0);
            var z = new Vector4(0, 0, 1, 0);
            var w = new Vector4(0, 0, 0, 1);

            var xValue = VFXValue.Constant(x);
            var yValue = VFXValue.Constant(y);
            var zValue = VFXValue.Constant(z);
            var wValue = VFXValue.Constant(w);

            var matrixValue = new VFXExpressionVector4sToMatrix(xValue, yValue, zValue, wValue);

            var context = new VFXExpression.Context(VFXExpressionContextOption.CPUEvaluation);
            var reduced = context.Compile(matrixValue);

            Assert.AreEqual(Matrix4x4.identity, reduced.Get <Matrix4x4>());
        }