public EngineScene(EngineScene s) { _shadowObjects = s._shadowObjects; _visibleObjects = s._visibleObjects; _objects = s._objects; _sceneGraph = s._sceneGraph; }
public EngineScene() { //инит ФизиХ-а var coreDesc = new CoreDescription(); var output = new UserOutput(); Core = new Core(coreDesc, output); Core.SetParameter(PhysicsParameter.ContinuousCollisionDetection, false); Core.SetParameter(PhysicsParameter.ContinuousCollisionDetectionEpsilon, 0.01f); var sceneDesc = new SceneDescription { SimulationType = SimulationType.Software, //Hardware, MaximumBounds = new Bounds3(-1000, -1000, -1000, 1000, 1000, 1000), UpAxis = 2, Gravity = new StillDesign.PhysX.MathPrimitives.Vector3(0.0f, -9.81f * 1.7f, 0.0f), GroundPlaneEnabled = false }; Scene = Core.CreateScene(sceneDesc); //для обработки столкновений Scene.UserContactReport = new ContactReport(MyGame.Instance); _objects = new MyContainer<PivotObject>(100, 10, true); _visibleObjects = new MyContainer<PivotObject>(100, 2); _shadowObjects = new MyContainer<PivotObject>(100, 2); _sceneGraph = new SceneGraph.SceneGraph(this); }
public GameScene(GameScene s, uint generatorId = 0) { ShadowObjects = s.ShadowObjects; VisibleObjects = s.VisibleObjects; objects = s.objects; sceneGraph = s.sceneGraph; idgenertor = new IdGenerator(generatorId); }
public GameScene() { objects = new MyContainer<PivotObject>(100, 10); VisibleObjects = new MyContainer<PivotObject>(100, 2); ShadowObjects = new MyContainer<PivotObject>(100, 2); sceneGraph = new SceneGraph.SceneGraph(this); idgenertor = new IdGenerator(0); }
/// <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); Model model_car = Content.Load<Model>("car"); SceneGraph.Entity car = new SceneGraph.Entity("car", model_car); SceneGraph.Node node = new SceneGraph.Node(car); sceneGraph = new SceneGraph.SceneGraph(node); //sceneGraph.Camera.World = Matrix.CreateFromYawPitchRoll(0, -90, 90); sceneGraph.Camera.View = Matrix.CreateLookAt(new Vector3(0, 2, 5), Vector3.Zero, Vector3.Up); sceneGraph.Camera.Projection = Matrix.CreatePerspectiveFieldOfView(1, GraphicsDevice.Viewport.AspectRatio, 1, 100); car.move(.2f, -.8f, -2); }
/// <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); Model model_car = Content.Load <Model>("car"); SceneGraph.Entity car = new SceneGraph.Entity("car", model_car); SceneGraph.Node node = new SceneGraph.Node(car); sceneGraph = new SceneGraph.SceneGraph(node); //sceneGraph.Camera.World = Matrix.CreateFromYawPitchRoll(0, -90, 90); sceneGraph.Camera.View = Matrix.CreateLookAt(new Vector3(0, 2, 5), Vector3.Zero, Vector3.Up); sceneGraph.Camera.Projection = Matrix.CreatePerspectiveFieldOfView(1, GraphicsDevice.Viewport.AspectRatio, 1, 100); car.move(.2f, -.8f, -2); }