/// <summary> /// Creates the skybox. /// </summary> /// <param name="scene">Scene.</param> /// <param name="path">Path to skybox xml.</param> public static void CreateSkybox(CoreScene scene, Entity player, string path = "lib/Renderer/TestGraphics/Skybox/skybox.xml") { ModelSceneObject skyboxModel = new ModelSceneObject (path); skyboxModel.Priority = 0; skyboxModel.Scaling = 50.0f * Vector3.One; scene.AddObject (skyboxModel); skyboxModel.Model.EnableDepthTest = false; skyboxModel.NoLighting = true; player.GetComponent<SkyboxComponent> ().Skybox = skyboxModel; }
public RoachGroup (CoreScene scene) { Roaches = new ModelSceneObject[5]; offset = new Vector3[Roaches.Length]; for (int i = 0; i < Roaches.Length; i++) { Roaches[i] = new ModelSceneObject ("lib/Renderer/TestGraphics/Roach/roach.xml"); scene.AddObject(Roaches[i]); } offset[0] = new Vector3(1 , 0, 1 ) / 10; offset[1] = new Vector3(-2, 0, 1 ) / 10; offset[2] = new Vector3(2 , 0, 0 ) / 10; offset[3] = new Vector3(0 , 0, 1 ) / 10; offset[4] = new Vector3(-2, 0, -1.5f) / 10; }
/// <summary> /// Initializes a new instance of the <see cref="FreezingArcher.Game.ECSTest"/> class. /// </summary> /// <param name="messageProvider">The message provider for this instance.</param> /// <param name="scene">Scene.</param> public ECSTest (MessageProvider messageProvider, CoreScene scene) { Entity player = EntityFactory.Instance.CreateWith ("player", messageProvider, systems: new[] { typeof (MovementSystem), typeof (KeyboardControllerSystem), typeof (MouseControllerSystem) }); scene.CameraManager.AddCamera (new BaseCamera (player, messageProvider), "player"); Entity skybox = EntityFactory.Instance.CreateWith ("skybox", messageProvider, systems: new[] { typeof(ModelSystem) }); ModelSceneObject skyboxModel = new ModelSceneObject ("lib/Renderer/TestGraphics/Skybox/skybox.xml"); skybox.GetComponent<TransformComponent>().Scale = 100.0f * Vector3.One; scene.AddObject (skyboxModel); skyboxModel.WaitTillInitialized (); skyboxModel.Model.EnableDepthTest = false; skyboxModel.Model.EnableLighting = false; skybox.GetComponent<ModelComponent> ().Model = skyboxModel; // as we do not update skybox position the player is able to leave the skybox ... i dont wanna fix it cause its just a test... }