예제 #1
0
파일: Scene.cs 프로젝트: kkestell/nyx-1.0
        public void Initialize(Engine engine)
        {
            this.engine = engine;

            this.CreatePlayer();

            var r = new Random();
            for (int i = 0; i < 100; i++)
            {
                var node = new SceneNode();
                var box = new PhysicsObject(
                    "Cube",
                    new Vector3(r.Next(20) - 10, r.Next(500) + 200, r.Next(20) - 10),
                    Quaternion.Identity,
                    Vector3.One,
                    typeof(BoxShape),
                    false);
                node.AttachEntity(box);
                this.AttachSceneNodeToRoot(node);
            }

            this.sceneGraph.Initialize(this.engine);
        }
예제 #2
0
 public MainMenuGameState(Engine engine)
     : base(engine)
 {
 }
예제 #3
0
        /// <summary>
        /// Initializes the scene graph.
        /// </summary>
        /// <param name="engine">The engine.</param>
        public void Initialize(Engine engine)
        {
            this.engine = engine;

            foreach (var entity in this.root.Entities)
            {
                entity.LoadContent(this.engine);

                if (entity.GetType() == typeof(PhysicsObject))
                {
                    var physicsObject = (PhysicsObject)entity;
                    physicsObject.AttachToWorld(this.world);
                }

                if (entity.GetType() == typeof(Player))
                {
                    var player = (Player)entity;
                    player.AttachToWorld(this.world);
                }
            }
        }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameState" /> class.
 /// </summary>
 /// <param name="engine">The engine.</param>
 public GameState(Engine engine)
 {
     this.engine = engine;
 }
예제 #5
0
 public PausedGameState(Engine engine)
     : base(engine)
 {
 }
예제 #6
0
파일: Camera.cs 프로젝트: kkestell/nyx-1.0
 public Camera(Engine engine)
 {
     this.engine = engine;
 }