Ejemplo n.º 1
0
        private void RefreshModelTableau()
        {
            if (!this._initialized)
            {
                this.Initialize();
            }

            if (this._model != null)
            {
                this._model.Remove();
                this._model = (GameEntity)null;
            }


            var frame = MatrixFrame.Identity;

            this._model = GameEntity.Instantiate(this._tableauScene, _stringId, false);
            this._model.SetFrame(ref frame);
            foreach (var sc in _model.GetScriptComponents())
            {
                _model.RemoveScriptComponent(sc.ScriptComponent.RefPointer());
            }



            TableauView view = this.View;

            if ((NativeObject)view != (NativeObject)null)
            {
                float radius = (this._model.GetBoundingBoxMax() - this._model.GetBoundingBoxMin()).Length * 2f;
                Vec3  origin = this._model.GetGlobalFrame().origin;
                view.SetFocusedShadowmap(true, ref origin, radius);
            }

            this._initialFrame = this._model.GetFrame();
            Vec3 eulerAngles = this._initialFrame.rotation.GetEulerAngles();

            this._panRotation  = eulerAngles.x;
            this._tiltRotation = eulerAngles.z;
        }
Ejemplo n.º 2
0
        private void RefreshModelTableau()
        {
            if (!this._initialized)
            {
                this.Initialize();
            }


            TableauView view = this.View;

            if ((NativeObject)view != (NativeObject)null)
            {
                float radius = (this._model.GetBoundingBoxMax() - this._model.GetBoundingBoxMin()).Length * 2f;
                Vec3  origin = this._model.GetGlobalFrame().origin;
                view.SetFocusedShadowmap(true, ref origin, radius);
            }

            this._initialFrame = this._model.GetFrame();
            Vec3 eulerAngles = this._initialFrame.rotation.GetEulerAngles();

            this._panRotation  = eulerAngles.x;
            this._tiltRotation = eulerAngles.z;
        }
Ejemplo n.º 3
0
        internal void CharacterTableauContinuousRenderFunction(Texture sender, EventArgs e)
        {
            Scene       scene       = (Scene)sender.UserData;
            TableauView tableauView = sender.TableauView;

            if (scene == null)
            {
                tableauView.SetContinuousRendering(false);
                tableauView.SetDeleteAfterRendering(true);
                return;
            }
            scene.EnsurePostfxSystem();
            scene.SetDofMode(false);
            scene.SetMotionBlurMode(false);
            scene.SetBloom(true);
            scene.SetDynamicShadowmapCascadesRadiusMultiplier(0.31f);
            tableauView.SetRenderWithPostfx(true);
            float       cameraRatio = this._cameraRatio;
            MatrixFrame camPos      = this._camPos;

            if (this._continuousRenderCamera != null)
            {
                Camera continuousRenderCamera = this._continuousRenderCamera;
                this._continuousRenderCamera = null;
                continuousRenderCamera.SetFovVertical(0.7853982f, cameraRatio, 0.2f, 200f);
                continuousRenderCamera.Frame = camPos;
                tableauView.SetCamera(continuousRenderCamera);
                tableauView.SetScene(scene);
                tableauView.SetSceneUsesSkybox(false);
                tableauView.SetDeleteAfterRendering(false);
                tableauView.SetContinuousRendering(true);
                tableauView.SetDoNotRenderThisFrame(true);
                tableauView.SetClearColor(0u);
                tableauView.SetFocusedShadowmap(true, ref this._frame.origin, 1.55f);
            }
        }