Beispiel #1
0
        public void Execute(ref WooState state)
        {
            Vector3 colourVec = _ColourExpr.EvaluateVector(ref state);
            Colour  colour    = new Colour(colourVec.x, colourVec.y, colourVec.z);
            Vector3 direction = _DirectionExpr.EvaluateVector(ref state);

            double area = _AreaExpr.EvaluateFloat(ref state);

            if (area < 0)
            {
                area = 0;
            }
            if (area > 0.99)
            {
                area = 0.99;
            }

            double samples = _SamplesExpr.EvaluateFloat(ref state);

            if (samples < 1)
            {
                samples = 1;
            }

            DirectionalLight directionalLight = new DirectionalLight(colour, direction, (float)area, (int)samples);

            directionalLight.CreateElement(state._Parent, new Vector3(0, 0, 0));
        }
Beispiel #2
0
        public void Execute(ref WooState state)
        {
            Vector3 colourVec = _ColourExpr.EvaluateVector(ref state);
            Colour colour = new Colour(colourVec.x, colourVec.y, colourVec.z);
            Vector3 direction = _DirectionExpr.EvaluateVector(ref state);

            double area = _AreaExpr.EvaluateFloat(ref state);
            if (area < 0) area = 0;
            if (area > 0.99) area = 0.99;

            double samples = _SamplesExpr.EvaluateFloat(ref state);
            if (samples < 1) samples = 1;

            DirectionalLight directionalLight = new DirectionalLight(colour, direction, (float)area, (int)samples);
            directionalLight.CreateElement(state._Parent, new Vector3(0,0,0));
        }