Esempio n. 1
0
        public void SwitchingCollection()
        {
            DummySceneNode node  = new DummySceneNode();
            DummySceneNode node2 = new DummySceneNode();

            DummySceneNode nodeA = new DummySceneNode();
            DummySceneNode nodeB = new DummySceneNode();
            DummySceneNode nodeC = new DummySceneNode();

            node.Children.Add(nodeA);
            node.Children.Add(nodeB);
            node.Children.Add(nodeC);

            Assert.AreSame(node, nodeA.Parent);
            Assert.AreSame(node, nodeB.Parent);
            Assert.AreSame(node, nodeC.Parent);

            node.Children.Remove(nodeB);
            node.Children.Remove(nodeC);
            node2.Children.Add(nodeB);
            node2.Children.Add(nodeC);
            Assert.AreEqual(1, node.Children.Count);
            Assert.AreSame(node, nodeA.Parent);
            Assert.AreEqual(2, node2.Children.Count);
            Assert.AreSame(node2, nodeB.Parent);
            Assert.AreSame(node2, nodeC.Parent);
        }
Esempio n. 2
0
        public void ShouldThrowWhenChildIsNull2()
        {
            DummySceneNode node = new DummySceneNode();

            node.Children.Add(new DummySceneNode());
            node.Children[0] = null;
        }
Esempio n. 3
0
        public void ClearShouldResetParents()
        {
            DummySceneNode node = new DummySceneNode();

            Assert.AreEqual(0, node.Children.Count);

            node.Children.Clear(); // Test clear on empty collection.

            DummySceneNode nodeA = new DummySceneNode();
            DummySceneNode nodeB = new DummySceneNode();
            DummySceneNode nodeC = new DummySceneNode();

            node.Children.Add(nodeA);
            node.Children.Add(nodeB);
            node.Children.Add(nodeC);

            Assert.AreSame(node, nodeA.Parent);
            Assert.AreSame(node, nodeB.Parent);
            Assert.AreSame(node, nodeC.Parent);

            node.Children.Clear();

            Assert.IsNull(nodeA.Parent);
            Assert.IsNull(nodeB.Parent);
            Assert.IsNull(nodeC.Parent);
        }
Esempio n. 4
0
        public void ShouldThrowWhenSceneIsAddedToAsChild()
        {
            DefaultScene scene = new DefaultScene();

              DummySceneNode node = new DummySceneNode();
              node.Children.Add(scene);
        }
        public void ClearShouldResetParents()
        {
            DummySceneNode node = new DummySceneNode();

              Assert.AreEqual(0, node.Children.Count);

              node.Children.Clear();  // Test clear on empty collection.

              DummySceneNode nodeA = new DummySceneNode();
              DummySceneNode nodeB = new DummySceneNode();
              DummySceneNode nodeC = new DummySceneNode();
              node.Children.Add(nodeA);
              node.Children.Add(nodeB);
              node.Children.Add(nodeC);

              Assert.AreSame(node, nodeA.Parent);
              Assert.AreSame(node, nodeB.Parent);
              Assert.AreSame(node, nodeC.Parent);

              node.Children.Clear();

              Assert.IsNull(nodeA.Parent);
              Assert.IsNull(nodeB.Parent);
              Assert.IsNull(nodeC.Parent);
        }
Esempio n. 6
0
        public void ShouldThrowWhenChildExists()
        {
            DummySceneNode node  = new DummySceneNode();
            DummySceneNode child = new DummySceneNode();

            node.Children.Add(child);
            node.Children.Add(child);
        }
Esempio n. 7
0
        public void ShouldThrowWhenSceneIsAddedToAsChild()
        {
            DefaultScene scene = new DefaultScene();

            DummySceneNode node = new DummySceneNode();

            node.Children.Add(scene);
        }
Esempio n. 8
0
        public void ShouldThrowWhenChildExists2()
        {
            DummySceneNode node   = new DummySceneNode();
            DummySceneNode childA = new DummySceneNode();
            DummySceneNode childB = new DummySceneNode();

            node.Children.Add(childA);
            node.Children.Add(childB);
            node.Children[1] = childA;
        }
Esempio n. 9
0
        public void ShoudThrowWhenChildHasParent()
        {
            DummySceneNode node   = new DummySceneNode();
            DummySceneNode node2  = new DummySceneNode();
            DummySceneNode childA = new DummySceneNode();
            DummySceneNode childB = new DummySceneNode();

            node.Children.Add(childA);
            node2.Children.Add(childB);
            node.Children[0] = childB;
        }
Esempio n. 10
0
        public void ManipulatePoses()
        {
            DummySceneNode nodeA = new DummySceneNode { PoseLocal = new Pose(new Vector3F(1, 1, 1)) };
              DummySceneNode nodeB = new DummySceneNode { PoseLocal = new Pose(new Vector3F(1, 2, -3)) };
              DummySceneNode nodeC = new DummySceneNode { PoseLocal = new Pose(new Vector3F(1, 2, 3)) };
              DummySceneNode nodeD = new DummySceneNode { PoseLocal = new Pose(new Vector3F(0, 0, -1)) };
              nodeA.Children.Add(nodeB);
              nodeA.Children.Add(nodeC);
              nodeB.Children.Add(nodeD);

              Assert.AreEqual(new Pose(new Vector3F(1, 1, 1)), nodeA.PoseLocal);
              Assert.AreEqual(new Pose(new Vector3F(1, 2, -3)), nodeB.PoseLocal);
              Assert.AreEqual(new Pose(new Vector3F(1, 2, 3)), nodeC.PoseLocal);
              Assert.AreEqual(new Pose(new Vector3F(0, 0, -1)), nodeD.PoseLocal);
              Assert.AreEqual(new Pose(new Vector3F(1, 1, 1)), nodeA.PoseWorld);
              Assert.AreEqual(new Pose(new Vector3F(2, 3, -2)), nodeB.PoseWorld);
              Assert.AreEqual(new Pose(new Vector3F(2, 3, 4)), nodeC.PoseWorld);
              Assert.AreEqual(new Pose(new Vector3F(2, 3, -3)), nodeD.PoseWorld);

              // Update local pose
              nodeA.PoseLocal = new Pose(new Vector3F(2, 0, 0));
              Assert.AreEqual(new Pose(new Vector3F(2, 0, 0)), nodeA.PoseLocal);
              Assert.AreEqual(new Pose(new Vector3F(1, 2, -3)), nodeB.PoseLocal);
              Assert.AreEqual(new Pose(new Vector3F(1, 2, 3)), nodeC.PoseLocal);
              Assert.AreEqual(new Pose(new Vector3F(0, 0, -1)), nodeD.PoseLocal);
              Assert.AreEqual(new Pose(new Vector3F(2, 0, 0)), nodeA.PoseWorld);
              Assert.AreEqual(new Pose(new Vector3F(3, 2, -3)), nodeB.PoseWorld);
              Assert.AreEqual(new Pose(new Vector3F(3, 2, 3)), nodeC.PoseWorld);
              Assert.AreEqual(new Pose(new Vector3F(3, 2, -4)), nodeD.PoseWorld);

              // Update world pose
              nodeB.PoseWorld = new Pose(new Vector3F(9, 9, 9));
              Assert.AreEqual(new Pose(new Vector3F(2, 0, 0)), nodeA.PoseLocal);
              Assert.AreEqual(new Pose(new Vector3F(7, 9, 9)), nodeB.PoseLocal);
              Assert.AreEqual(new Pose(new Vector3F(1, 2, 3)), nodeC.PoseLocal);
              Assert.AreEqual(new Pose(new Vector3F(0, 0, -1)), nodeD.PoseLocal);
              Assert.AreEqual(new Pose(new Vector3F(2, 0, 0)), nodeA.PoseWorld);
              Assert.AreEqual(new Pose(new Vector3F(9, 9, 9)), nodeB.PoseWorld);
              Assert.AreEqual(new Pose(new Vector3F(3, 2, 3)), nodeC.PoseWorld);
              Assert.AreEqual(new Pose(new Vector3F(9, 9, 8)), nodeD.PoseWorld);

              // Attach node to different node
              nodeA.Children.Remove(nodeB);
              nodeC.Children.Add(nodeB);
              Assert.AreEqual(new Pose(new Vector3F(2, 0, 0)), nodeA.PoseLocal);
              Assert.AreEqual(new Pose(new Vector3F(1, 2, 3)), nodeC.PoseLocal);
              Assert.AreEqual(new Pose(new Vector3F(7, 9, 9)), nodeB.PoseLocal);
              Assert.AreEqual(new Pose(new Vector3F(0, 0, -1)), nodeD.PoseLocal);
              Assert.AreEqual(new Pose(new Vector3F(2, 0, 0)), nodeA.PoseWorld);
              Assert.AreEqual(new Pose(new Vector3F(3, 2, 3)), nodeC.PoseWorld);
              Assert.AreEqual(new Pose(new Vector3F(10, 11, 12)), nodeB.PoseWorld);
              Assert.AreEqual(new Pose(new Vector3F(10, 11, 11)), nodeD.PoseWorld);
        }
        public void RemoveShouldResetParents()
        {
            DummySceneNode node = new DummySceneNode();

              DummySceneNode child = new DummySceneNode();
              node.Children.Add(child);

              Assert.AreSame(node, child.Parent);

              node.Children.Remove(child);

              Assert.IsNull(child.Parent);
        }
Esempio n. 12
0
        public void AddRemoveSingleNode()
        {
            DefaultScene scene = new DefaultScene();

              DummySceneNode node = new DummySceneNode();
              scene.Children.Add(node);

              Assert.AreEqual(1, scene.CollisionDomain.CollisionObjects.Count);
              Assert.AreSame(node, scene.CollisionDomain.CollisionObjects[0].GeometricObject);

              scene.Children.Remove(node);
              Assert.AreEqual(0, scene.CollisionDomain.CollisionObjects.Count);
        }
Esempio n. 13
0
        public void AddRemoveTreeOfNodesTest()
        {
            DefaultScene scene = new DefaultScene();

            DummySceneNode nodeA = new DummySceneNode {
                Name = "A"
            };
            DummySceneNode nodeB = new DummySceneNode {
                Name = "B"
            };
            DummySceneNode nodeC = new DummySceneNode {
                Name = "C"
            };
            DummySceneNode nodeD = new DummySceneNode {
                Name = "D"
            };

            nodeA.Children.Add(nodeB);
            nodeA.Children.Add(nodeC);
            nodeB.Children.Add(nodeD);

            // Add a tree of nodes.
            scene.Children.Add(nodeA);

            Assert.AreEqual(4, scene.CollisionDomain.CollisionObjects.Count);
            Assert.IsNotNull(scene.CollisionDomain.CollisionObjects.Get(nodeA));
            Assert.IsNotNull(scene.CollisionDomain.CollisionObjects.Get(nodeB));
            Assert.IsNotNull(scene.CollisionDomain.CollisionObjects.Get(nodeC));
            Assert.IsNotNull(scene.CollisionDomain.CollisionObjects.Get(nodeD));

            // Add a single node to tree.
            DummySceneNode nodeE = new DummySceneNode();

            nodeD.Children.Add(nodeE);

            Assert.AreEqual(5, scene.CollisionDomain.CollisionObjects.Count);
            Assert.IsNotNull(scene.CollisionDomain.CollisionObjects.Get(nodeE));

            // Remove a subtree.
            nodeB.Children.Remove(nodeD);

            Assert.AreEqual(3, scene.CollisionDomain.CollisionObjects.Count);
            Assert.IsNotNull(scene.CollisionDomain.CollisionObjects.Get(nodeA));
            Assert.IsNotNull(scene.CollisionDomain.CollisionObjects.Get(nodeB));
            Assert.IsNotNull(scene.CollisionDomain.CollisionObjects.Get(nodeC));

            // Remove tree.
            scene.Children.Remove(nodeA);
            Assert.AreEqual(0, scene.CollisionDomain.CollisionObjects.Count);
        }
        public void ReplaceChild()
        {
            DummySceneNode node = new DummySceneNode();
              DummySceneNode childA = new DummySceneNode();
              DummySceneNode childB = new DummySceneNode();
              node.Children.Add(childA);

              Assert.AreEqual(1, node.Children.Count);
              Assert.AreSame(childA, node.Children[0]);

              node.Children[0] = childB;
              Assert.AreEqual(1, node.Children.Count);
              Assert.AreSame(childB, node.Children[0]);
        }
Esempio n. 15
0
        public void RemoveShouldResetParents()
        {
            DummySceneNode node = new DummySceneNode();

            DummySceneNode child = new DummySceneNode();

            node.Children.Add(child);

            Assert.AreSame(node, child.Parent);

            node.Children.Remove(child);

            Assert.IsNull(child.Parent);
        }
Esempio n. 16
0
        public void AddRemoveSingleNode()
        {
            DefaultScene scene = new DefaultScene();

            DummySceneNode node = new DummySceneNode();

            scene.Children.Add(node);

            Assert.AreEqual(1, scene.CollisionDomain.CollisionObjects.Count);
            Assert.AreSame(node, scene.CollisionDomain.CollisionObjects[0].GeometricObject);

            scene.Children.Remove(node);
            Assert.AreEqual(0, scene.CollisionDomain.CollisionObjects.Count);
        }
Esempio n. 17
0
        public void GetAncestors()
        {
            DummySceneNode nodeA = new DummySceneNode();
              DummySceneNode nodeB = new DummySceneNode();
              DummySceneNode nodeC = new DummySceneNode();
              DummySceneNode nodeD = new DummySceneNode();
              nodeA.Children.Add(nodeB);
              nodeA.Children.Add(nodeC);
              nodeB.Children.Add(nodeD);

              var ancestors = nodeD.GetAncestors().ToArray();
              Assert.AreEqual(2, ancestors.Length);
              Assert.AreSame(nodeB, ancestors[0]);
              Assert.AreSame(nodeA, ancestors[1]);
        }
Esempio n. 18
0
        public void ReplaceChild()
        {
            DummySceneNode node   = new DummySceneNode();
            DummySceneNode childA = new DummySceneNode();
            DummySceneNode childB = new DummySceneNode();

            node.Children.Add(childA);

            Assert.AreEqual(1, node.Children.Count);
            Assert.AreSame(childA, node.Children[0]);

            node.Children[0] = childB;
            Assert.AreEqual(1, node.Children.Count);
            Assert.AreSame(childB, node.Children[0]);
        }
Esempio n. 19
0
        public void ShouldSetParent()
        {
            DummySceneNode node = new DummySceneNode();

            DummySceneNode nodeA = new DummySceneNode();
            DummySceneNode nodeB = new DummySceneNode();
            DummySceneNode nodeC = new DummySceneNode();

            node.Children.Add(nodeA);
            node.Children.Add(nodeB);
            node.Children.Add(nodeC);

            Assert.AreSame(node, nodeA.Parent);
            Assert.AreSame(node, nodeB.Parent);
            Assert.AreSame(node, nodeC.Parent);
        }
Esempio n. 20
0
        public void GetDescendantsDepthFirst()
        {
            DummySceneNode nodeA = new DummySceneNode();
              DummySceneNode nodeB = new DummySceneNode();
              DummySceneNode nodeC = new DummySceneNode();
              DummySceneNode nodeD = new DummySceneNode();
              nodeA.Children.Add(nodeB);
              nodeA.Children.Add(nodeC);
              nodeB.Children.Add(nodeD);

              var descendants = nodeA.GetDescendants().ToArray();
              Assert.AreEqual(3, descendants.Length);
              Assert.AreSame(nodeB, descendants[0]);
              Assert.AreSame(nodeD, descendants[1]);
              Assert.AreSame(nodeC, descendants[2]);
        }
Esempio n. 21
0
        public void GetAncestors()
        {
            DummySceneNode nodeA = new DummySceneNode();
            DummySceneNode nodeB = new DummySceneNode();
            DummySceneNode nodeC = new DummySceneNode();
            DummySceneNode nodeD = new DummySceneNode();

            nodeA.Children.Add(nodeB);
            nodeA.Children.Add(nodeC);
            nodeB.Children.Add(nodeD);

            var ancestors = nodeD.GetAncestors().ToArray();

            Assert.AreEqual(2, ancestors.Length);
            Assert.AreSame(nodeB, ancestors[0]);
            Assert.AreSame(nodeA, ancestors[1]);
        }
Esempio n. 22
0
        public void GetDescendantsBreadthFirst()
        {
            DummySceneNode nodeA = new DummySceneNode();
            DummySceneNode nodeB = new DummySceneNode();
            DummySceneNode nodeC = new DummySceneNode();
            DummySceneNode nodeD = new DummySceneNode();

            nodeA.Children.Add(nodeB);
            nodeA.Children.Add(nodeC);
            nodeB.Children.Add(nodeD);

            var descendants = nodeA.GetDescendants(false).ToArray();

            Assert.AreEqual(3, descendants.Length);
            Assert.AreSame(nodeB, descendants[0]);
            Assert.AreSame(nodeC, descendants[1]);
            Assert.AreSame(nodeD, descendants[2]);
        }
        public void CheckSequence()
        {
            DummySceneNode node = new DummySceneNode();

              Assert.AreEqual(0, node.Children.Count);

              DummySceneNode nodeA = new DummySceneNode();
              DummySceneNode nodeB = new DummySceneNode();
              DummySceneNode nodeC = new DummySceneNode();
              node.Children.Add(nodeA);
              node.Children.Add(nodeB);
              node.Children.Add(nodeC);

              Assert.AreEqual(3, node.Children.Count);
              Assert.AreSame(nodeA, node.Children[0]);
              Assert.AreSame(nodeB, node.Children[1]);
              Assert.AreSame(nodeC, node.Children[2]);
        }
Esempio n. 24
0
        public void CheckSequence()
        {
            DummySceneNode node = new DummySceneNode();

            Assert.AreEqual(0, node.Children.Count);

            DummySceneNode nodeA = new DummySceneNode();
            DummySceneNode nodeB = new DummySceneNode();
            DummySceneNode nodeC = new DummySceneNode();

            node.Children.Add(nodeA);
            node.Children.Add(nodeB);
            node.Children.Add(nodeC);

            Assert.AreEqual(3, node.Children.Count);
            Assert.AreSame(nodeA, node.Children[0]);
            Assert.AreSame(nodeB, node.Children[1]);
            Assert.AreSame(nodeC, node.Children[2]);
        }
Esempio n. 25
0
        public void AddRemoveTreeOfNodesTest()
        {
            DefaultScene scene = new DefaultScene();

              DummySceneNode nodeA = new DummySceneNode { Name = "A" };
              DummySceneNode nodeB = new DummySceneNode { Name = "B" };
              DummySceneNode nodeC = new DummySceneNode { Name = "C" };
              DummySceneNode nodeD = new DummySceneNode { Name = "D" };
              nodeA.Children.Add(nodeB);
              nodeA.Children.Add(nodeC);
              nodeB.Children.Add(nodeD);

              // Add a tree of nodes.
              scene.Children.Add(nodeA);

              Assert.AreEqual(4, scene.CollisionDomain.CollisionObjects.Count);
              Assert.IsNotNull(scene.CollisionDomain.CollisionObjects.Get(nodeA));
              Assert.IsNotNull(scene.CollisionDomain.CollisionObjects.Get(nodeB));
              Assert.IsNotNull(scene.CollisionDomain.CollisionObjects.Get(nodeC));
              Assert.IsNotNull(scene.CollisionDomain.CollisionObjects.Get(nodeD));

              // Add a single node to tree.
              DummySceneNode nodeE = new DummySceneNode();
              nodeD.Children.Add(nodeE);

              Assert.AreEqual(5, scene.CollisionDomain.CollisionObjects.Count);
              Assert.IsNotNull(scene.CollisionDomain.CollisionObjects.Get(nodeE));

              // Remove a subtree.
              nodeB.Children.Remove(nodeD);

              Assert.AreEqual(3, scene.CollisionDomain.CollisionObjects.Count);
              Assert.IsNotNull(scene.CollisionDomain.CollisionObjects.Get(nodeA));
              Assert.IsNotNull(scene.CollisionDomain.CollisionObjects.Get(nodeB));
              Assert.IsNotNull(scene.CollisionDomain.CollisionObjects.Get(nodeC));

              // Remove tree.
              scene.Children.Remove(nodeA);
              Assert.AreEqual(0, scene.CollisionDomain.CollisionObjects.Count);
        }
 public void ShouldThrowWhenChildIsNull2()
 {
     DummySceneNode node = new DummySceneNode();
       node.Children.Add(new DummySceneNode());
       node.Children[0] = null;
 }
 public void ShouldThrowWhenChildIsNull()
 {
     DummySceneNode node = new DummySceneNode();
       node.Children.Add(null);
 }
 public void ShouldThrowWhenChildExists()
 {
     DummySceneNode node = new DummySceneNode();
       DummySceneNode child = new DummySceneNode();
       node.Children.Add(child);
       node.Children.Add(child);
 }
Esempio n. 29
0
        public void ShouldThrowWhenChildIsNull()
        {
            DummySceneNode node = new DummySceneNode();

            node.Children.Add(null);
        }
        public void SwitchingCollection()
        {
            DummySceneNode node = new DummySceneNode();
              DummySceneNode node2 = new DummySceneNode();

              DummySceneNode nodeA = new DummySceneNode();
              DummySceneNode nodeB = new DummySceneNode();
              DummySceneNode nodeC = new DummySceneNode();
              node.Children.Add(nodeA);
              node.Children.Add(nodeB);
              node.Children.Add(nodeC);

              Assert.AreSame(node, nodeA.Parent);
              Assert.AreSame(node, nodeB.Parent);
              Assert.AreSame(node, nodeC.Parent);

              node.Children.Remove(nodeB);
              node.Children.Remove(nodeC);
              node2.Children.Add(nodeB);
              node2.Children.Add(nodeC);
              Assert.AreEqual(1, node.Children.Count);
              Assert.AreSame(node, nodeA.Parent);
              Assert.AreEqual(2, node2.Children.Count);
              Assert.AreSame(node2, nodeB.Parent);
              Assert.AreSame(node2, nodeC.Parent);
        }
Esempio n. 31
0
        public void GetAncestorsOfRoot()
        {
            DummySceneNode nodeA = new DummySceneNode();

            Assert.AreEqual(0, nodeA.GetAncestors().Count());
        }
Esempio n. 32
0
        public void ManipulatePoses()
        {
            DummySceneNode nodeA = new DummySceneNode {
                PoseLocal = new Pose(new Vector3F(1, 1, 1))
            };
            DummySceneNode nodeB = new DummySceneNode {
                PoseLocal = new Pose(new Vector3F(1, 2, -3))
            };
            DummySceneNode nodeC = new DummySceneNode {
                PoseLocal = new Pose(new Vector3F(1, 2, 3))
            };
            DummySceneNode nodeD = new DummySceneNode {
                PoseLocal = new Pose(new Vector3F(0, 0, -1))
            };

            nodeA.Children.Add(nodeB);
            nodeA.Children.Add(nodeC);
            nodeB.Children.Add(nodeD);

            Assert.AreEqual(new Pose(new Vector3F(1, 1, 1)), nodeA.PoseLocal);
            Assert.AreEqual(new Pose(new Vector3F(1, 2, -3)), nodeB.PoseLocal);
            Assert.AreEqual(new Pose(new Vector3F(1, 2, 3)), nodeC.PoseLocal);
            Assert.AreEqual(new Pose(new Vector3F(0, 0, -1)), nodeD.PoseLocal);
            Assert.AreEqual(new Pose(new Vector3F(1, 1, 1)), nodeA.PoseWorld);
            Assert.AreEqual(new Pose(new Vector3F(2, 3, -2)), nodeB.PoseWorld);
            Assert.AreEqual(new Pose(new Vector3F(2, 3, 4)), nodeC.PoseWorld);
            Assert.AreEqual(new Pose(new Vector3F(2, 3, -3)), nodeD.PoseWorld);

            // Update local pose
            nodeA.PoseLocal = new Pose(new Vector3F(2, 0, 0));
            Assert.AreEqual(new Pose(new Vector3F(2, 0, 0)), nodeA.PoseLocal);
            Assert.AreEqual(new Pose(new Vector3F(1, 2, -3)), nodeB.PoseLocal);
            Assert.AreEqual(new Pose(new Vector3F(1, 2, 3)), nodeC.PoseLocal);
            Assert.AreEqual(new Pose(new Vector3F(0, 0, -1)), nodeD.PoseLocal);
            Assert.AreEqual(new Pose(new Vector3F(2, 0, 0)), nodeA.PoseWorld);
            Assert.AreEqual(new Pose(new Vector3F(3, 2, -3)), nodeB.PoseWorld);
            Assert.AreEqual(new Pose(new Vector3F(3, 2, 3)), nodeC.PoseWorld);
            Assert.AreEqual(new Pose(new Vector3F(3, 2, -4)), nodeD.PoseWorld);

            // Update world pose
            nodeB.PoseWorld = new Pose(new Vector3F(9, 9, 9));
            Assert.AreEqual(new Pose(new Vector3F(2, 0, 0)), nodeA.PoseLocal);
            Assert.AreEqual(new Pose(new Vector3F(7, 9, 9)), nodeB.PoseLocal);
            Assert.AreEqual(new Pose(new Vector3F(1, 2, 3)), nodeC.PoseLocal);
            Assert.AreEqual(new Pose(new Vector3F(0, 0, -1)), nodeD.PoseLocal);
            Assert.AreEqual(new Pose(new Vector3F(2, 0, 0)), nodeA.PoseWorld);
            Assert.AreEqual(new Pose(new Vector3F(9, 9, 9)), nodeB.PoseWorld);
            Assert.AreEqual(new Pose(new Vector3F(3, 2, 3)), nodeC.PoseWorld);
            Assert.AreEqual(new Pose(new Vector3F(9, 9, 8)), nodeD.PoseWorld);

            // Attach node to different node
            nodeA.Children.Remove(nodeB);
            nodeC.Children.Add(nodeB);
            Assert.AreEqual(new Pose(new Vector3F(2, 0, 0)), nodeA.PoseLocal);
            Assert.AreEqual(new Pose(new Vector3F(1, 2, 3)), nodeC.PoseLocal);
            Assert.AreEqual(new Pose(new Vector3F(7, 9, 9)), nodeB.PoseLocal);
            Assert.AreEqual(new Pose(new Vector3F(0, 0, -1)), nodeD.PoseLocal);
            Assert.AreEqual(new Pose(new Vector3F(2, 0, 0)), nodeA.PoseWorld);
            Assert.AreEqual(new Pose(new Vector3F(3, 2, 3)), nodeC.PoseWorld);
            Assert.AreEqual(new Pose(new Vector3F(10, 11, 12)), nodeB.PoseWorld);
            Assert.AreEqual(new Pose(new Vector3F(10, 11, 11)), nodeD.PoseWorld);
        }
Esempio n. 33
0
        public void ShouldThrowWhenOwnerHasCollection()
        {
            DummySceneNode node = new DummySceneNode();

            new SceneNodeCollection(node);
        }
Esempio n. 34
0
 public void GetDescendantsOfLeaf()
 {
     DummySceneNode nodeA = new DummySceneNode();
       Assert.AreEqual(0, nodeA.GetDescendants().Count());
 }
 public void ShouldThrowWhenChildExists2()
 {
     DummySceneNode node = new DummySceneNode();
       DummySceneNode childA = new DummySceneNode();
       DummySceneNode childB = new DummySceneNode();
       node.Children.Add(childA);
       node.Children.Add(childB);
       node.Children[1] = childA;
 }
 public void ShoudThrowWhenChildHasParent()
 {
     DummySceneNode node = new DummySceneNode();
       DummySceneNode node2 = new DummySceneNode();
       DummySceneNode childA = new DummySceneNode();
       DummySceneNode childB = new DummySceneNode();
       node.Children.Add(childA);
       node2.Children.Add(childB);
       node.Children[0] = childB;
 }
        public void ShouldSetParent()
        {
            DummySceneNode node = new DummySceneNode();

              DummySceneNode nodeA = new DummySceneNode();
              DummySceneNode nodeB = new DummySceneNode();
              DummySceneNode nodeC = new DummySceneNode();
              node.Children.Add(nodeA);
              node.Children.Add(nodeB);
              node.Children.Add(nodeC);

              Assert.AreSame(node, nodeA.Parent);
              Assert.AreSame(node, nodeB.Parent);
              Assert.AreSame(node, nodeC.Parent);
        }
Esempio n. 38
0
        public void GetDescendantsOfLeaf()
        {
            DummySceneNode nodeA = new DummySceneNode();

            Assert.AreEqual(0, nodeA.GetDescendants().Count());
        }
Esempio n. 39
0
 public void GetAncestorsOfRoot()
 {
     DummySceneNode nodeA = new DummySceneNode();
       Assert.AreEqual(0, nodeA.GetAncestors().Count());
 }
 public void ShouldThrowWhenOwnerHasCollection()
 {
     DummySceneNode node = new DummySceneNode();
       new SceneNodeCollection(node);
 }