public override void EnterState()
        {
            //Console.WriteLine("GreenScreenRoomDefaultCameraState.EnterState");
            AvatarEntity localAvatar = GameFacade.Instance.RetrieveMediator <AvatarMediator>().LocalAvatarEntity;

            //TODO: Get rid of these hardcoded values, have them be set up by the room object or the avatar object.
            Vector3 position = new Vector3(0.0f, 2.35f, 6.15f);
            Vector3 scale    = new Vector3(2.0f, 0.4f, 0.5f);

            mBoxContainer = new BoxContainer(position, scale);

            mFixedAngleFollowView = new FixedAngleFollowView(mCameraTargetTransform, localAvatar.UnityGameObject.transform, new Vector3(0.0f, 180.0f, 0.0f), mBoxContainer);
            mFixedAngleFollowView.TargetOffset      = AVATAR_TRANSFORM_OFFSET;
            mFixedAngleFollowView.minFollowDistance = 1.0f;

            mFixedAngleFollowView.StartTracking();
        }
Esempio n. 2
0
        private void BuildCameraViews()
        {
            mCameraViews = new List <KeyValuePair <View, float> >();

            Transform cameraTransform = GameFacade.Instance.RetrieveMediator <FashionCameraMediator>().Camera.gameObject.transform;

            mSmoothDampTransform = new SmoothDampTransform(cameraTransform, 1.0f, 1.0f);

            GameObject cameraTransform1  = new GameObject("cameraTransform");
            GameObject cameraTransform2  = new GameObject("cameraTransform");
            GameObject cameraTransform3  = new GameObject("cameraTransform");
            GameObject cameraTransform4  = new GameObject("cameraTransform");
            GameObject cameraTransform5  = new GameObject("cameraTransform");
            GameObject cameraTransform6  = new GameObject("cameraTransform");
            GameObject cameraTransform7  = new GameObject("cameraTransform");
            GameObject cameraTransform8  = new GameObject("cameraTransform");
            GameObject cameraTransform9  = new GameObject("cameraTransform");
            GameObject cameraTransform10 = new GameObject("cameraTransform");

            mCameraTransforms.Add(cameraTransform1);
            mCameraTransforms.Add(cameraTransform2);
            mCameraTransforms.Add(cameraTransform3);
            mCameraTransforms.Add(cameraTransform4);
            mCameraTransforms.Add(cameraTransform5);
            mCameraTransforms.Add(cameraTransform6);
            mCameraTransforms.Add(cameraTransform7);
            mCameraTransforms.Add(cameraTransform8);
            mCameraTransforms.Add(cameraTransform9);
            mCameraTransforms.Add(cameraTransform10);

            LookAtView lookAtView = new LookAtView(cameraTransform1.transform, cameraTransform, new Vector3(10.7f, 4.8f, 10.5f), null);

            lookAtView.SnapToView             = true;
            lookAtView.TranslateLag           = 1.0f;
            lookAtView.RotateLag              = 1.0f;
            lookAtView.TargetOffset           = new Vector3(0.0f, 0.8f, -0.5f);
            lookAtView.offsetRelativeToTarget = false;
            lookAtView.FieldOfView            = 30;
            lookAtView.StartTracking();
            mCameraViews.Add(new KeyValuePair <View, float>(lookAtView, mRunwayWalkClip.length * 0.25f * 2));

            FixedAngleFollowView fixedAngleFollowView = new FixedAngleFollowView(cameraTransform2.transform, cameraTransform, new Vector3(-4.0f, 240.0f, 0.0f), null);

            fixedAngleFollowView.SnapToView             = true;
            fixedAngleFollowView.TranslateLag           = 0.25f;
            fixedAngleFollowView.RotateLag              = 1.0f;
            fixedAngleFollowView.TargetOffset           = new Vector3(0.0f, -0.3f, 0.3f);
            fixedAngleFollowView.offsetRelativeToTarget = false;
            fixedAngleFollowView.RelativeToTarget       = false;
            fixedAngleFollowView.FieldOfView            = 24;
            fixedAngleFollowView.StartTracking();
            mCameraViews.Add(new KeyValuePair <View, float>(fixedAngleFollowView, mRunwayWalkClip.length * 0.22f * 2));

            lookAtView                        = new LookAtView(cameraTransform3.transform, cameraTransform, new Vector3(4.7f, 1.9f, 22.0f), null);
            lookAtView.SnapToView             = true;
            lookAtView.TranslateLag           = 1.0f;
            lookAtView.RotateLag              = 0.5f;
            lookAtView.TargetOffset           = new Vector3(0.0f, -0.25f, 0.0f);
            lookAtView.offsetRelativeToTarget = false;
            lookAtView.FieldOfView            = 3;
            lookAtView.StartTracking();
            mCameraViews.Add(new KeyValuePair <View, float>(lookAtView, mRunwayWalkClip.length * 0.16f * 2));

            lookAtView                        = new LookAtView(cameraTransform4.transform, cameraTransform, new Vector3(3.1f, 2.7f, 9.6f), null);
            lookAtView.SnapToView             = true;
            lookAtView.TranslateLag           = 1.1f;
            lookAtView.RotateLag              = 1.0f;
            lookAtView.TargetOffset           = new Vector3(0.0f, -0.3f, 0.0f);
            lookAtView.offsetRelativeToTarget = false;
            lookAtView.FieldOfView            = 20;
            lookAtView.StartTracking();
            mCameraViews.Add(new KeyValuePair <View, float>(lookAtView, mRunwayWalkClip.length * 0.12f * 2));

            fixedAngleFollowView                        = new FixedAngleFollowView(cameraTransform5.transform, cameraTransform, new Vector3(25.0f, 180.0f, 0.0f), null);
            fixedAngleFollowView.SnapToView             = true;
            fixedAngleFollowView.TranslateLag           = 0.3f;
            fixedAngleFollowView.RotateLag              = 1.0f;
            fixedAngleFollowView.TargetOffset           = new Vector3(0.0f, 0.1f, 1.0f);
            fixedAngleFollowView.offsetRelativeToTarget = false;
            fixedAngleFollowView.RelativeToTarget       = false;
            fixedAngleFollowView.FieldOfView            = 15;
            fixedAngleFollowView.StartTracking();
            mCameraViews.Add(new KeyValuePair <View, float>(fixedAngleFollowView, mRunwayWalkClip.length * 0.25f * 2));

            lookAtView                        = new LookAtView(cameraTransform6.transform, cameraTransform, new Vector3(17.2f, 5.5f, 11.6f), null);
            lookAtView.SnapToView             = true;
            lookAtView.TranslateLag           = 2.0f;
            lookAtView.RotateLag              = 3.0f;
            lookAtView.TargetOffset           = new Vector3(0.0f, 2.0f, 1.0f);
            lookAtView.offsetRelativeToTarget = false;
            lookAtView.FieldOfView            = 30;
            lookAtView.StartTracking();
            mCameraViews.Add(new KeyValuePair <View, float>(lookAtView, mRunwayWalkClip.length * 0.25f * 2));

            fixedAngleFollowView                        = new FixedAngleFollowView(cameraTransform7.transform, cameraTransform, new Vector3(-4.0f, 200.0f, 0.0f), null);
            fixedAngleFollowView.SnapToView             = true;
            fixedAngleFollowView.TranslateLag           = 0.4f;
            fixedAngleFollowView.RotateLag              = 1.0f;
            fixedAngleFollowView.TargetOffset           = new Vector3(0.0f, -0.3f, 0.3f);
            fixedAngleFollowView.offsetRelativeToTarget = false;
            fixedAngleFollowView.RelativeToTarget       = false;
            fixedAngleFollowView.FieldOfView            = 30;
            fixedAngleFollowView.StartTracking();
            mCameraViews.Add(new KeyValuePair <View, float>(fixedAngleFollowView, mRunwayWalkClip.length * 0.22f * 2));

            lookAtView                        = new LookAtView(cameraTransform8.transform, cameraTransform, new Vector3(8.9f, 1.1f, 12.7f), null);
            lookAtView.SnapToView             = true;
            lookAtView.TranslateLag           = 1.0f;
            lookAtView.RotateLag              = 0.5f;
            lookAtView.TargetOffset           = new Vector3(0.0f, -0.3f, 0.0f);
            lookAtView.offsetRelativeToTarget = false;
            lookAtView.FieldOfView            = 6;
            lookAtView.StartTracking();
            mCameraViews.Add(new KeyValuePair <View, float>(lookAtView, mRunwayWalkClip.length * 0.16f * 2));

            lookAtView                        = new LookAtView(cameraTransform9.transform, cameraTransform, new Vector3(3.1f, 2.7f, 9.6f), null);
            lookAtView.SnapToView             = true;
            lookAtView.TranslateLag           = 1.1f;
            lookAtView.RotateLag              = 1.0f;
            lookAtView.TargetOffset           = new Vector3(0.0f, -0.5f, 0.0f);
            lookAtView.offsetRelativeToTarget = false;
            lookAtView.FieldOfView            = 20;
            lookAtView.StartTracking();
            mCameraViews.Add(new KeyValuePair <View, float>(lookAtView, mRunwayWalkClip.length * 0.12f * 2));

            fixedAngleFollowView                        = new FixedAngleFollowView(cameraTransform10.transform, cameraTransform, new Vector3(5.0f, 240.0f, 0.0f), null);
            fixedAngleFollowView.SnapToView             = true;
            fixedAngleFollowView.TranslateLag           = 0.5f;
            fixedAngleFollowView.RotateLag              = 1.0f;
            fixedAngleFollowView.TargetOffset           = new Vector3(0.0f, -0.5f, 0.4f);
            fixedAngleFollowView.offsetRelativeToTarget = false;
            fixedAngleFollowView.RelativeToTarget       = false;
            fixedAngleFollowView.FieldOfView            = 35;
            fixedAngleFollowView.StartTracking();
            mCameraViews.Add(new KeyValuePair <View, float>(fixedAngleFollowView, mRunwayWalkClip.length * 0.25f * 2));
        }