Exemple #1
0
        private void CreateAndStartArcBallCamera()
        {
            BaseEntity entity;

            if (entities.TryGetValue(this.controlledEntity, out entity))
            {
                MsgSetParent msgSetParent = ObjectPool.Aquire <MsgSetParent>();
                msgSetParent.ParentEntity = entity;
                msgSetParent.UniqueTarget = this.sceneMgrRootEntity.UniqueID;
                this.Game.SendMessage(msgSetParent);
            }

            if (currentCameraInputType != null)
            {
                if (currentCameraInputType is ArcBallCameraInputComponent)
                {
                    return;
                }

                this.sceneMgrRootEntity.RemoveComponent(currentCameraInputType);
            }

            ArcBallCameraInputComponent arcBallCam = new ArcBallCameraInputComponent(this.sceneMgrRootEntity);

            currentCameraInputType = arcBallCam;

            arcBallCam.TargetPosition    = new Vector3(950, 400, 950);
            arcBallCam.LookAheadDistance = 10.0f;
            arcBallCam.LookAboveDistance = 5.0f;
            arcBallCam.HorizontalAngle   = -1.3f;
            arcBallCam.VerticalAngle     = 1.2f;
        }
Exemple #2
0
        private void CreateAndStartFreeMovingCamera()
        {
            if (currentCameraInputType != null)
            {
                if (currentCameraInputType is FreeCameraInputComponent)
                {
                    return;
                }

                this.sceneMgrRootEntity.RemoveComponent(currentCameraInputType);

                currentCameraInputType = null;
            }

            currentCameraInputType = new FreeCameraInputComponent(this.sceneMgrRootEntity);

            // Set a new render camera
            MsgSetRenderEntity camSetRenderMsg = ObjectPool.Aquire <MsgSetRenderEntity>();

            camSetRenderMsg.Entity = this.sceneMgrRootEntity;
            this.Game.SendInterfaceMessage(camSetRenderMsg, InterfaceType.Camera);
        }