public void AddChild(LLJoint joint) { joint.Parent?.RemoveChild(joint); Children.Add(joint); //joint.Xform.setParent(Xform); joint.Parent = this; joint.Touch(); }
/// <summary> /// TODO: Only used for LLVOAvatarSelf::mScreenp. *DOES NOT INITIALIZE mResetAfterRestoreOldXform /// </summary> /// <param name="name"></param> /// <param name="parent"></param> public LLJoint(string name, LLJoint parent) { JointNum = -2; Init(); UpdateXform = false; Name = name; parent?.AddChild(this); Touch(); }
public void RemoveChild(LLJoint joint) { if (Children.Contains(joint) == false) { return; } Children.Remove(joint); //joint.Xform.setParent(null); joint.Parent = null; joint.Touch(); }
/// <summary> /// Recursively searches for a child joint by name /// </summary> /// <param name="name"></param> /// <returns>The found joint or null if none is found</returns> public LLJoint FindJoint(string name) { if (name == Name) { return(this); } foreach (LLJoint child in Children) { LLJoint found = child.FindJoint(name); if (found != null) { return(found); } } return(null); }
/// <summary> /// get the specified joint default implementation does /// recursive search, subclasses may optimize/cache results. /// </summary> /// <param name="name"></param> /// <returns></returns> public virtual LLJoint GetJoint(string name) { LLJoint joint = null; LLJoint root = GetRootJoint(); if (root != null) { joint = root.FindJoint(name); } if (joint == null) { Logger.LogWarning("Character.GetJoint", $"Failed to find joint.({name})"); } return(joint); }
public void ShowJointScaleOverrides(LLJoint joint, string note, string avInfo) { Logger.LogDebug("LLJoint.ShowJointScaleOverrides", $"Avatar {avInfo} joint {joint.Name} {note} {joint.ScaleBeforeOverrides} {joint.AttachmentScaleOverrides.ShowJointVector3Overrides()}"); }
/// <summary> /// set name and parent /// </summary> /// <param name="name"></param> /// <param name="parent"></param> public void Setup(string name, LLJoint parent = null) { Name = name; parent?.AddChild(this); }