/// <summary> /// Remove SkyX, you can call this method to remove SkyX from the scene /// or release (secondary) SkyX memory, call <see cref="Create"/> to return SkyX to the scene. /// </summary> public void Remove() { if (IsCreated) { return; } CloudsManager.RemoveAll(); MeshManager.Remove(); MoonManager.Remove(); VCloudsManager.Remove(); IsCreated = false; }
/// <summary> /// Call every frame to update SkyX /// </summary> /// <param name="timeSinceLastFrame">time elapsed since last frame</param> public void Update(float timeSinceLastFrame) { if (!IsCreated) { return; } if (TimeMultiplier != 0) { AtmosphereManager.AtmosphereOptions opt = AtmosphereManager.Options; float timemultiplied = timeSinceLastFrame * TimeMultiplier; opt.Time.x += timemultiplied; TimeOffset += timemultiplied; if (opt.Time.x > 24) { opt.Time.x -= 24; } else if (opt.Time.x < 0) { opt.Time.x += 24; } AtmosphereManager.Options = opt; } if (_lastCameraPosition != Camera.DerivedPosition) { MeshManager.SceneNode.Position = Camera.DerivedPosition; MoonManager.MoonSceneNode.Position = Camera.DerivedPosition; _lastCameraPosition = Camera.DerivedPosition; } if (_lastCameraFarClipDistance != Camera.FarClipDistance) { MeshManager.UpdateGeometry(); MoonManager.Update(); _lastCameraFarClipDistance = Camera.FarClipDistance; } VCloudsManager.Update(timeSinceLastFrame); }