public void FreeTagPoint(TagPoint tagPoint) { if (this.tagPointList.ContainsValue(tagPoint)) { if (tagPoint.Parent != null) { tagPoint.Parent.RemoveChild(tagPoint); } } }
public TagPoint CreateTagPointOnBone(Bone bone, Quaternion offsetOrientation, Vector3 offsetPosition) { var tagPoint = new TagPoint(++this.nextTagPointAutoHandle, this); this.tagPointList[this.nextTagPointAutoHandle] = tagPoint; tagPoint.Translate(offsetPosition); tagPoint.Rotate(offsetOrientation); tagPoint.SetBindingPose(); bone.AddChild(tagPoint); return(tagPoint); }
/// <summary> /// Internal implementation of attaching a 'child' object to this entity and assign /// the parent node to the child entity. /// </summary> /// <param name="sceneObject">Object to attach.</param> /// <param name="tagPoint">TagPoint to attach the object to.</param> protected void AttachObjectImpl( MovableObject sceneObject, TagPoint tagPoint ) { this.childObjectList.Add( sceneObject.Name, sceneObject ); sceneObject.NotifyAttached( tagPoint, true ); }
public void FreeTagPoint( TagPoint tagPoint ) { if ( this.tagPointList.ContainsValue( tagPoint ) ) { if ( tagPoint.Parent != null ) { tagPoint.Parent.RemoveChild( tagPoint ); } } }
public TagPoint CreateTagPointOnBone( Bone bone, Quaternion offsetOrientation, Vector3 offsetPosition ) { var tagPoint = new TagPoint( ++this.nextTagPointAutoHandle, this ); this.tagPointList[ this.nextTagPointAutoHandle ] = tagPoint; tagPoint.Translate( offsetPosition ); tagPoint.Rotate( offsetOrientation ); tagPoint.SetBindingPose(); bone.AddChild( tagPoint ); return tagPoint; }
public void RemoveTagPointFromBone(Bone bone, TagPoint tagPoint) { bone.RemoveChild(tagPoint); tagPointList.Remove(tagPoint); }
public void DetachObjectFromBone(TagPoint tagPoint) { DetachObjectFromBone(tagPoint.Parent.Name, tagPoint); }
public void DetachObjectFromBone(string boneName, TagPoint tagPoint) { MovableObject sceneObject = tagPoint.ChildObject; if (!sceneObject.IsAttached) { throw new AxiomException("SceneObject '{0}' is not already attached", sceneObject.Name); } DetachNodeFromBone(boneName, tagPoint); DetachObjectImpl(sceneObject); }
public void DetachNodeFromBone(string boneName, TagPoint tagPoint) { if (!this.HasSkeleton) { throw new AxiomException("Entity '{0}' has no skeleton to attach an object to.", this.name); } Bone bone = skeletonInstance.GetBone(boneName); if (bone == null) { throw new AxiomException("Entity '{0}' does not have a skeleton with a bone named '{1}'.", this.name, boneName); } skeletonInstance.RemoveTagPointFromBone(bone, tagPoint); }
public void AttachObjectToTagPoint(TagPoint tagPoint, MovableObject sceneObject) { tagPoint.ChildObject = sceneObject; AttachObjectImpl(sceneObject, tagPoint); }
/// <summary> /// Internal implementation of attaching a 'child' object to this entity and assign /// the parent node to the child entity. /// </summary> /// <param name="sceneObject">Object to attach.</param> /// <param name="tagPoint">TagPoint to attach the object to.</param> protected void AttachObjectImpl(MovableObject sceneObject, TagPoint tagPoint) { childObjectList[sceneObject.Name] = sceneObject; sceneObject.NotifyAttached(tagPoint, true); }