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

            Children.Add(joint);
            //joint.Xform.setParent(Xform);
            joint.Parent = this;
            joint.Touch();
        }
Ejemplo 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();
 }
Ejemplo 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();
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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()}");
 }
Ejemplo 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);
 }