protected override void SpawnEntities() { Ship = new OgreShip(_DataFile, World); Ship.IsShipDataPreviewShip = true; distance = Ship.GetBoundingRadius() * 1.25f; zoomdistance = distance * 0.1f; VP.SetCameraYawPitchDistance(yaw, pitch, distance); Ship.OnShipMainMeshChanged += Ship_OnShipMainMeshChanged; }
protected override void SpawnEntities() { PUActor = World.CreateActor("PUActor"); PUComponent = PUActor.CreatePUSystemComponent("PUSystem", PUSystemName, true); PUComponent.PlaySystem(); distance = 50; zoomdistance = 5; VP.SetCameraYawPitchDistance(yaw, pitch, distance); }
protected override void ResetCamera() { if (PUActor != null) { distance = 50; zoomdistance = 5; yaw = 0; pitch = 0; VP.SetCameraYawPitchDistance(yaw, pitch, distance); } }
protected override void ResetCamera() { if (Ship != null) { if (Ship.ShipActor != null) { distance = Ship.ShipActor.GetBoundingRadius() * 1.25f; zoomdistance = distance * 0.1f; yaw = 0; pitch = 0; VP.SetCameraYawPitchDistance(yaw, pitch, distance); } } }
private void Ship_OnShipMainMeshChanged(object sender, EventArgs e) { distance = Ship.GetBoundingRadius() * 1.25f; zoomdistance = distance * 0.1f; VP.SetCameraYawPitchDistance(yaw, pitch, distance); }