public BoneViewModel(RigEditorViewModel rig, IHaveBones parent, RigResource.RigResource.Bone bone, BoneManager manager) { if (rig == null) { throw new ArgumentNullException("rig"); } if (bone == null) { throw new ArgumentNullException("bone"); } if (manager == null) { throw new ArgumentNullException("manager"); } mRig = rig; mChildren = new ObservableCollection <BoneViewModel>(); mParent = parent; mBone = bone; mManager = manager; foreach (RigResource.RigResource.Bone b in manager.GetChildren(mBone)) { mChildren.Add(new BoneViewModel(mRig, this, b, mManager)); } mRotation = new EulerAngle(new Quaternion(bone.Orientation.A, bone.Orientation.B, bone.Orientation.C, bone.Orientation.D)); manager.BoneAdded += OnBoneAdded; manager.BoneRemoved += OnBoneRemoved; manager.BoneParentChanged += OnBoneParentChanged; mSetOppositeCommand = new UserCommand <BoneViewModel>(x => true, ExecuteSetOpposite); }
public BoneViewModel(RigEditorViewModel rig, IHaveBones parent, RigResource.RigResource.Bone bone, BoneManager manager) { if (rig == null) throw new ArgumentNullException("rig"); if (bone == null) throw new ArgumentNullException("bone"); if (manager == null) throw new ArgumentNullException("manager"); mRig = rig; mChildren = new ObservableCollection<BoneViewModel>(); mParent = parent; mBone = bone; mManager = manager; foreach (RigResource.RigResource.Bone b in manager.GetChildren(mBone)) { mChildren.Add(new BoneViewModel(mRig, this, b, mManager)); } mRotation = new EulerAngle(new Quaternion(bone.Orientation.A, bone.Orientation.B, bone.Orientation.C, bone.Orientation.D)); manager.BoneAdded += OnBoneAdded; manager.BoneRemoved += OnBoneRemoved; manager.BoneParentChanged += OnBoneParentChanged; mSetOppositeCommand = new UserCommand<BoneViewModel>(x => true, ExecuteSetOpposite); }