public void Set( UniPoint3 pt, Vector3 xAxis, Vector3 yAxis, Vector3 zAxis ) { Position = pt; m_Axis[ 0 ] = xAxis; m_Axis[ 1 ] = yAxis; m_Axis[ 2 ] = zAxis; }
/// <summary> /// Setup constructor /// </summary> public UniRay3( UniPoint3 origin, Vector3 dir ) { m_Origin = origin; m_Direction = dir; }
private void GameClientForm_Shown( object sender, EventArgs e ) { if ( DesignMode ) { return; } gameDisplay.OnBeginPaint += delegate { GameProfiles.Game.Rendering.Begin( ); }; gameDisplay.OnEndPaint += delegate { GameProfiles.Game.Rendering.End( ); GameProfiles.Game.Rendering.Reset( ); }; UniPoint3 initialViewPos = new UniPoint3( ); try { m_SolarSystem = CreateSolarSystem( initialViewPos ); } catch ( Exception ex ) { AppLog.Exception( ex, "Error occurred creating the solar system" ); ErrorMessageBox.Show( this, Resources.ErrorCreatingSolarSystem, ex ); Close( ); return; } // Load the game viewer try { LoadParameters loadParams = new LoadParameters( ); loadParams.Properties[ "user" ] = m_User; Viewer viewer = ( Viewer )AssetManager.Instance.Load( "Viewers/TestGameViewer.components.xml", loadParams ); viewer.Renderable = m_SolarSystem; ( ( IUniCamera )viewer.Camera ).Position.Z = initialViewPos.Z; gameDisplay.AddViewer( viewer ); } catch ( Exception ex ) { AppLog.Exception( ex, "Error occurred creating game viewer" ); ErrorMessageBox.Show( this, Resources.ErrorCreatingGameViewer, ex ); Close( ); return; } // Load the game controls try { CommandInputTemplateMap[] gameControlMaps = new CommandInputTemplateMap[] { ( CommandInputTemplateMap )AssetManager.Instance.Load( "Input/TestTrackingCameraInputs.components.xml" ), ( CommandInputTemplateMap )AssetManager.Instance.Load( "Input/HeadCameraInputs.components.xml" ) }; foreach ( Viewer viewer in gameDisplay.Viewers ) { foreach ( CommandInputTemplateMap gameControlMap in gameControlMaps ) { gameControlMap.BindToInput( new InputContext( viewer ), m_User ); } } } catch ( Exception ex ) { AppLog.Exception( ex, "Error occurred creating game controls" ); ErrorMessageBox.Show( this, Resources.ErrorCreatingGameControls, ex ); } }
/// <summary> /// Default constructor. Places the ray at the origin, pointing along the z axis /// </summary> public UniRay3( ) { m_Origin = new UniPoint3( ); m_Direction = Vector3.ZAxis; }
private static SolarSystem CreateSolarSystem( UniPoint3 initialViewPos ) { SolarSystem system = new SolarSystem( ); SpherePlanet planet = new SpherePlanet( null, "TEST0", 80000.0 ); initialViewPos.Z = planet.Radius + UniUnits.Metres.ToUniUnits( 10000 ); //SpherePlanet moon = new SpherePlanet( new CircularOrbit( planet, 1600000.0, TimeSpan.FromSeconds( 60 ) ), "TEST1", 30000.0f ); //SpherePlanet moon1 = new SpherePlanet( new CircularOrbit( moon, 500000.0, TimeSpan.FromSeconds( 60 ) ), "TEST2", 100000.0f ); //moon.Moons.Add( moon1 ); //planet.Moons.Add( moon ); system.Planets.Add( planet ); //system.Planets.Add( moon ); //system.Planets.Add( moon1 ); return system; }