Example #1
0
        public override Value Evaluate(FSharpList <Value> args)
        {
            DSObject item = (DSObject)((Value.Container)args[0]).Item;
            Vector   v    = (Vector)((Value.Container)args[1]).Item;

            DSObject cloned = item.clone();

            _transformableItem = RestoreProperDSType(cloned) as TransformableItem;

            // TODO: throw exception if not transformable item

            _transformableItem.translate(v.x(), v.y(), v.z());

            GraphicItem graphicItem = _transformableItem as GraphicItem;

            if (graphicItem != null)
            {
                GraphicItem.persist(graphicItem);
            }

            return(Value.NewContainer(_transformableItem));
        }
Example #2
0
        public override Value Evaluate(FSharpList<Value> args)
        {
            DSObject item = (DSObject)((Value.Container)args[0]).Item;
            Vector v = (Vector)((Value.Container)args[1]).Item;

            DSObject cloned = item.clone();

            _transformableItem = RestoreProperDSType(cloned) as TransformableItem;

            // TODO: throw exception if not transformable item

            _transformableItem.translate(v.x(), v.y(), v.z());

            GraphicItem graphicItem = _transformableItem as GraphicItem;

            if (graphicItem != null)
            {
                GraphicItem.persist(graphicItem);
            }

            return Value.NewContainer(_transformableItem);
        }