public void Start()
 {
     impressionMemory = (ImpressionMemory)GetComponent("ImpressionMemory");
     actionRunner = (ActionRunner)GetComponent("ActionRunner");
     neck = (Neck)GetComponentInChildren(typeof(Neck));
     enabled=false;
 }
Exemple #2
0
 public void CreateEffects(IEquipmentEffectFactory equipmentEffectFactory)
 {
     Head?.CreateEffect(equipmentEffectFactory);
     Body?.CreateEffect(equipmentEffectFactory);
     Boots?.CreateEffect(equipmentEffectFactory);
     Gloves?.CreateEffect(equipmentEffectFactory);
     LeftHand?.CreateEffect(equipmentEffectFactory);
     RightHand?.CreateEffect(equipmentEffectFactory);
     Neck?.CreateEffect(equipmentEffectFactory);
     LeftRing?.CreateEffect(equipmentEffectFactory);
     RightRing?.CreateEffect(equipmentEffectFactory);
 }
Exemple #3
0
    public void GenerateNeck(Skin.SkinTint skinTint)
    {
        if (neckDictionary.Count <= 0)
        {
            return;
        }

        ClearNeckInstance();

        string neckKey = GenerateNeckKey(skinTint);
        Neck   neck    = neckDictionary[neckKey];

        _neckInstance      = Instantiate(_neckPrefab, neck.NeckPosition, Quaternion.identity);
        _neckInstance.name = neckKey;
        _neckInstance.GetComponent <SpriteRenderer>().sprite = neck.NeckSprite;
    }
Exemple #4
0
        public Skeleton ToNetworkModel()
        {
            Skeleton s = new Skeleton();

            s.UserId        = UserId;
            s.BodyLocation  = BodyLocation.ToCoord();
            s.BodyRotation  = BodyRotation.ToCoord();
            s.Head          = Head.ToCoord();
            s.Neck          = Neck.ToCoord();
            s.Spine         = Spine.ToCoord();
            s.Hips          = Hips.ToCoord();
            s.LeftShoulder  = LeftShoulder.ToCoord();
            s.LeftArm       = LeftArm.ToCoord();
            s.LeftHand      = LeftHand.ToCoord();
            s.RightShoulder = RightShoulder.ToCoord();
            s.RightArm      = RightArm.ToCoord();
            s.RightHand     = RightHand.ToCoord();
            s.LeftKnee      = LeftKnee.ToCoord();
            s.LeftFoot      = LeftFoot.ToCoord();
            s.RightKnee     = RightKnee.ToCoord();
            s.RightFoot     = RightFoot.ToCoord();
            return(s);
        }
Exemple #5
0
        public Biped(World w, Vec2 position)
        {
            _world = w;

            BipedDef def = new BipedDef();
            BodyDef  bd  = new BodyDef();

            // create body parts
            bd           = def.LFootDef;
            bd.Position += position;
            LFoot        = w.CreateBody(bd);
            LFoot.CreateShape(def.LFootPoly);
            LFoot.SetMassFromShapes();

            bd           = def.RFootDef;
            bd.Position += position;
            RFoot        = w.CreateBody(bd);
            RFoot.CreateShape(def.RFootPoly);
            RFoot.SetMassFromShapes();

            bd           = def.LCalfDef;
            bd.Position += position;
            LCalf        = w.CreateBody(bd);
            LCalf.CreateShape(def.LCalfPoly);
            LCalf.SetMassFromShapes();

            bd           = def.RCalfDef;
            bd.Position += position;
            RCalf        = w.CreateBody(bd);
            RCalf.CreateShape(def.RCalfPoly);
            RCalf.SetMassFromShapes();

            bd           = def.LThighDef;
            bd.Position += position;
            LThigh       = w.CreateBody(bd);
            LThigh.CreateShape(def.LThighPoly);
            LThigh.SetMassFromShapes();

            bd           = def.RThighDef;
            bd.Position += position;
            RThigh       = w.CreateBody(bd);
            RThigh.CreateShape(def.RThighPoly);
            RThigh.SetMassFromShapes();

            bd           = def.PelvisDef0;
            bd.Position += position;
            Pelvis       = w.CreateBody(bd);
            Pelvis.CreateShape(def.PelvisPoly);
            Pelvis.SetMassFromShapes();

            bd           = def.PelvisDef;
            bd.Position += position;
            Stomach      = w.CreateBody(bd);
            Stomach.CreateShape(def.StomachPoly);
            Stomach.SetMassFromShapes();

            bd           = def.ChestDef;
            bd.Position += position;
            Chest        = w.CreateBody(bd);
            Chest.CreateShape(def.ChestPoly);
            Chest.SetMassFromShapes();

            bd           = def.NeckDef;
            bd.Position += position;
            Neck         = w.CreateBody(bd);
            Neck.CreateShape(def.NeckPoly);
            Neck.SetMassFromShapes();

            bd           = def.HeadDef;
            bd.Position += position;
            Head         = w.CreateBody(bd);
            Head.CreateShape(def.HeadCirc);
            Head.SetMassFromShapes();

            bd           = def.LUpperArmDef;
            bd.Position += position;
            LUpperArm    = w.CreateBody(bd);
            LUpperArm.CreateShape(def.LUpperArmPoly);
            LUpperArm.SetMassFromShapes();

            bd           = def.RUpperArmDef;
            bd.Position += position;
            RUpperArm    = w.CreateBody(bd);
            RUpperArm.CreateShape(def.RUpperArmPoly);
            RUpperArm.SetMassFromShapes();

            bd           = def.LForearmDef;
            bd.Position += position;
            LForearm     = w.CreateBody(bd);
            LForearm.CreateShape(def.LForearmPoly);
            LForearm.SetMassFromShapes();

            bd           = def.RForearmDef;
            bd.Position += position;
            RForearm     = w.CreateBody(bd);
            RForearm.CreateShape(def.RForearmPoly);
            RForearm.SetMassFromShapes();

            bd           = def.LHandDef;
            bd.Position += position;
            LHand        = w.CreateBody(bd);
            LHand.CreateShape(def.LHandPoly);
            LHand.SetMassFromShapes();

            bd           = def.RHandDef;
            bd.Position += position;
            RHand        = w.CreateBody(bd);
            RHand.CreateShape(def.RHandPoly);
            RHand.SetMassFromShapes();

            // link body parts
            def.LAnkleDef.Body1    = LFoot;
            def.LAnkleDef.Body2    = LCalf;
            def.RAnkleDef.Body1    = RFoot;
            def.RAnkleDef.Body2    = RCalf;
            def.LKneeDef.Body1     = LCalf;
            def.LKneeDef.Body2     = LThigh;
            def.RKneeDef.Body1     = RCalf;
            def.RKneeDef.Body2     = RThigh;
            def.LHipDef.Body1      = LThigh;
            def.LHipDef.Body2      = Pelvis;
            def.RHipDef.Body1      = RThigh;
            def.RHipDef.Body2      = Pelvis;
            def.LowerAbsDef.Body1  = Pelvis;
            def.LowerAbsDef.Body2  = Stomach;
            def.UpperAbsDef.Body1  = Stomach;
            def.UpperAbsDef.Body2  = Chest;
            def.LowerNeckDef.Body1 = Chest;
            def.LowerNeckDef.Body2 = Neck;
            def.UpperNeckDef.Body1 = Chest;
            def.UpperNeckDef.Body2 = Head;
            def.LShoulderDef.Body1 = Chest;
            def.LShoulderDef.Body2 = LUpperArm;
            def.RShoulderDef.Body1 = Chest;
            def.RShoulderDef.Body2 = RUpperArm;
            def.LElbowDef.Body1    = LForearm;
            def.LElbowDef.Body2    = LUpperArm;
            def.RElbowDef.Body1    = RForearm;
            def.RElbowDef.Body2    = RUpperArm;
            def.LWristDef.Body1    = LHand;
            def.LWristDef.Body2    = LForearm;
            def.RWristDef.Body1    = RHand;
            def.RWristDef.Body2    = RForearm;

            // create joints
            LAnkle    = (RevoluteJoint)w.CreateJoint(def.LAnkleDef);
            RAnkle    = (RevoluteJoint)w.CreateJoint(def.RAnkleDef);
            LKnee     = (RevoluteJoint)w.CreateJoint(def.LKneeDef);
            RKnee     = (RevoluteJoint)w.CreateJoint(def.RKneeDef);
            LHip      = (RevoluteJoint)w.CreateJoint(def.LHipDef);
            RHip      = (RevoluteJoint)w.CreateJoint(def.RHipDef);
            LowerAbs  = (RevoluteJoint)w.CreateJoint(def.LowerAbsDef);
            UpperAbs  = (RevoluteJoint)w.CreateJoint(def.UpperAbsDef);
            LowerNeck = (RevoluteJoint)w.CreateJoint(def.LowerNeckDef);
            UpperNeck = (RevoluteJoint)w.CreateJoint(def.UpperNeckDef);
            LShoulder = (RevoluteJoint)w.CreateJoint(def.LShoulderDef);
            RShoulder = (RevoluteJoint)w.CreateJoint(def.RShoulderDef);
            LElbow    = (RevoluteJoint)w.CreateJoint(def.LElbowDef);
            RElbow    = (RevoluteJoint)w.CreateJoint(def.RElbowDef);
            LWrist    = (RevoluteJoint)w.CreateJoint(def.LWristDef);
            RWrist    = (RevoluteJoint)w.CreateJoint(def.RWristDef);
        }
 public void MergeFrom(Human other)
 {
     if (other == null)
     {
         return;
     }
     if (other.nose_ != null)
     {
         if (nose_ == null)
         {
             nose_ = new global::Joint();
         }
         Nose.MergeFrom(other.Nose);
     }
     if (other.neck_ != null)
     {
         if (neck_ == null)
         {
             neck_ = new global::Joint();
         }
         Neck.MergeFrom(other.Neck);
     }
     if (other.rShoulder_ != null)
     {
         if (rShoulder_ == null)
         {
             rShoulder_ = new global::Joint();
         }
         RShoulder.MergeFrom(other.RShoulder);
     }
     if (other.rElbow_ != null)
     {
         if (rElbow_ == null)
         {
             rElbow_ = new global::Joint();
         }
         RElbow.MergeFrom(other.RElbow);
     }
     if (other.rWrist_ != null)
     {
         if (rWrist_ == null)
         {
             rWrist_ = new global::Joint();
         }
         RWrist.MergeFrom(other.RWrist);
     }
     if (other.lShoulder_ != null)
     {
         if (lShoulder_ == null)
         {
             lShoulder_ = new global::Joint();
         }
         LShoulder.MergeFrom(other.LShoulder);
     }
     if (other.lElbow_ != null)
     {
         if (lElbow_ == null)
         {
             lElbow_ = new global::Joint();
         }
         LElbow.MergeFrom(other.LElbow);
     }
     if (other.lWrist_ != null)
     {
         if (lWrist_ == null)
         {
             lWrist_ = new global::Joint();
         }
         LWrist.MergeFrom(other.LWrist);
     }
     if (other.rHip_ != null)
     {
         if (rHip_ == null)
         {
             rHip_ = new global::Joint();
         }
         RHip.MergeFrom(other.RHip);
     }
     if (other.rKnee_ != null)
     {
         if (rKnee_ == null)
         {
             rKnee_ = new global::Joint();
         }
         RKnee.MergeFrom(other.RKnee);
     }
     if (other.rAnkle_ != null)
     {
         if (rAnkle_ == null)
         {
             rAnkle_ = new global::Joint();
         }
         RAnkle.MergeFrom(other.RAnkle);
     }
     if (other.lHip_ != null)
     {
         if (lHip_ == null)
         {
             lHip_ = new global::Joint();
         }
         LHip.MergeFrom(other.LHip);
     }
     if (other.lKnee_ != null)
     {
         if (lKnee_ == null)
         {
             lKnee_ = new global::Joint();
         }
         LKnee.MergeFrom(other.LKnee);
     }
     if (other.lAnkle_ != null)
     {
         if (lAnkle_ == null)
         {
             lAnkle_ = new global::Joint();
         }
         LAnkle.MergeFrom(other.LAnkle);
     }
     if (other.rEye_ != null)
     {
         if (rEye_ == null)
         {
             rEye_ = new global::Joint();
         }
         REye.MergeFrom(other.REye);
     }
     if (other.lEye_ != null)
     {
         if (lEye_ == null)
         {
             lEye_ = new global::Joint();
         }
         LEye.MergeFrom(other.LEye);
     }
     if (other.rEar_ != null)
     {
         if (rEar_ == null)
         {
             rEar_ = new global::Joint();
         }
         REar.MergeFrom(other.REar);
     }
     if (other.lEar_ != null)
     {
         if (lEar_ == null)
         {
             lEar_ = new global::Joint();
         }
         LEar.MergeFrom(other.LEar);
     }
     if (other.Confidence != 0F)
     {
         Confidence = other.Confidence;
     }
 }
    public override int GetHashCode()
    {
        int hash = 1;

        if (nose_ != null)
        {
            hash ^= Nose.GetHashCode();
        }
        if (neck_ != null)
        {
            hash ^= Neck.GetHashCode();
        }
        if (rShoulder_ != null)
        {
            hash ^= RShoulder.GetHashCode();
        }
        if (rElbow_ != null)
        {
            hash ^= RElbow.GetHashCode();
        }
        if (rWrist_ != null)
        {
            hash ^= RWrist.GetHashCode();
        }
        if (lShoulder_ != null)
        {
            hash ^= LShoulder.GetHashCode();
        }
        if (lElbow_ != null)
        {
            hash ^= LElbow.GetHashCode();
        }
        if (lWrist_ != null)
        {
            hash ^= LWrist.GetHashCode();
        }
        if (rHip_ != null)
        {
            hash ^= RHip.GetHashCode();
        }
        if (rKnee_ != null)
        {
            hash ^= RKnee.GetHashCode();
        }
        if (rAnkle_ != null)
        {
            hash ^= RAnkle.GetHashCode();
        }
        if (lHip_ != null)
        {
            hash ^= LHip.GetHashCode();
        }
        if (lKnee_ != null)
        {
            hash ^= LKnee.GetHashCode();
        }
        if (lAnkle_ != null)
        {
            hash ^= LAnkle.GetHashCode();
        }
        if (rEye_ != null)
        {
            hash ^= REye.GetHashCode();
        }
        if (lEye_ != null)
        {
            hash ^= LEye.GetHashCode();
        }
        if (rEar_ != null)
        {
            hash ^= REar.GetHashCode();
        }
        if (lEar_ != null)
        {
            hash ^= LEar.GetHashCode();
        }
        if (Confidence != 0F)
        {
            hash ^= Confidence.GetHashCode();
        }
        return(hash);
    }
Exemple #8
0
 public void MergeFrom(Skeleton other)
 {
     if (other == null)
     {
         return;
     }
     if (other.UserId != 0UL)
     {
         UserId = other.UserId;
     }
     if (other.bodyLocation_ != null)
     {
         if (bodyLocation_ == null)
         {
             bodyLocation_ = new global::VrLifeShared.Networking.NetworkingModels.Coord();
         }
         BodyLocation.MergeFrom(other.BodyLocation);
     }
     if (other.bodyRotation_ != null)
     {
         if (bodyRotation_ == null)
         {
             bodyRotation_ = new global::VrLifeShared.Networking.NetworkingModels.Coord();
         }
         BodyRotation.MergeFrom(other.BodyRotation);
     }
     if (other.head_ != null)
     {
         if (head_ == null)
         {
             head_ = new global::VrLifeShared.Networking.NetworkingModels.Coord();
         }
         Head.MergeFrom(other.Head);
     }
     if (other.neck_ != null)
     {
         if (neck_ == null)
         {
             neck_ = new global::VrLifeShared.Networking.NetworkingModels.Coord();
         }
         Neck.MergeFrom(other.Neck);
     }
     if (other.spine_ != null)
     {
         if (spine_ == null)
         {
             spine_ = new global::VrLifeShared.Networking.NetworkingModels.Coord();
         }
         Spine.MergeFrom(other.Spine);
     }
     if (other.hips_ != null)
     {
         if (hips_ == null)
         {
             hips_ = new global::VrLifeShared.Networking.NetworkingModels.Coord();
         }
         Hips.MergeFrom(other.Hips);
     }
     if (other.leftShoulder_ != null)
     {
         if (leftShoulder_ == null)
         {
             leftShoulder_ = new global::VrLifeShared.Networking.NetworkingModels.Coord();
         }
         LeftShoulder.MergeFrom(other.LeftShoulder);
     }
     if (other.leftArm_ != null)
     {
         if (leftArm_ == null)
         {
             leftArm_ = new global::VrLifeShared.Networking.NetworkingModels.Coord();
         }
         LeftArm.MergeFrom(other.LeftArm);
     }
     if (other.leftHand_ != null)
     {
         if (leftHand_ == null)
         {
             leftHand_ = new global::VrLifeShared.Networking.NetworkingModels.Coord();
         }
         LeftHand.MergeFrom(other.LeftHand);
     }
     if (other.rightShoulder_ != null)
     {
         if (rightShoulder_ == null)
         {
             rightShoulder_ = new global::VrLifeShared.Networking.NetworkingModels.Coord();
         }
         RightShoulder.MergeFrom(other.RightShoulder);
     }
     if (other.rightArm_ != null)
     {
         if (rightArm_ == null)
         {
             rightArm_ = new global::VrLifeShared.Networking.NetworkingModels.Coord();
         }
         RightArm.MergeFrom(other.RightArm);
     }
     if (other.rightHand_ != null)
     {
         if (rightHand_ == null)
         {
             rightHand_ = new global::VrLifeShared.Networking.NetworkingModels.Coord();
         }
         RightHand.MergeFrom(other.RightHand);
     }
     if (other.leftKnee_ != null)
     {
         if (leftKnee_ == null)
         {
             leftKnee_ = new global::VrLifeShared.Networking.NetworkingModels.Coord();
         }
         LeftKnee.MergeFrom(other.LeftKnee);
     }
     if (other.leftFoot_ != null)
     {
         if (leftFoot_ == null)
         {
             leftFoot_ = new global::VrLifeShared.Networking.NetworkingModels.Coord();
         }
         LeftFoot.MergeFrom(other.LeftFoot);
     }
     if (other.rightKnee_ != null)
     {
         if (rightKnee_ == null)
         {
             rightKnee_ = new global::VrLifeShared.Networking.NetworkingModels.Coord();
         }
         RightKnee.MergeFrom(other.RightKnee);
     }
     if (other.rightFoot_ != null)
     {
         if (rightFoot_ == null)
         {
             rightFoot_ = new global::VrLifeShared.Networking.NetworkingModels.Coord();
         }
         RightFoot.MergeFrom(other.RightFoot);
     }
 }
Exemple #9
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (UserId != 0UL)
            {
                hash ^= UserId.GetHashCode();
            }
            if (bodyLocation_ != null)
            {
                hash ^= BodyLocation.GetHashCode();
            }
            if (bodyRotation_ != null)
            {
                hash ^= BodyRotation.GetHashCode();
            }
            if (head_ != null)
            {
                hash ^= Head.GetHashCode();
            }
            if (neck_ != null)
            {
                hash ^= Neck.GetHashCode();
            }
            if (spine_ != null)
            {
                hash ^= Spine.GetHashCode();
            }
            if (hips_ != null)
            {
                hash ^= Hips.GetHashCode();
            }
            if (leftShoulder_ != null)
            {
                hash ^= LeftShoulder.GetHashCode();
            }
            if (leftArm_ != null)
            {
                hash ^= LeftArm.GetHashCode();
            }
            if (leftHand_ != null)
            {
                hash ^= LeftHand.GetHashCode();
            }
            if (rightShoulder_ != null)
            {
                hash ^= RightShoulder.GetHashCode();
            }
            if (rightArm_ != null)
            {
                hash ^= RightArm.GetHashCode();
            }
            if (rightHand_ != null)
            {
                hash ^= RightHand.GetHashCode();
            }
            if (leftKnee_ != null)
            {
                hash ^= LeftKnee.GetHashCode();
            }
            if (leftFoot_ != null)
            {
                hash ^= LeftFoot.GetHashCode();
            }
            if (rightKnee_ != null)
            {
                hash ^= RightKnee.GetHashCode();
            }
            if (rightFoot_ != null)
            {
                hash ^= RightFoot.GetHashCode();
            }
            return(hash);
        }
 public void setHero_Neck(Neck hero_Neck)
 {
     this.hero_Neck = hero_Neck;
 }
Exemple #11
0
 void Awake()
 {
     Instance = this;
 }
 public void Start()
 {
     modelAnimation = FindChild(transform, name + " Model").animation;
     neck = GetComponentInChildren(typeof(Neck)) as Neck;
     state = GetComponent(typeof(CharacterState)) as CharacterState;
 }