Esempio n. 1
0
        public void AddChild(LLJoint joint)
        {
            joint.Parent?.RemoveChild(joint);

            Children.Add(joint);
            //joint.Xform.setParent(Xform);
            joint.Parent = this;
            joint.Touch();
        }
Esempio n. 2
0
 /// <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();
 }
Esempio n. 3
0
        public void RemoveChild(LLJoint joint)
        {
            if (Children.Contains(joint) == false)
            {
                return;
            }

            Children.Remove(joint);
            //joint.Xform.setParent(null);
            joint.Parent = null;
            joint.Touch();
        }
Esempio n. 4
0
        /// <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);
        }
Esempio n. 5
0
        /// <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);
        }
Esempio n. 6
0
 public void ShowJointScaleOverrides(LLJoint joint, string note, string avInfo)
 {
     Logger.LogDebug("LLJoint.ShowJointScaleOverrides", $"Avatar {avInfo} joint {joint.Name} {note} {joint.ScaleBeforeOverrides} {joint.AttachmentScaleOverrides.ShowJointVector3Overrides()}");
 }
Esempio n. 7
0
 /// <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);
 }