public World(Game game, Renderer renderer) { this.Game = game; this.Renderer = renderer; Entities = new SparseArray<Entity>(); Transformations = new SparseArray<Transformation>(); Primitives = new SparseArray<Primitive>(); Newtonians = new SparseArray<Newtonian>(); Models = new SparseArray<Microsoft.Xna.Framework.Graphics.Model>(); Players = new SparseArray<Player>(); PlayerControls = new SparseArray<PlayerControl>(); newtonianSystem = new NewtonianSystem(this); renderingSystem = new RenderingSystem(this, renderer); networkSystem = new NetworkSystem(this); inputSystem = new InputManager(this); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); this.Services.AddService(typeof(SpriteBatch), spriteBatch); DiagnosticsManager.Initialize(this); SpriteBatchHelpers.Initialize(GraphicsDevice); Primitives.Initialize(GraphicsDevice); Renderer = new Engine.Graphics.Renderer() { Camera = new PerspectiveCamera() { Position = Vector3.UnitX, Target = Vector3.Zero, Up = Vector3.Up, FieldOfView = MathHelper.PiOver4, AspectRatio = GraphicsDevice.Viewport.AspectRatio, NearPlane = 0.01f, FarPlane = 5000f } }; // TODO: use this.Content to load your game content here // TODO: load assets (player string font and player model) World = new World(this, Renderer); var player = World.SpawnPlayer("Player1"); var playerTrans = World.Transformations[player]; playerTrans.Scale = new Vector3(2); // TODO: load world state from data files base.LoadContent(); }
public RenderingSystem(World world, Renderer renderer) { this.world = world; this.renderer = renderer; }