Ejemplo n.º 1
0
        private void InitializeRigging()
        {
            Vector3 CamPoleLocation        = new Vector3(1, 0, 0);
            Vector3 CamPoleScaleCorrection = new Vector3(.75f, .5f, .75f);

            Vector3 CamArmAPointOfRotationFromPole = new Vector3(0, 1, 0);
            Vector3 CamArmAOriginCorrection        = new Vector3(0, 0, -.1f);

            Vector3 CamArmBPointOfRotationFromArmA = new Vector3(.07f, .07f, -.19f);
            Vector3 CamArmBOriginCorrection        = new Vector3(0, 0, -.1f);
            Vector3 CamArmBOrientCorrection        = new Vector3(0, 0, -(float)Math.PI / 2.0f);

            Vector3 CamBoxPointOfRotationFromArmB = new Vector3(0, 0, 0);
            Matrix  CamBoxRotation = Matrix.CreateFromQuaternion(Quaternion.CreateFromYawPitchRoll(0, 0, 0));
            //Matrix CamBoxOrientCorrection = Matrix.CreateFromQuaternion(Quaternion.CreateFromYawPitchRoll(0, (float)Math.PI, -(float)Math.PI / 2.0f));
            Vector3 CamBoxOrientCorrection = new Vector3(0, (float)Math.PI, 0);
            Vector3 CamBoxOriginCorrection = new Vector3(0, 0, .13f);

            //Vector3 LaserBoxRelativeToCam = new Vector3(-.47f, -.1f, .06f);
            Vector3 LaserBoxRelativeToCam = new Vector3(-.35f, .1f, -.26f); //X:-0.35 Y:0.1 Z:-0.26
            Vector3 LaserScaleCorrection  = new Vector3(.05f, .05f, .1f);

            EntityPart CameraPole = EntityPart.GetPart((int)RigParts.CameraPole, Pole, CamPoleScaleCorrection, Vector3.Zero, CamPoleLocation, Vector3.Zero, Vector3.Zero);

            EntityPart CameraArmA = EntityPart.GetPart((int)RigParts.CameraArmA, Arm, 1.4f, Vector3.Zero, CamArmAPointOfRotationFromPole, Vector3.Zero, CamArmAOriginCorrection);

            CameraArmA.AdjustYawPitchRoll(rotCamYaw, 0, 0);

            EntityPart CameraArmB = EntityPart.GetPart((int)RigParts.CameraArmB, Arm, 1.4f, Vector3.Zero, CamArmBPointOfRotationFromArmA, CamArmBOrientCorrection, CamArmBOriginCorrection);

            CameraArmB.AdjustYawPitchRoll(0, rotCamPitch, 0);

            EntityPart CameraBox = EntityPart.GetPart((int)RigParts.CameraBox, Cam, Vector3.Zero, CamBoxPointOfRotationFromArmB, CamBoxOrientCorrection, CamBoxOriginCorrection);

            EntityPart LaserBox = EntityPart.GetPart((int)RigParts.LaserBox, Laser, LaserScaleCorrection, Vector3.Zero, LaserBoxRelativeToCam, Vector3.Zero, Vector3.Zero);

            rig.AddPart(-1, CameraPole);
            rig.AddPart((int)RigParts.CameraPole, CameraArmA);
            rig.AddPart((int)RigParts.CameraArmA, CameraArmB);
            rig.AddPart((int)RigParts.CameraArmB, CameraBox);
            rig.AddPart((int)RigParts.CameraBox, LaserBox);
        }