void CreateParts() { Root = new HumanNode(new Vector3(0, 0, 1)) { Position = Vector3.Zero, Scale = new Vector3(1, 3, .5f), }; Head = new HumanNode(new Vector3(1, 0, 0)) { Position = new Vector3(0, 4f, 0), Scale = new Vector3(.7f, 1f, 0.5f) }; LeftArm = new HumanNode(new Vector3(0, 1, 0)) { Position = new Vector3(3.5f, 1.2f, 0), Scale = new Vector3(2.5f, .3f, .3f) }; LeftLeg = new HumanNode(new Vector3(1, 1, 0)) { Position = new Vector3(.5f, -6f, 0), Scale = new Vector3(.3f, 3f, .5f) }; Root.AppendChild(Head); Root.AppendChild(LeftArm); Root.AppendChild(LeftLeg); RightArm = LeftArm.Mirror(); RightLeg = LeftLeg.Mirror(); }
public HumanNode Mirror() { var mirror = new HumanNode(Diffuse.ToVector3()) { Scale = this.Scale, Position = new Vector3(-this.Position.X, this.Position.Y, this.Position.Z) }; this.Parent.AppendChild(mirror); return(mirror); }
public void AppendChild(HumanNode child) { Debug.Assert(child.Parent == null); Children.Add(child); child.Parent = this; }