Example #1
0
        void renderTargetUserControl1_Render( RenderTargetUserControl sender, Camera camera )
        {
            //update camera
            if( Map.Instance != null )
            {
                Vec3 position;
                Vec3 forward;
                Degree fov;

                MapCamera mapCamera = Entities.Instance.GetByName( "MapCamera_1" ) as MapCamera;
                if( mapCamera != null )
                {
                    position = mapCamera.Position;
                    forward = mapCamera.Rotation * new Vec3( 1, 0, 0 );
                    fov = mapCamera.Fov;
                }
                else
                {
                    position = Map.Instance.EditorCameraPosition;
                    forward = Map.Instance.EditorCameraDirection.GetVector();
                    fov = Map.Instance.Fov;
                }

                if( fov == 0 )
                    fov = Map.Instance.Fov;

                renderTargetUserControl1.CameraNearFarClipDistance = Map.Instance.NearFarClipDistance;
                renderTargetUserControl1.CameraFixedUp = Vec3.ZAxis;
                renderTargetUserControl1.CameraFov = fov;
                renderTargetUserControl1.CameraPosition = position;
                renderTargetUserControl1.CameraDirection = forward;
            }
        }
Example #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 7 "..\..\AdditionalWindow.xaml"
                ((System.Windows.Controls.Grid)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Grid_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.renderTargetUserControl1 = ((WPFAppFramework.RenderTargetUserControl)(target));
                return;

            case 3:
                this.button1 = ((System.Windows.Controls.Button)(target));

            #line 9 "..\..\AdditionalWindow.xaml"
                this.button1.Click += new System.Windows.RoutedEventHandler(this.button1_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Example #3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 6 "..\..\MainWindow.xaml"
                ((WPFAppExample.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden

            #line 6 "..\..\MainWindow.xaml"
                ((WPFAppExample.MainWindow)(target)).Closed += new System.EventHandler(this.Window_Closed);

            #line default
            #line hidden
                return;

            case 2:
                this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.renderTargetUserControl1 = ((WPFAppFramework.RenderTargetUserControl)(target));
                return;

            case 4:
                this.slider1 = ((System.Windows.Controls.Slider)(target));

            #line 13 "..\..\MainWindow.xaml"
                this.slider1.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider1_ValueChanged);

            #line default
            #line hidden
                return;

            case 5:
                this.buttonClose = ((System.Windows.Controls.Button)(target));

            #line 14 "..\..\MainWindow.xaml"
                this.buttonClose.Click += new System.Windows.RoutedEventHandler(this.buttonClose_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.label1 = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.buttonAddForm = ((System.Windows.Controls.Button)(target));

            #line 16 "..\..\MainWindow.xaml"
                this.buttonAddForm.Click += new System.Windows.RoutedEventHandler(this.buttonAddForm_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.buttonCreateBox = ((System.Windows.Controls.Button)(target));

            #line 17 "..\..\MainWindow.xaml"
                this.buttonCreateBox.Click += new System.Windows.RoutedEventHandler(this.buttonCreateBox_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.buttonShowUI = ((System.Windows.Controls.Button)(target));

            #line 18 "..\..\MainWindow.xaml"
                this.buttonShowUI.Click += new System.Windows.RoutedEventHandler(this.buttonShowUI_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.label2 = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 6 "..\..\MainWindow.xaml"
                ((WPFSimpleExample.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden

            #line 6 "..\..\MainWindow.xaml"
                ((WPFSimpleExample.MainWindow)(target)).Closed += new System.EventHandler(this.Window_Closed);

            #line default
            #line hidden
                return;

            case 2:
                this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.renderTargetUserControl1 = ((WPFAppFramework.RenderTargetUserControl)(target));
                return;

            case 4:
                this.buttonClose = ((System.Windows.Controls.Button)(target));

            #line 13 "..\..\MainWindow.xaml"
                this.buttonClose.Click += new System.Windows.RoutedEventHandler(this.buttonClose_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.label2 = ((System.Windows.Controls.Label)(target));
                return;

            case 6:
                this.label3 = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.comboBoxMaps = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 8:
                this.buttonLoadMap = ((System.Windows.Controls.Button)(target));

            #line 17 "..\..\MainWindow.xaml"
                this.buttonLoadMap.Click += new System.Windows.RoutedEventHandler(this.buttonLoadMap_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.buttonDestroy = ((System.Windows.Controls.Button)(target));

            #line 18 "..\..\MainWindow.xaml"
                this.buttonDestroy.Click += new System.Windows.RoutedEventHandler(this.buttonDestroy_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Example #5
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 6 "..\..\MainWindow.xaml"
                ((WPFAppExample.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden

            #line 6 "..\..\MainWindow.xaml"
                ((WPFAppExample.MainWindow)(target)).Closed += new System.EventHandler(this.Window_Closed);

            #line default
            #line hidden
                return;

            case 2:
                this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.renderTargetUserControl1 = ((WPFAppFramework.RenderTargetUserControl)(target));
                return;

            case 4:
                this.slider1 = ((System.Windows.Controls.Slider)(target));

            #line 13 "..\..\MainWindow.xaml"
                this.slider1.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider1_ValueChanged);

            #line default
            #line hidden
                return;

            case 5:
                this.buttonClose = ((System.Windows.Controls.Button)(target));

            #line 14 "..\..\MainWindow.xaml"
                this.buttonClose.Click += new System.Windows.RoutedEventHandler(this.buttonClose_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.label1 = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.buttonAddForm = ((System.Windows.Controls.Button)(target));

            #line 16 "..\..\MainWindow.xaml"
                this.buttonAddForm.Click += new System.Windows.RoutedEventHandler(this.buttonAddForm_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.buttonCreateBox = ((System.Windows.Controls.Button)(target));

            #line 17 "..\..\MainWindow.xaml"
                this.buttonCreateBox.Click += new System.Windows.RoutedEventHandler(this.buttonCreateBox_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.buttonShowUI = ((System.Windows.Controls.Button)(target));

            #line 18 "..\..\MainWindow.xaml"
                this.buttonShowUI.Click += new System.Windows.RoutedEventHandler(this.buttonShowUI_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.label2 = ((System.Windows.Controls.Label)(target));
                return;

            case 11:
                this.label3 = ((System.Windows.Controls.Label)(target));
                return;

            case 12:
                this.comboBoxMaps = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 13:
                this.buttonLoadMap = ((System.Windows.Controls.Button)(target));

            #line 22 "..\..\MainWindow.xaml"
                this.buttonLoadMap.Click += new System.Windows.RoutedEventHandler(this.buttonLoadMap_Click);

            #line default
            #line hidden
                return;

            case 14:
                this.buttonDestroy = ((System.Windows.Controls.Button)(target));

            #line 23 "..\..\MainWindow.xaml"
                this.buttonDestroy.Click += new System.Windows.RoutedEventHandler(this.buttonDestroy_Click);

            #line default
            #line hidden
                return;

            case 15:
                this.label4 = ((System.Windows.Controls.Label)(target));
                return;

            case 16:
                this.textBoxServerAddress = ((System.Windows.Controls.TextBox)(target));
                return;

            case 17:
                this.textBoxUserName = ((System.Windows.Controls.TextBox)(target));
                return;

            case 18:
                this.buttonConnect = ((System.Windows.Controls.Button)(target));

            #line 27 "..\..\MainWindow.xaml"
                this.buttonConnect.Click += new System.Windows.RoutedEventHandler(this.buttonConnect_Click);

            #line default
            #line hidden
                return;

            case 19:
                this.labelNetworkStatus = ((System.Windows.Controls.Label)(target));
                return;

            case 20:
                this.checkBoxUseD3DImage = ((System.Windows.Controls.CheckBox)(target));

            #line 29 "..\..\MainWindow.xaml"
                this.checkBoxUseD3DImage.Checked += new System.Windows.RoutedEventHandler(this.checkBoxUseD3DImage_Checked);

            #line default
            #line hidden

            #line 29 "..\..\MainWindow.xaml"
                this.checkBoxUseD3DImage.Unchecked += new System.Windows.RoutedEventHandler(this.checkBoxUseD3DImage_Unchecked);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Example #6
0
        void renderTargetUserControl1_Tick( RenderTargetUserControl sender, float delta )
        {
            //update network status
            NetworkConnectionStatuses status = NetworkConnectionStatuses.Disconnected;
            if( GameNetworkClient.Instance != null )
                status = GameNetworkClient.Instance.Status;
            labelNetworkStatus.Content = status.ToString();

            //moving free camera by keys
            if( Map.Instance != null && freeCameraEnabled )
            {
                float cameraVelocity = 20;

                Vec3 pos = freeCameraPosition;
                SphereDir dir = freeCameraDirection;

                float step = cameraVelocity * delta;

                if( renderTargetUserControl1.IsKeyPressed( Key.W ) ||
                    renderTargetUserControl1.IsKeyPressed( Key.Up ) )
                {
                    pos += dir.GetVector() * step;
                }
                if( renderTargetUserControl1.IsKeyPressed( Key.S ) ||
                    renderTargetUserControl1.IsKeyPressed( Key.Down ) )
                {
                    pos -= dir.GetVector() * step;
                }
                if( renderTargetUserControl1.IsKeyPressed( Key.A ) ||
                    renderTargetUserControl1.IsKeyPressed( Key.Left ) )
                {
                    pos += new SphereDir(
                        dir.Horizontal + MathFunctions.PI / 2, 0 ).GetVector() * step;
                }
                if( renderTargetUserControl1.IsKeyPressed( Key.D ) ||
                    renderTargetUserControl1.IsKeyPressed( Key.Right ) )
                {
                    pos += new SphereDir(
                        dir.Horizontal - MathFunctions.PI / 2, 0 ).GetVector() * step;
                }
                if( renderTargetUserControl1.IsKeyPressed( Key.Q ) )
                    pos += new Vec3( 0, 0, step );
                if( renderTargetUserControl1.IsKeyPressed( Key.E ) )
                    pos += new Vec3( 0, 0, -step );

                freeCameraPosition = pos;
            }
        }
Example #7
0
        void renderTargetUserControl1_RenderUI( RenderTargetUserControl sender, GuiRenderer renderer )
        {
            string text = "NeoAxis 3D Engine " + EngineVersionInformation.Version;
            renderer.AddText( text, new Vec2( .01f, .01f ), HorizontalAlign.Left,
                 VerticalAlign.Top, new ColorValue( 1, 1, 1 ) );

            renderer.AddText( "Camera control: W A S D, right mouse", new Vec2( .99f, .99f ),
                HorizontalAlign.Right, VerticalAlign.Bottom, new ColorValue( 1, 1, 1 ) );
        }
Example #8
0
        void renderTargetUserControl1_Render( RenderTargetUserControl sender, Camera camera )
        {
            //update camera
            if( Map.Instance != null )
            {
                Vec3 position;
                Vec3 forward;
                Vec3 up;
                Degree fov;

                if( !freeCameraEnabled )
                {
                    //usual camera

                    position = Vec3.Zero;
                    forward = new Vec3( 1, 0, 0 );
                    up = Vec3.ZAxis;
                    fov = Map.Instance.Fov;

                    //MapCamera mapCamera = Entities.Instance.GetByName( "MapCamera_0" ) as MapCamera;
                    //if( mapCamera != null )
                    //{
                    //   position = mapCamera.Position;
                    //   forward = mapCamera.Rotation * new Vec3( 1, 0, 0 );
                    //   fov = mapCamera.Fov;
                    //}
                }
                else
                {
                    //free camera

                    position = freeCameraPosition;
                    forward = freeCameraDirection.GetVector();
                    up = Vec3.ZAxis;
                    fov = Map.Instance.Fov;
                }

                renderTargetUserControl1.CameraNearFarClipDistance = Map.Instance.NearFarClipDistance;
                renderTargetUserControl1.CameraFixedUp = up;
                renderTargetUserControl1.CameraFov = fov;
                renderTargetUserControl1.CameraPosition = position;
                renderTargetUserControl1.CameraDirection = forward;
            }

            //update sound listener
            if( SoundWorld.Instance != null )
                SoundWorld.Instance.SetListener( camera.Position, Vec3.Zero, camera.Direction, camera.Up );

            //if( Map.Instance != null && !renderTargetUserControl1.MouseRelativeMode )
            //	RenderEntityOverCursor( camera );
        }
 public ViewRenderTargetListener(RenderTargetUserControl owner)
 {
     this.owner = owner;
 }
        private void renderTargetUserControl1_Render(RenderTargetUserControl sender, Camera camera)
        {
            //update camera
            if (Map.Instance != null)
            {
                Vec3 position;
                Vec3 forward;
                Vec3 up;
                Degree fov;

                //find first MapCamera object on the map
                MapCamera mapCamera = FindFirstMapCamera();
                if (mapCamera != null)
                {
                    position = mapCamera.Position;
                    forward = mapCamera.Rotation * new Vec3(1, 0, 0);
                    up = Vec3.ZAxis;
                    if (mapCamera.Fov != 0)
                        fov = mapCamera.Fov;
                    else
                        fov = Map.Instance.Fov;
                }
                else
                {
                    position = Vec3.Zero;
                    forward = new Vec3(1, 0, 0);
                    up = Vec3.ZAxis;
                    fov = Map.Instance.Fov;
                }

                renderTargetUserControl1.CameraNearFarClipDistance = Map.Instance.NearFarClipDistance;
                renderTargetUserControl1.CameraFixedUp = up;
                renderTargetUserControl1.CameraFov = fov;
                renderTargetUserControl1.CameraPosition = position;
                renderTargetUserControl1.CameraDirection = forward;
            }

            //update sound listener
            if (SoundWorld.Instance != null)
                SoundWorld.Instance.SetListener(camera.Position, Vec3.Zero, camera.Direction, camera.Up);
        }
 private void renderTargetUserControl1_Tick(RenderTargetUserControl sender, float delta)
 {
 }
 private void renderTargetUserControl1_RenderUI(RenderTargetUserControl sender, GuiRenderer renderer)
 {
     string text = "NeoAxis 3D Engine " + EngineVersionInformation.Version;
     renderer.AddText(text, new Vec2(.01f, .01f), HorizontalAlign.Left,
          VerticalAlign.Top, new ColorValue(1, 1, 1));
 }
 public ViewRenderTargetListener( RenderTargetUserControl owner )
 {
     this.owner = owner;
 }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     
     #line 7 "..\..\AdditionalWindow.xaml"
     ((System.Windows.Controls.Grid)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Grid_Loaded);
     
     #line default
     #line hidden
     return;
     case 2:
     this.renderTargetUserControl1 = ((WPFAppFramework.RenderTargetUserControl)(target));
     return;
     case 3:
     this.button1 = ((System.Windows.Controls.Button)(target));
     
     #line 9 "..\..\AdditionalWindow.xaml"
     this.button1.Click += new System.Windows.RoutedEventHandler(this.button1_Click);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     
     #line 6 "..\..\MainWindow.xaml"
     ((WPFAppExample.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
     
     #line default
     #line hidden
     
     #line 6 "..\..\MainWindow.xaml"
     ((WPFAppExample.MainWindow)(target)).Closed += new System.EventHandler(this.Window_Closed);
     
     #line default
     #line hidden
     return;
     case 2:
     this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
     return;
     case 3:
     this.renderTargetUserControl1 = ((WPFAppFramework.RenderTargetUserControl)(target));
     return;
     case 4:
     this.slider1 = ((System.Windows.Controls.Slider)(target));
     
     #line 13 "..\..\MainWindow.xaml"
     this.slider1.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler<double>(this.slider1_ValueChanged);
     
     #line default
     #line hidden
     return;
     case 5:
     this.buttonClose = ((System.Windows.Controls.Button)(target));
     
     #line 14 "..\..\MainWindow.xaml"
     this.buttonClose.Click += new System.Windows.RoutedEventHandler(this.buttonClose_Click);
     
     #line default
     #line hidden
     return;
     case 6:
     this.label1 = ((System.Windows.Controls.Label)(target));
     return;
     case 7:
     this.buttonAddForm = ((System.Windows.Controls.Button)(target));
     
     #line 16 "..\..\MainWindow.xaml"
     this.buttonAddForm.Click += new System.Windows.RoutedEventHandler(this.buttonAddForm_Click);
     
     #line default
     #line hidden
     return;
     case 8:
     this.buttonCreateBox = ((System.Windows.Controls.Button)(target));
     
     #line 17 "..\..\MainWindow.xaml"
     this.buttonCreateBox.Click += new System.Windows.RoutedEventHandler(this.buttonCreateBox_Click);
     
     #line default
     #line hidden
     return;
     case 9:
     this.buttonShowUI = ((System.Windows.Controls.Button)(target));
     
     #line 18 "..\..\MainWindow.xaml"
     this.buttonShowUI.Click += new System.Windows.RoutedEventHandler(this.buttonShowUI_Click);
     
     #line default
     #line hidden
     return;
     case 10:
     this.label2 = ((System.Windows.Controls.Label)(target));
     return;
     case 11:
     this.label3 = ((System.Windows.Controls.Label)(target));
     return;
     case 12:
     this.comboBoxMaps = ((System.Windows.Controls.ComboBox)(target));
     return;
     case 13:
     this.buttonLoadMap = ((System.Windows.Controls.Button)(target));
     
     #line 22 "..\..\MainWindow.xaml"
     this.buttonLoadMap.Click += new System.Windows.RoutedEventHandler(this.buttonLoadMap_Click);
     
     #line default
     #line hidden
     return;
     case 14:
     this.buttonDestroy = ((System.Windows.Controls.Button)(target));
     
     #line 23 "..\..\MainWindow.xaml"
     this.buttonDestroy.Click += new System.Windows.RoutedEventHandler(this.buttonDestroy_Click);
     
     #line default
     #line hidden
     return;
     case 15:
     this.label4 = ((System.Windows.Controls.Label)(target));
     return;
     case 16:
     this.textBoxServerAddress = ((System.Windows.Controls.TextBox)(target));
     return;
     case 17:
     this.textBoxUserName = ((System.Windows.Controls.TextBox)(target));
     return;
     case 18:
     this.buttonConnect = ((System.Windows.Controls.Button)(target));
     
     #line 27 "..\..\MainWindow.xaml"
     this.buttonConnect.Click += new System.Windows.RoutedEventHandler(this.buttonConnect_Click);
     
     #line default
     #line hidden
     return;
     case 19:
     this.labelNetworkStatus = ((System.Windows.Controls.Label)(target));
     return;
     case 20:
     this.checkBoxUseD3DImage = ((System.Windows.Controls.CheckBox)(target));
     
     #line 29 "..\..\MainWindow.xaml"
     this.checkBoxUseD3DImage.Checked += new System.Windows.RoutedEventHandler(this.checkBoxUseD3DImage_Checked);
     
     #line default
     #line hidden
     
     #line 29 "..\..\MainWindow.xaml"
     this.checkBoxUseD3DImage.Unchecked += new System.Windows.RoutedEventHandler(this.checkBoxUseD3DImage_Unchecked);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     
     #line 6 "..\..\MainWindow.xaml"
     ((WPFSimpleExample.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
     
     #line default
     #line hidden
     
     #line 6 "..\..\MainWindow.xaml"
     ((WPFSimpleExample.MainWindow)(target)).Closed += new System.EventHandler(this.Window_Closed);
     
     #line default
     #line hidden
     return;
     case 2:
     this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
     return;
     case 3:
     this.renderTargetUserControl1 = ((WPFAppFramework.RenderTargetUserControl)(target));
     return;
     case 4:
     this.buttonClose = ((System.Windows.Controls.Button)(target));
     
     #line 13 "..\..\MainWindow.xaml"
     this.buttonClose.Click += new System.Windows.RoutedEventHandler(this.buttonClose_Click);
     
     #line default
     #line hidden
     return;
     case 5:
     this.label2 = ((System.Windows.Controls.Label)(target));
     return;
     case 6:
     this.label3 = ((System.Windows.Controls.Label)(target));
     return;
     case 7:
     this.comboBoxMaps = ((System.Windows.Controls.ComboBox)(target));
     return;
     case 8:
     this.buttonLoadMap = ((System.Windows.Controls.Button)(target));
     
     #line 17 "..\..\MainWindow.xaml"
     this.buttonLoadMap.Click += new System.Windows.RoutedEventHandler(this.buttonLoadMap_Click);
     
     #line default
     #line hidden
     return;
     case 9:
     this.buttonDestroy = ((System.Windows.Controls.Button)(target));
     
     #line 18 "..\..\MainWindow.xaml"
     this.buttonDestroy.Click += new System.Windows.RoutedEventHandler(this.buttonDestroy_Click);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }