Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Camera{VIEW, PROJECTION}"/> class.
        /// </summary>
        /// <param name="view">The view.</param>
        /// <param name="projection">The projection.</param>
        public Camera(VIEW view, PROJECTION projection)
        {
            View       = view;
            Projection = projection;
            var parent = new TransformationHierarchyNode(new Transformation(projection), null);

            Projection.PropertyChanged += (s, a) => parent.LocalTransformation = new Transformation(projection);
            node = new TransformationHierarchyNode(new Transformation(view), parent);
            view.PropertyChanged += (s, a) => node.LocalTransformation = new Transformation(view);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="TransformationHierarchyNode"/> class.
 /// </summary>
 /// <param name="localTransformation">The node transformation.</param>
 /// <param name="parent">The parent transformation hierarchy node.</param>
 public TransformationHierarchyNode(Transformation localTransformation, TransformationHierarchyNode parent)
 {
     globalTransform     = new CachedCalculatedValue <Transformation>(CalcGlobalTransformation);
     LocalTransformation = localTransformation;
     Parent = parent;
 }