public BridgesScene(Demo demo, string name, int instanceIndex, string info) { this.demo = demo; this.name = name; this.instanceIndexName = " " + instanceIndex.ToString(); this.info = info; // Create a new objects in the scene skyInstance1 = new Sky(demo, 1); quadInstance1 = new Quad(demo, 1); cursorInstance = new Cursor(demo); shotInstance = new Shot(demo); car1Instance1 = new Car1(demo, 1); bridge1Instance1 = new Bridge1(demo, 1); bridge1Instance2 = new Bridge1(demo, 2); ragdoll1Instance1 = new Ragdoll1(demo, 1); camera1Instance1 = new Camera1(demo, 1); lightInstance = new Lights(demo); // Create a new controllers in the scene skyDraw1Instance1 = new SkyDraw1(demo, 1); cursorDraw1Instance = new CursorDraw1(demo); car1Animation1Instance1 = new Car1Animation1(demo, 1); camera1Animation1Instance1 = new Camera1Animation1(demo, 1); camera1Draw1Instance1 = new Camera1Draw1(demo, 1); }
public ClothScene(Demo demo, string name, int instanceIndex, string info) { this.demo = demo; this.name = name; this.instanceIndexName = " " + instanceIndex.ToString(); this.info = info; // Create a new objects in the scene skyInstance1 = new Sky(demo, 1); quadInstance1 = new Quad(demo, 1); cursorInstance = new Cursor(demo); shotInstance = new Shot(demo); columnInstance1 = new Column(demo, 1); cargoJackInstance1 = new CargoJack(demo, 1); pointClothInstance1 = new PointCloth(demo, 1); camera2Instance1 = new Camera2(demo, 1); lightInstance = new Lights(demo); // Create a new controllers in the scene skyDraw1Instance1 = new SkyDraw1(demo, 1); cursorDraw1Instance = new CursorDraw1(demo); cargoJackAnimation1Instance1 = new CargoJackAnimation1(demo, 1); camera2Animation1Instance1 = new Camera2Animation1(demo, 1); camera2Draw1Instance1 = new Camera2Draw1(demo, 1); }
public RagdollsScene(Demo demo, string name, int instanceIndex, string info) { this.demo = demo; this.name = name; this.instanceIndexName = " " + instanceIndex.ToString(); this.info = info; // Create a new objects in the scene skyInstance1 = new Sky(demo, 1); quadInstance1 = new Quad(demo, 1); cursorInstance = new Cursor(demo); shotInstance = new Shot(demo); ragdoll1Instance1 = new Ragdoll1(demo, 1); ragdoll2Instance1 = new Ragdoll2(demo, 1); ragdoll3Instance1 = new Ragdoll3(demo, 1); ragdoll1Instance2 = new Ragdoll1(demo, 2); ragdoll2Instance2 = new Ragdoll2(demo, 2); ragdoll3Instance2 = new Ragdoll3(demo, 2); ragdoll1Instance3 = new Ragdoll1(demo, 3); ragdoll2Instance3 = new Ragdoll2(demo, 3); ragdoll3Instance3 = new Ragdoll3(demo, 3); camera1Instance1 = new Camera1(demo, 1); camera1Instance2 = new Camera1(demo, 2); lightInstance = new Lights(demo); // Create a new controllers in the scene skyDraw1Instance1 = new SkyDraw1(demo, 1); cursorDraw1Instance = new CursorDraw1(demo); camera1Animation1Instance1 = new Camera1Animation1(demo, 1); camera1Animation1Instance2 = new Camera1Animation1(demo, 2); camera1Draw1Instance1 = new Camera1Draw1(demo, 1); camera1Draw1Instance2 = new Camera1Draw1(demo, 2); oldKeyboardState = demo.GetKeyboardState(); }
public BuildingScene(Demo demo, string name, int instanceIndex, string info) { this.demo = demo; this.name = name; this.instanceIndexName = " " + instanceIndex.ToString(); this.info = info; // Create a new objects in the scene skyInstance1 = new Sky(demo, 1); quadInstance1 = new Quad(demo, 1); cursorInstance = new Cursor(demo); shotInstance = new Shot(demo); plant2Instance1 = new Plant2(demo, 1); building1Instance1 = new Building1(demo, 1); car1Instance1 = new Car1(demo, 1); ragdoll3Instance1 = new Ragdoll3(demo, 1); box1Instance1 = new Box1(demo, 1); lamp1Instance1 = new Lamp1(demo, 1); lamp1Instance2 = new Lamp1(demo, 2); camera2Instance1 = new Camera2(demo, 1); lightInstance = new Lights(demo); // Create a new controllers in the scene skyDraw1Instance1 = new SkyDraw1(demo, 1); cursorDraw1Instance = new CursorDraw1(demo); car1Animation1Instance1 = new Car1Animation1(demo, 1); lamp1Animation1Instance1 = new Lamp1Animation1(demo, 1); lamp1Animation1Instance2 = new Lamp1Animation1(demo, 2); camera2Animation1Instance1 = new Camera2Animation1(demo, 1); camera2Draw1Instance1 = new Camera2Draw1(demo, 1); }
public AIScene(Demo demo, string name, int instanceIndex, string info) { this.demo = demo; this.name = name; this.instanceIndexName = " " + instanceIndex.ToString(); this.info = info; // Create a new objects in the scene skyInstance1 = new Sky(demo, 1); quadInstance1 = new Quad(demo, 1); cursorInstance = new Cursor(demo); shotInstance = new Shot(demo); plant1Instance1 = new Plant1(demo, 1); vehicle1Instance1 = new Vehicle1(demo, 1); amphibian1Instance1 = new Amphibian1(demo, 1); camera2Instance1 = new Camera2(demo, 1); lightInstance = new Lights(demo); // Create a new controllers in the scene skyDraw1Instance1 = new SkyDraw1(demo, 1); cursorDraw1Instance = new CursorDraw1(demo); vehicle1Animation1Instance1 = new Vehicle1Animation1(demo, 1); amphibian1Animation1Instance1 = new Amphibian1Animation1(demo, 1); camera2Animation1Instance1 = new Camera2Animation1(demo, 1); camera2Draw1Instance1 = new Camera2Draw1(demo, 1); }
public HelicoptersScene(Demo demo, string name, int instanceIndex, string info) { this.demo = demo; this.name = name; this.instanceIndexName = " " + instanceIndex.ToString(); this.info = info; // Create a new objects in the scene skyInstance1 = new Sky(demo, 1); quadInstance1 = new Quad(demo, 1); cursorInstance = new Cursor(demo); shotInstance = new Shot(demo); helicopter1Instance1 = new Helicopter1(demo, 1); helicopter1Instance2 = new Helicopter1(demo, 2); helicopter1Instance3 = new Helicopter1(demo, 3); helicopter1Instance4 = new Helicopter1(demo, 4); camera2Instance1 = new Camera2(demo, 1); lightInstance = new Lights(demo); // Create a new controllers in the scene skyDraw1Instance1 = new SkyDraw1(demo, 1); cursorDraw1Instance = new CursorDraw1(demo); helicopter1Animation1Instance1 = new Helicopter1Animation1(demo, 1); helicopter1Animation1Instance2 = new Helicopter1Animation1(demo, 2); helicopter1Animation1Instance3 = new Helicopter1Animation1(demo, 3); helicopter1Animation1Instance4 = new Helicopter1Animation1(demo, 4); camera2Animation1Instance1 = new Camera2Animation1(demo, 1); camera2Draw1Instance1 = new Camera2Draw1(demo, 1); }
public UserShapesScene(Demo demo, string name, int instanceIndex, string info) { this.demo = demo; this.name = name; this.instanceIndexName = " " + instanceIndex.ToString(); this.info = info; // Create a new objects in the scene skyInstance1 = new Sky(demo, 1); quadInstance1 = new Quad(demo, 1); cursorInstance = new Cursor(demo); shotInstance = new Shot(demo); userShapesInstance = new UserShapes(demo); torusMesh1 = new TorusMesh(demo, 1); torusMesh2 = new TorusMesh(demo, 2); torusMesh3 = new TorusMesh(demo, 3); torusMesh4 = new TorusMesh(demo, 4); forceField1Instance = new ForceField1(demo); forceField2Instance = new ForceField2(demo); switch1Instance = new Switch1(demo); switch2Instance = new Switch2(demo); camera1Instance1 = new Camera1(demo, 1); lightInstance = new Lights(demo); // Create a new controllers in the scene skyDraw1Instance1 = new SkyDraw1(demo, 1); cursorDraw1Instance = new CursorDraw1(demo); forceField1Animation1Instance = new ForceField1Animation1(demo, forceField1Instance); forceField2Animation1Instance = new ForceField2Animation1(demo, forceField2Instance); switch1Animation1Instance = new Switch1Animation1(demo, switch1Instance); switch2Animation1Instance = new Switch2Animation1(demo, switch2Instance); camera1Animation1Instance1 = new Camera1Animation1(demo, 1); camera1Draw1Instance1 = new Camera1Draw1(demo, 1); }
public BuildingsScene(Demo demo, string name, int instanceIndex, string info) { this.demo = demo; this.name = name; this.instanceIndexName = " " + instanceIndex.ToString(); this.info = info; // Create a new objects in the scene skyInstance1 = new Sky(demo, 1); quadInstance1 = new Quad(demo, 1); cursorInstance = new Cursor(demo); shotInstance = new Shot(demo); building1Instance1 = new Building1(demo, 1); building2Instance1 = new Building2(demo, 1); bridge2Instance1 = new Bridge2(demo, 1); camera2Instance1 = new Camera2(demo, 1); lightInstance = new Lights(demo); // Create a new controllers in the scene skyDraw1Instance1 = new SkyDraw1(demo, 1); cursorDraw1Instance = new CursorDraw1(demo); camera2Animation1Instance1 = new Camera2Animation1(demo, 1); camera2Draw1Instance1 = new Camera2Draw1(demo, 1); pointLightAnimation1Instance1 = new PointLightAnimation1(demo, 12); }
public TerrainWithWaterScene(Demo demo, string name, int instanceIndex, string info) { this.demo = demo; this.name = name; this.instanceIndexName = " " + instanceIndex.ToString(); this.info = info; // Create a new objects in the scene skyInstance1 = new Sky(demo, 1); cursorInstance = new Cursor(demo); shotInstance = new Shot(demo); terrainInstance1 = new Terrain(demo, 1); lakeInstance1 = new Lake(demo, 1, 8, 8); defaultShapesInstance = new DefaultShapes(demo); columnInstance1 = new Column(demo, 1); columnInstance2 = new Column(demo, 2); pierInstance1 = new Pier(demo, 1); ragdoll2Instance1 = new Ragdoll2(demo, 1); boat1Instance1 = new Boat1(demo, 1); car1Instance1 = new Car1(demo, 1); box2Instance1 = new Box2(demo, 1); crab1Instance1 = new Crab1(demo, 1); torusMesh = new TorusMesh(demo, 1); camera2Instance1 = new Camera2(demo, 1); lightInstance = new Lights(demo); // Create a new controllers in the scene skyDraw1Instance1 = new SkyDraw1(demo, 1); cursorDraw1Instance = new CursorDraw1(demo); boat1Animation1Instance1 = new Boat1Animation1(demo, 1); car1Animation1Instance1 = new Car1Animation1(demo, 1); terrainDraw1Instance1 = new TerrainDraw1(demo, 1); lakeDraw1Instance1 = new LakeDraw1(demo, 1, 8, 8); camera2Animation1Instance1 = new Camera2Animation1(demo, 1); camera2Draw1Instance1 = new Camera2Draw1(demo, 1); }
public DefaultShapesScene(Demo demo, string name, int instanceIndex, string info) { this.demo = demo; this.name = name; this.instanceIndexName = " " + instanceIndex.ToString(); this.info = info; // Create a new objects in the scene skyInstance1 = new Sky(demo, 1); quadInstance1 = new Quad(demo, 1); cursorInstance = new Cursor(demo); shotInstance = new Shot(demo); defaultShapesInstance = new DefaultShapes(demo); columnInstance1 = new Column(demo, 1); columnInstance2 = new Column(demo, 2); camera1Instance1 = new Camera1(demo, 1); lightInstance = new Lights(demo); // Create a new controllers in the scene skyDraw1Instance1 = new SkyDraw1(demo, 1); cursorDraw1Instance = new CursorDraw1(demo); camera1Animation1Instance1 = new Camera1Animation1(demo, 1); camera1Draw1Instance1 = new Camera1Draw1(demo, 1); }
public StacksScene(Demo demo, string name, int instanceIndex, string info) { this.demo = demo; this.name = name; this.instanceIndexName = " " + instanceIndex.ToString(); this.info = info; // Create a new objects in the scene skyInstance1 = new Sky(demo, 1); quadInstance1 = new Quad(demo, 1); cursorInstance = new Cursor(demo); shotInstance = new Shot(demo); jengaInstance1 = new Jenga(demo, 1); pyramidInstance1 = new Pyramid(demo, 1); wallInstance1 = new Wall(demo, 1); camera1Instance1 = new Camera1(demo, 1); lightInstance = new Lights(demo); // Create a new controllers in the scene skyDraw1Instance1 = new SkyDraw1(demo, 1); cursorDraw1Instance = new CursorDraw1(demo); camera1Animation1Instance1 = new Camera1Animation1(demo, 1); camera1Draw1Instance1 = new Camera1Draw1(demo, 1); }
public MeshesScene(Demo demo, string name, int instanceIndex, string info) { this.demo = demo; this.name = name; this.instanceIndexName = " " + instanceIndex.ToString(); this.info = info; // Create a new objects in the scene skyInstance1 = new Sky(demo, 1); cursorInstance = new Cursor(demo); shotInstance = new Shot(demo); columnInstance1 = new Column(demo, 1); triangleMesh1 = new TriangleMesh1(demo, 1); triangleMesh2 = new TriangleMesh2(demo, 1); torusMesh = new TorusMesh(demo, 1); camera2Instance1 = new Camera2(demo, 1); lightInstance = new Lights(demo); // Create a new controllers in the scene skyDraw1Instance1 = new SkyDraw1(demo, 1); cursorDraw1Instance = new CursorDraw1(demo); camera2Animation1Instance1 = new Camera2Animation1(demo, 1); camera2Draw1Instance1 = new Camera2Draw1(demo, 1); }
public void Create() { string sceneInstanceIndexName = name + instanceIndexName; if (demo.Engine.Factory.PhysicsSceneManager.Find(sceneInstanceIndexName) != null) { return; } scene = demo.Engine.Factory.PhysicsSceneManager.Create(sceneInstanceIndexName); // Initialize maximum number of solver iterations for the scene scene.MaxIterationCount = 10; // Initialize time of simulation for the scene scene.TimeOfSimulation = 1.0f / 15.0f; Initialize(); // Initialize objects in the scene skyInstance1.Initialize(scene); quadInstance1.Initialize(scene); cursorInstance.Initialize(scene); shotInstance.Initialize(scene); helicopter1Instance1.Initialize(scene); helicopter1Instance2.Initialize(scene); helicopter1Instance3.Initialize(scene); helicopter1Instance4.Initialize(scene); camera2Instance1.Initialize(scene); lightInstance.Initialize(scene); // Initialize controllers in the scene skyDraw1Instance1.Initialize(scene); cursorDraw1Instance.Initialize(scene); helicopter1Animation1Instance1.Initialize(scene); helicopter1Animation1Instance2.Initialize(scene); helicopter1Animation1Instance3.Initialize(scene); helicopter1Animation1Instance4.Initialize(scene); camera2Animation1Instance1.Initialize(scene); camera2Draw1Instance1.Initialize(scene); // Create shapes shared for all physics objects in the scene // These shapes are used by all objects in the scene Demo.CreateSharedShapes(demo, scene); // Create shapes for objects in the scene Sky.CreateShapes(demo, scene); Quad.CreateShapes(demo, scene); Cursor.CreateShapes(demo, scene); Shot.CreateShapes(demo, scene); Helicopter1.CreateShapes(demo, scene); Camera2.CreateShapes(demo, scene); Lights.CreateShapes(demo, scene); // Create physics objects for objects in the scene skyInstance1.Create(new Vector3(0.0f, 0.0f, 0.0f)); quadInstance1.Create(new Vector3(0.0f, -40.0f, 20.0f), new Vector3(1000.0f, 31.0f, 1000.0f), Quaternion.Identity); cursorInstance.Create(); shotInstance.Create(); helicopter1Instance1.Create(new Vector3(0.0f, -11.8f, 20.0f), Vector3.One, Quaternion.Identity); helicopter1Instance2.Create(new Vector3(0.0f, -11.8f, 60.0f), Vector3.One, Quaternion.Identity); helicopter1Instance3.Create(new Vector3(0.0f, -11.8f, 100.0f), Vector3.One, Quaternion.Identity); helicopter1Instance4.Create(new Vector3(0.0f, -11.8f, 140.0f), Vector3.One, Quaternion.Identity); camera2Instance1.Create(new Vector3(60.0f, 5.0f, 20.0f), Quaternion.Identity, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(60.0f)), Quaternion.Identity, true); lightInstance.CreateLightPoint(0, "Glass", new Vector3(20.0f, -3.0f, 20.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(1, "Glass", new Vector3(20.0f, -3.0f, 60.0f), new Vector3(0.5f, 0.7f, 0.1f), 20.0f, 1.0f); lightInstance.CreateLightPoint(2, "Glass", new Vector3(20.0f, -3.0f, 100.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(3, "Glass", new Vector3(20.0f, -3.0f, 140.0f), new Vector3(1.0f, 0.7f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(4, "Glass", new Vector3(-10.0f, -3.0f, 20.0f), new Vector3(1.0f, 1.0f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(5, "Glass", new Vector3(-10.0f, -3.0f, 60.0f), new Vector3(0.3f, 0.7f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightSpot(0, "Glass", new Vector3(5.0f, 17.0f, 4.0f), new Vector3(0.1f, 0.7f, 1.0f), 20.0f, 1.0f); lightInstance.CreateLightSpot(1, "Glass", new Vector3(5.0f, 17.0f, 44.0f), new Vector3(1.0f, 0.5f, 0.2f), 20.0f, 1.0f); lightInstance.CreateLightSpot(2, "Glass", new Vector3(5.0f, 17.0f, 84.0f), new Vector3(0.5f, 1.0f, 0.2f), 20.0f, 1.0f); // Set controllers for objects in the scene SetControllers(); }
public void Create() { string sceneInstanceIndexName = name + instanceIndexName; if (demo.Engine.Factory.PhysicsSceneManager.Find(sceneInstanceIndexName) != null) { return; } scene = demo.Engine.Factory.PhysicsSceneManager.Create(sceneInstanceIndexName); // Initialize maximum number of solver iterations for the scene scene.MaxIterationCount = 10; // Initialize time of simulation for the scene scene.TimeOfSimulation = 1.0f / 15.0f; Initialize(); // Initialize objects in the scene skyInstance1.Initialize(scene); quadInstance1.Initialize(scene); cursorInstance.Initialize(scene); shotInstance.Initialize(scene); plant2Instance1.Initialize(scene); building1Instance1.Initialize(scene); car1Instance1.Initialize(scene); ragdoll3Instance1.Initialize(scene); box1Instance1.Initialize(scene); lamp1Instance1.Initialize(scene); lamp1Instance2.Initialize(scene); camera2Instance1.Initialize(scene); lightInstance.Initialize(scene); // Initialize controllers in the scene skyDraw1Instance1.Initialize(scene); cursorDraw1Instance.Initialize(scene); car1Animation1Instance1.Initialize(scene); lamp1Animation1Instance1.Initialize(scene); lamp1Animation1Instance2.Initialize(scene); camera2Animation1Instance1.Initialize(scene); camera2Draw1Instance1.Initialize(scene); // Create shapes shared for all physics objects in the scene // These shapes are used by all objects in the scene Demo.CreateSharedShapes(demo, scene); // Create shapes for objects in the scene Sky.CreateShapes(demo, scene); Quad.CreateShapes(demo, scene); Cursor.CreateShapes(demo, scene); Shot.CreateShapes(demo, scene); Plant2.CreateShapes(demo, scene); Building1.CreateShapes(demo, scene); Car1.CreateShapes(demo, scene); Ragdoll3.CreateShapes(demo, scene); Box1.CreateShapes(demo, scene); Lamp1.CreateShapes(demo, scene); Camera2.CreateShapes(demo, scene); Lights.CreateShapes(demo, scene); // Create physics objects for objects in the scene skyInstance1.Create(new Vector3(0.0f, 0.0f, 0.0f)); quadInstance1.Create(new Vector3(0.0f, -40.0f, 20.0f), new Vector3(1000.0f, 31.0f, 1000.0f), Quaternion.Identity); cursorInstance.Create(); shotInstance.Create(); plant2Instance1.Create(new Vector3(-30.0f, -9.0f, 20.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(10.0f))); building1Instance1.Create(new Vector3(0.0f, 0.0f, 100.0f), Vector3.One, Quaternion.Identity); car1Instance1.Create(new Vector3(10.0f, 0.0f, 40.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(180.0f))); ragdoll3Instance1.Create(new Vector3(-10.0f, -10.0f, 0.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitX, MathHelper.DegreesToRadians(0.0f)), false, false, 0.5f); box1Instance1.Create(new Vector3(40.0f, 0.0f, 50.0f), Vector3.One, Quaternion.Identity, 4, new Vector3(1.0f, 4.0f, 0.1f), 0.02f); lamp1Instance1.Create(new Vector3(-96.0f, 5.0f, 140.0f), Vector3.One, Quaternion.Identity, PhysicsScene.Factory.PhysicsObjectManager.Find("Building 1 Level 1 Wall 3 1")); lamp1Instance2.Create(new Vector3(-96.0f, 5.0f, 220.0f), Vector3.One, Quaternion.Identity, PhysicsScene.Factory.PhysicsObjectManager.Find("Building 1 Level 1 Wall 3 1")); camera2Instance1.Create(new Vector3(0.0f, 5.0f, -22.0f), Quaternion.Identity, Quaternion.Identity, Quaternion.Identity, true); lightInstance.CreateLightPoint(0, "Glass", new Vector3(-30.0f, -3.0f, 90.0f), new Vector3(1.0f, 0.7f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(1, "Glass", new Vector3(0.0f, -3.0f, 90.0f), new Vector3(0.3f, 0.7f, 0.2f), 20.0f, 1.0f); lightInstance.CreateLightPoint(2, "Glass", new Vector3(30.0f, -3.0f, 90.0f), new Vector3(0.3f, 0.7f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(3, "Glass", new Vector3(-20.0f, -3.0f, 20.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(4, "Glass", new Vector3(20.0f, -3.0f, 10.0f), new Vector3(1.0f, 1.0f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(5, "Glass", new Vector3(30.0f, -3.0f, 40.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightSpot(0, "Glass", new Vector3(-30.0f, -3.0f, 15.0f), new Vector3(0.1f, 0.7f, 1.0f), 20.0f, 1.0f); lightInstance.CreateLightSpot(1, "Glass", new Vector3(0.0f, 8.0f, 20.0f), new Vector3(1.0f, 0.5f, 0.2f), 20.0f, 1.0f); lightInstance.CreateLightSpot(2, "Glass", new Vector3(45.0f, 0.0f, 45.0f), new Vector3(0.5f, 1.0f, 0.2f), 20.0f, 1.0f); // Set controllers for objects in the scene SetControllers(); }
public void Create() { string sceneInstanceIndexName = name + instanceIndexName; if (demo.Engine.Factory.PhysicsSceneManager.Find(sceneInstanceIndexName) != null) { return; } scene = demo.Engine.Factory.PhysicsSceneManager.Create(sceneInstanceIndexName); // Initialize maximum number of solver iterations for the scene scene.MaxIterationCount = 10; // Initialize time of simulation for the scene scene.TimeOfSimulation = 1.0f / 15.0f; Initialize(); // Initialize objects in the scene skyInstance1.Initialize(scene); quadInstance1.Initialize(scene); cursorInstance.Initialize(scene); shotInstance.Initialize(scene); userShapesInstance.Initialize(scene); torusMesh1.Initialize(scene); torusMesh2.Initialize(scene); torusMesh3.Initialize(scene); torusMesh4.Initialize(scene); forceField1Instance.Initialize(scene); forceField2Instance.Initialize(scene); switch1Instance.Initialize(scene); switch2Instance.Initialize(scene); camera1Instance1.Initialize(scene); lightInstance.Initialize(scene); // Initialize controllers in the scene skyDraw1Instance1.Initialize(scene); cursorDraw1Instance.Initialize(scene); forceField1Animation1Instance.Initialize(scene); forceField2Animation1Instance.Initialize(scene); switch1Animation1Instance.Initialize(scene); switch2Animation1Instance.Initialize(scene); camera1Animation1Instance1.Initialize(scene); camera1Draw1Instance1.Initialize(scene); // Create shapes shared for all physics objects in the scene // These shapes are used by all objects in the scene Demo.CreateSharedShapes(demo, scene); // Create shapes for objects in the scene Sky.CreateShapes(demo, scene); Quad.CreateShapes(demo, scene); Cursor.CreateShapes(demo, scene); Shot.CreateShapes(demo, scene); UserShapes.CreateShapes(demo, scene); TorusMesh.CreateShapes(demo, scene); ForceField1.CreateShapes(demo, scene); ForceField2.CreateShapes(demo, scene); Switch1.CreateShapes(demo, scene); Switch2.CreateShapes(demo, scene); Camera1.CreateShapes(demo, scene); Lights.CreateShapes(demo, scene); // Create physics objects for objects in the scene skyInstance1.Create(new Vector3(0.0f, 0.0f, 0.0f)); quadInstance1.Create(new Vector3(0.0f, -40.0f, 20.0f), new Vector3(1000.0f, 31.0f, 1000.0f), Quaternion.Identity); cursorInstance.Create(); shotInstance.Create(); userShapesInstance.Create(); torusMesh1.Create(new Vector3(-5.0f, -5.0f, 5.0f), Vector3.One, Quaternion.Identity, 0.0f); torusMesh2.Create(new Vector3(-20.0f, -5.0f, 5.0f), new Vector3(2.0f, 1.0f, 1.0f), Quaternion.FromAxisAngle(Vector3.UnitZ, MathHelper.DegreesToRadians(45.0f)), 0.0f); torusMesh3.Create(new Vector3(-5.0f, 10.0f, 5.0f), Vector3.One, Quaternion.Identity, 100000.0f); torusMesh4.Create(new Vector3(-5.0f, 20.0f, 5.0f), Vector3.One, Quaternion.Identity, 100000.0f); forceField1Instance.Create(); forceField2Instance.Create(); switch1Instance.Create(); switch2Instance.Create(); camera1Instance1.Create(new Vector3(0.0f, 5.0f, -22.0f), Quaternion.Identity, Quaternion.Identity, Quaternion.Identity, true); lightInstance.CreateLightPoint(0, "Glass", new Vector3(-30.0f, 0.0f, 60.0f), new Vector3(0.2f, 1.0f, 1.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(1, "Glass", new Vector3(0.0f, 7.0f, 60.0f), new Vector3(1.0f, 0.5f, 0.1f), 20.0f, 1.0f); lightInstance.CreateLightPoint(2, "Glass", new Vector3(30.0f, 0.0f, 60.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(3, "Glass", new Vector3(-30.0f, 0.0f, 15.0f), new Vector3(1.0f, 0.7f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(4, "Glass", new Vector3(10.0f, 7.0f, 10.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(5, "Glass", new Vector3(40.0f, 0.0f, 15.0f), new Vector3(0.3f, 0.7f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightSpot(0, "Glass", new Vector3(-30.0f, 8.0f, 0.0f), new Vector3(0.1f, 0.7f, 1.0f), 20.0f, 1.0f); lightInstance.CreateLightSpot(1, "Glass", new Vector3(5.0f, 8.0f, -5.0f), new Vector3(1.0f, 0.5f, 0.2f), 20.0f, 1.0f); lightInstance.CreateLightSpot(2, "Glass", new Vector3(30.0f, 8.0f, 0.0f), new Vector3(0.5f, 1.0f, 0.2f), 20.0f, 1.0f); // Set controllers for objects in the scene SetControllers(); }
public void Create() { string sceneInstanceIndexName = name + instanceIndexName; if (demo.Engine.Factory.PhysicsSceneManager.Find(sceneInstanceIndexName) != null) { return; } scene = demo.Engine.Factory.PhysicsSceneManager.Create(sceneInstanceIndexName); // Initialize maximum number of solver iterations for the scene scene.MaxIterationCount = 10; // Initialize time of simulation for the scene scene.TimeOfSimulation = 1.0f / 15.0f; Initialize(); // Initialize objects in the scene skyInstance1.Initialize(scene); cursorInstance.Initialize(scene); shotInstance.Initialize(scene); terrainInstance1.Initialize(scene); lakeInstance1.Initialize(scene); defaultShapesInstance.Initialize(scene); columnInstance1.Initialize(scene); columnInstance2.Initialize(scene); pierInstance1.Initialize(scene); ragdoll2Instance1.Initialize(scene); boat1Instance1.Initialize(scene); car1Instance1.Initialize(scene); box2Instance1.Initialize(scene); crab1Instance1.Initialize(scene); torusMesh.Initialize(scene); camera2Instance1.Initialize(scene); lightInstance.Initialize(scene); // Initialize controllers in the scene skyDraw1Instance1.Initialize(scene); cursorDraw1Instance.Initialize(scene); boat1Animation1Instance1.Initialize(scene); car1Animation1Instance1.Initialize(scene); terrainDraw1Instance1.Initialize(scene); lakeDraw1Instance1.Initialize(scene); camera2Animation1Instance1.Initialize(scene); camera2Draw1Instance1.Initialize(scene); // Create shapes shared for all physics objects in the scene // These shapes are used by all objects in the scene Demo.CreateSharedShapes(demo, scene); // Create shapes for objects in the scene Sky.CreateShapes(demo, scene); Cursor.CreateShapes(demo, scene); Shot.CreateShapes(demo, scene); //terrainInstance1.CreateShapes(demo, scene, 0.0f, false); //lakeInstance1.CreateShapes(demo, scene, 2, 2, 50.0f, 0.95f, 0.04f, 0.04f, 0.5f, 1.0f, 1.0f, 0.2f, 1.0f, 0.0f, false); terrainInstance1.CreateShapes(demo, scene, 0.0f, true); lakeInstance1.CreateShapes(demo, scene, 150, 150, 50.0f, 0.95f, 0.04f, 0.04f, 0.5f, 1.0f, 1.0f, 0.2f, 1.0f, 0.0f, true); DefaultShapes.CreateShapes(demo, scene); Column.CreateShapes(demo, scene); Pier.CreateShapes(demo, scene); Ragdoll2.CreateShapes(demo, scene); Boat1.CreateShapes(demo, scene); Car1.CreateShapes(demo, scene); Box2.CreateShapes(demo, scene); Crab1.CreateShapes(demo, scene); TorusMesh.CreateShapes(demo, scene); Camera2.CreateShapes(demo, scene); Lights.CreateShapes(demo, scene); // Create physics objects for objects in the scene skyInstance1.Create(new Vector3(0.0f, 0.0f, 0.0f)); cursorInstance.Create(); shotInstance.Create(); terrainInstance1.Create(new Vector3(-316.0f, -128.0f, -2072.0f), new Vector3(32.0f, 256.0f, 32.0f), Quaternion.Identity, 0.0f); //lakeInstance1.Create(new Vector3(-316.0f, -100.0f, -2072.0f), new Vector3(2400.0f, 1.0f, 2400.0f), Quaternion.Identity, 0.0f); lakeInstance1.Create(new Vector3(-316.0f, -100.0f, -2072.0f), new Vector3(4.0f, 1.0f, 4.0f), Quaternion.Identity, 0.0f); defaultShapesInstance.Create(); columnInstance1.Create(new Vector3(10.0f, 30.0f, 20.0f), Vector3.One, Quaternion.Identity, "Box", 4, new Vector3(4.0f, 2.0f, 8.0f), 1.0f, true, 0.1f, 0.05f); columnInstance2.Create(new Vector3(20.0f, 30.0f, 20.0f), Vector3.One, Quaternion.Identity, "Box", 5, new Vector3(8.0f, 8.0f, 8.0f), 1.0f, true, 0.1f, 0.05f); pierInstance1.Create(new Vector3(0.0f, 0.0f, 100.0f), Vector3.One, Quaternion.Identity); ragdoll2Instance1.Create(new Vector3(-10.0f, -50.0f, 70.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitX, MathHelper.DegreesToRadians(45.0f)), false, false, 1.0f); boat1Instance1.Create(new Vector3(0.0f, -5.0f, 0.0f), Vector3.One, Quaternion.Identity); car1Instance1.Create(new Vector3(-80.0f, -70.0f, 20.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(-115.0f))); box2Instance1.Create(new Vector3(-20.0f, 0.0f, 40.0f), Vector3.One, Quaternion.Identity, 4, new Vector3(1.0f, 4.0f, 0.1f), 0.02f); crab1Instance1.Create(new Vector3(-90.0f, -75.0f, -40.0f), new Vector3(0.5f, 0.5f, 0.5f), Quaternion.FromAxisAngle(Vector3.UnitX, MathHelper.DegreesToRadians(180.0f))); torusMesh.Create(new Vector3(10.0f, 20.0f, 50.0f), Vector3.One, Quaternion.Identity, 100000.0f); camera2Instance1.Create(new Vector3(50.0f, 5.0f, 40.0f), Quaternion.Identity, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(-220.0f)), Quaternion.Identity, true); lightInstance.CreateLightPoint(0, "Glass", new Vector3(-120.0f, -97.0f, -140.0f), new Vector3(0.1f, 0.9f, 0.2f), 20.0f, 1.0f); lightInstance.CreateLightPoint(1, "Glass", new Vector3(-70.0f, -97.0f, -200.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(2, "Glass", new Vector3(-90.0f, -97.0f, -100.0f), new Vector3(0.0f, 0.7f, 0.8f), 20.0f, 1.0f); lightInstance.CreateLightPoint(3, "Glass", new Vector3(70.0f, -97.0f, -180.0f), new Vector3(1.0f, 0.4f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(4, "Glass", new Vector3(10.0f, -97.0f, -160.0f), new Vector3(0.2f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(5, "Glass", new Vector3(40.0f, -97.0f, -140.0f), new Vector3(0.4f, 0.6f, 1.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(6, "Glass", new Vector3(-40.0f, -95.0f, -190.0f), new Vector3(1.0f, 0.9f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(7, "Glass", new Vector3(-40.0f, -95.0f, -140.0f), new Vector3(0.5f, 0.7f, 0.1f), 20.0f, 1.0f); lightInstance.CreateLightPoint(8, "Glass", new Vector3(-40.0f, -85.0f, -90.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(9, "Glass", new Vector3(-10.0f, -95.0f, -190.0f), new Vector3(1.0f, 0.7f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(10, "Glass", new Vector3(-10.0f, -95.0f, -140.0f), new Vector3(0.3f, 0.7f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(11, "Glass", new Vector3(-10.0f, -85.0f, -90.0f), new Vector3(1.0f, 1.0f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(12, "Glass", new Vector3(-40.0f, -85.0f, -290.0f), new Vector3(0.5f, 0.7f, 0.1f), 20.0f, 1.0f); lightInstance.CreateLightPoint(13, "Glass", new Vector3(-40.0f, -95.0f, -240.0f), new Vector3(1.0f, 1.0f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(14, "Glass", new Vector3(-10.0f, -85.0f, -290.0f), new Vector3(1.0f, 0.9f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(15, "Glass", new Vector3(-10.0f, -95.0f, -240.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(16, "Glass", new Vector3(-60.0f, -69.0f, 20.0f), new Vector3(0.6f, 0.8f, 0.2f), 20.0f, 1.0f); lightInstance.CreateLightPoint(17, "Glass", new Vector3(-20.0f, -55.0f, 45.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(18, "Glass", new Vector3(10.0f, -72.0f, -20.0f), new Vector3(0.8f, 0.7f, 0.2f), 20.0f, 1.0f); lightInstance.CreateLightPoint(19, "Glass", new Vector3(25.0f, -55.0f, 25.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightSpot(0, "Glass", new Vector3(0.0f, -65.0f, 0.0f), new Vector3(1.0f, 0.5f, 0.2f), 20.0f, 1.0f); lightInstance.CreateLightSpot(1, "Glass", new Vector3(-5.0f, -55.0f, 40.0f), new Vector3(0.5f, 1.0f, 0.2f), 20.0f, 1.0f); // Set controllers for objects in the scene SetControllers(); }
public void Create() { string sceneInstanceIndexName = name + instanceIndexName; if (demo.Engine.Factory.PhysicsSceneManager.Find(sceneInstanceIndexName) != null) { return; } scene = demo.Engine.Factory.PhysicsSceneManager.Create(sceneInstanceIndexName); // Initialize maximum number of solver iterations for the scene scene.MaxIterationCount = 10; // Initialize time of simulation for the scene scene.TimeOfSimulation = 1.0f / 15.0f; Initialize(); // Initialize objects in the scene skyInstance1.Initialize(scene); quadInstance1.Initialize(scene); cursorInstance.Initialize(scene); shotInstance.Initialize(scene); columnInstance1.Initialize(scene); cargoJackInstance1.Initialize(scene); pointClothInstance1.Initialize(scene); camera2Instance1.Initialize(scene); lightInstance.Initialize(scene); // Initialize controllers in the scene skyDraw1Instance1.Initialize(scene); cursorDraw1Instance.Initialize(scene); cargoJackAnimation1Instance1.Initialize(scene); camera2Animation1Instance1.Initialize(scene); camera2Draw1Instance1.Initialize(scene); // Create shapes shared for all physics objects in the scene // These shapes are used by all objects in the scene Demo.CreateSharedShapes(demo, scene); // Create shapes for objects in the scene Sky.CreateShapes(demo, scene); Quad.CreateShapes(demo, scene); Cursor.CreateShapes(demo, scene); Shot.CreateShapes(demo, scene); Column.CreateShapes(demo, scene); CargoJack.CreateShapes(demo, scene); PointCloth.CreateShapes(demo, scene); Camera2.CreateShapes(demo, scene); Lights.CreateShapes(demo, scene); // Create physics objects for objects in the scene skyInstance1.Create(new Vector3(0.0f, 0.0f, 0.0f)); quadInstance1.Create(new Vector3(0.0f, -40.0f, 20.0f), new Vector3(1000.0f, 31.0f, 1000.0f), Quaternion.Identity); cursorInstance.Create(); shotInstance.Create(); columnInstance1.Create(new Vector3(12.0f, -9.0f, 0.0f), Vector3.One, Quaternion.Identity, "Box", 4, new Vector3(4.0f, 4.0f, 4.0f), 0.001f, true, 1.0f, 1.0f); cargoJackInstance1.Create(new Vector3(-14.0f, -9.0f, 0.0f), Vector3.One, Quaternion.Identity); pointClothInstance1.Create(new Vector3(0.0f, -1.0f, 0.0f), Vector3.One, Quaternion.Identity, 16, 16, 1.0f, 1.0f, true, 1.0f, 0.1f); pointClothInstance1.Join(1, "Cargo Jack Arm Handle Bottom", "Cargo Jack Arm Handle Bottom", "Cargo Jack Arm Handle Top", "Cargo Jack Arm Handle Top"); camera2Instance1.Create(new Vector3(0.0f, 5.0f, -22.0f), Quaternion.Identity, Quaternion.Identity, Quaternion.Identity, true); lightInstance.CreateLightPoint(0, "Glass", new Vector3(-20.0f, -3.0f, 40.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(1, "Glass", new Vector3(0.0f, -3.0f, 40.0f), new Vector3(0.5f, 0.7f, 0.1f), 20.0f, 1.0f); lightInstance.CreateLightPoint(2, "Glass", new Vector3(20.0f, -3.0f, 40.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(3, "Glass", new Vector3(-40.0f, -3.0f, 0.0f), new Vector3(1.0f, 0.7f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(4, "Glass", new Vector3(0.0f, -3.0f, 0.0f), new Vector3(1.0f, 1.0f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(5, "Glass", new Vector3(30.0f, -3.0f, 0.0f), new Vector3(0.3f, 0.7f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightSpot(0, "Glass", new Vector3(-30.0f, -3.0f, 15.0f), new Vector3(0.1f, 0.7f, 1.0f), 20.0f, 1.0f); lightInstance.CreateLightSpot(1, "Glass", new Vector3(0.0f, -3.0f, 15.0f), new Vector3(1.0f, 0.5f, 0.2f), 20.0f, 1.0f); lightInstance.CreateLightSpot(2, "Glass", new Vector3(45.0f, -3.0f, 15.0f), new Vector3(0.5f, 1.0f, 0.2f), 20.0f, 1.0f); // Set controllers for objects in the scene SetControllers(); }
public void Create() { string sceneInstanceIndexName = name + instanceIndexName; if (demo.Engine.Factory.PhysicsSceneManager.Find(sceneInstanceIndexName) != null) { return; } scene = demo.Engine.Factory.PhysicsSceneManager.Create(sceneInstanceIndexName); // Initialize maximum number of solver iterations for the scene scene.MaxIterationCount = 10; // Initialize time of simulation for the scene scene.TimeOfSimulation = 1.0f / 15.0f; Initialize(); // Initialize objects in the scene skyInstance1.Initialize(scene); cursorInstance.Initialize(scene); shotInstance.Initialize(scene); columnInstance1.Initialize(scene); triangleMesh1.Initialize(scene); triangleMesh2.Initialize(scene); torusMesh.Initialize(scene); camera2Instance1.Initialize(scene); lightInstance.Initialize(scene); // Initialize controllers in the scene skyDraw1Instance1.Initialize(scene); cursorDraw1Instance.Initialize(scene); camera2Animation1Instance1.Initialize(scene); camera2Draw1Instance1.Initialize(scene); // Create shapes shared for all physics objects in the scene // These shapes are used by all objects in the scene Demo.CreateSharedShapes(demo, scene); // Create shapes for objects in the scene Sky.CreateShapes(demo, scene); Cursor.CreateShapes(demo, scene); Shot.CreateShapes(demo, scene); Column.CreateShapes(demo, scene); TriangleMesh1.CreateShapes(demo, scene); TriangleMesh2.CreateShapes(demo, scene); TorusMesh.CreateShapes(demo, scene); Camera2.CreateShapes(demo, scene); Lights.CreateShapes(demo, scene); // Create physics objects for objects in the scene skyInstance1.Create(new Vector3(0.0f, 0.0f, 0.0f)); cursorInstance.Create(); shotInstance.Create(); columnInstance1.Create(new Vector3(-500.0f, -20.0f, 1000.0f), Vector3.One, Quaternion.Identity, "Box", 4, new Vector3(8.0f, 8.0f, 8.0f), 1.0f, true, 0.1f, 0.05f); triangleMesh1.Create(new Vector3(0.0f, 60.0f, 0.0f), Vector3.One, Quaternion.Identity, 0.0f); triangleMesh2.Create(new Vector3(0.0f, 60.0f, 0.0f), Vector3.One, Quaternion.Identity, 0.0f); torusMesh.Create(new Vector3(-550.0f, -20.0f, 1000.0f), Vector3.One, Quaternion.Identity, 100000.0f); camera2Instance1.Create(new Vector3(-550.0f, -90.0f, 1020.0f), Quaternion.Identity, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(-95.0f)), Quaternion.Identity, true); lightInstance.CreateLightPoint(0, "Glass", new Vector3(-530.0f, -106.0f, 1020.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(1, "Glass", new Vector3(-500.0f, -116.0f, 1040.0f), new Vector3(0.5f, 0.7f, 0.1f), 20.0f, 1.0f); lightInstance.CreateLightPoint(2, "Glass", new Vector3(-470.0f, -124.0f, 1040.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(3, "Glass", new Vector3(45.0f, -275.0f, 380.0f), new Vector3(1.0f, 0.7f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(4, "Glass", new Vector3(0.0f, -100.0f, 0.0f), new Vector3(1.0f, 1.0f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(5, "Glass", new Vector3(-470.0f, -124.0f, 1020.0f), new Vector3(0.3f, 0.7f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightSpot(0, "Glass", new Vector3(-530.0f, -104.0f, 1000.0f), new Vector3(0.1f, 0.7f, 1.0f), 20.0f, 1.0f); lightInstance.CreateLightSpot(1, "Glass", new Vector3(-500.0f, -114.0f, 1020.0f), new Vector3(1.0f, 0.5f, 0.2f), 20.0f, 1.0f); lightInstance.CreateLightSpot(2, "Glass", new Vector3(-470.0f, -124.0f, 1000.0f), new Vector3(0.5f, 1.0f, 0.2f), 20.0f, 1.0f); // Set controllers for objects in the scene SetControllers(); }
public void Create() { string sceneInstanceIndexName = name + instanceIndexName; if (demo.Engine.Factory.PhysicsSceneManager.Find(sceneInstanceIndexName) != null) { return; } scene = demo.Engine.Factory.PhysicsSceneManager.Create(sceneInstanceIndexName); // Initialize maximum number of solver iterations for the scene scene.MaxIterationCount = 10; // Initialize time of simulation for the scene scene.TimeOfSimulation = 1.0f / 15.0f; Initialize(); // Initialize objects in the scene skyInstance1.Initialize(scene); quadInstance1.Initialize(scene); cursorInstance.Initialize(scene); shotInstance.Initialize(scene); building1Instance1.Initialize(scene); building2Instance1.Initialize(scene); bridge2Instance1.Initialize(scene); camera2Instance1.Initialize(scene); lightInstance.Initialize(scene); // Initialize controllers in the scene skyDraw1Instance1.Initialize(scene); cursorDraw1Instance.Initialize(scene); camera2Animation1Instance1.Initialize(scene); camera2Draw1Instance1.Initialize(scene); pointLightAnimation1Instance1.Initialize(scene); // Create shapes shared for all physics objects in the scene // These shapes are used by all objects in the scene Demo.CreateSharedShapes(demo, scene); // Create shapes for objects in the scene Sky.CreateShapes(demo, scene); Quad.CreateShapes(demo, scene); Cursor.CreateShapes(demo, scene); Shot.CreateShapes(demo, scene); Building1.CreateShapes(demo, scene); Building2.CreateShapes(demo, scene); Bridge2.CreateShapes(demo, scene); Camera2.CreateShapes(demo, scene); Lights.CreateShapes(demo, scene); // Create physics objects for objects in the scene skyInstance1.Create(new Vector3(0.0f, 0.0f, 0.0f)); quadInstance1.Create(new Vector3(0.0f, -40.0f, 20.0f), new Vector3(1000.0f, 31.0f, 1000.0f), Quaternion.Identity); cursorInstance.Create(); shotInstance.Create(); building1Instance1.Create(new Vector3(0.0f, 0.0f, 100.0f), Vector3.One, Quaternion.Identity); building2Instance1.Create(new Vector3(0.0f, 0.0f, -100.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(180.0f))); PhysicsObject startObject = PhysicsScene.Factory.PhysicsObjectManager.Find("Building 2 Level 2 Wall 42 1"); PhysicsObject endObject = PhysicsScene.Factory.PhysicsObjectManager.Find("Building 1 Level 3 Wall 43 1"); startObject.MainWorldTransform.GetPosition(ref startPosition); startObject.MainWorldTransform.GetScale(ref startScale); endObject.MainWorldTransform.GetPosition(ref endPosition); endObject.MainWorldTransform.GetScale(ref endScale); startPosition += new Vector3(0.0f, startScale.Z, startScale.Y); endPosition += new Vector3(0.0f, endScale.Y, -endScale.Z); bridge2Instance1.Create(startObject, endObject, startPosition, endPosition, 20, new Vector2(15.0f, 0.4f)); camera2Instance1.Create(new Vector3(0.0f, 120.0f, -22.0f), Quaternion.Identity, Quaternion.Identity, Quaternion.Identity, true); lightInstance.CreateLightPoint(0, "Glass", new Vector3(60.0f, 115.0f, -200.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(1, "Glass", new Vector3(40.0f, 102.0f, -180.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(2, "Glass", new Vector3(40.0f, 102.0f, -220.0f), new Vector3(1.0f, 0.2f, 0.1f), 20.0f, 1.0f); lightInstance.CreateLightPoint(3, "Glass", new Vector3(-40.0f, 46.0f, -298.0f), new Vector3(0.3f, 0.7f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(4, "Glass", new Vector3(-15.0f, 28.0f, -298.0f), new Vector3(0.0f, 0.7f, 0.8f), 20.0f, 1.0f); lightInstance.CreateLightPoint(5, "Glass", new Vector3(10.0f, 5.0f, -298.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(6, "Glass", new Vector3(-30.0f, -3.0f, -90.0f), new Vector3(1.0f, 0.9f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(7, "Glass", new Vector3(0.0f, -3.0f, -90.0f), new Vector3(0.5f, 0.7f, 0.1f), 20.0f, 1.0f); lightInstance.CreateLightPoint(8, "Glass", new Vector3(30.0f, -3.0f, -90.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(9, "Glass", new Vector3(-30.0f, -3.0f, 90.0f), new Vector3(1.0f, 0.7f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(10, "Glass", new Vector3(0.0f, -3.0f, 90.0f), new Vector3(0.3f, 0.7f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(11, "Glass", new Vector3(30.0f, -3.0f, 90.0f), new Vector3(1.0f, 1.0f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(12, "Field", new Vector3(0.0f, -3.0f, 0.0f), new Vector3(0.2f, 1.0f, 0.0f), 20.0f, 0.0001f); lightInstance.CreateLightSpot(0, "Glass", new Vector3(-30.0f, 117.0f, 180.0f), new Vector3(0.1f, 0.7f, 1.0f), 20.0f, 1.0f); lightInstance.CreateLightSpot(1, "Glass", new Vector3(0.0f, 117.0f, 150.0f), new Vector3(1.0f, 0.5f, 0.2f), 20.0f, 1.0f); lightInstance.CreateLightSpot(2, "Glass", new Vector3(30.0f, 117.0f, 180.0f), new Vector3(0.5f, 1.0f, 0.2f), 20.0f, 1.0f); // Set controllers for objects in the scene SetControllers(); }
public void Create() { string sceneInstanceIndexName = name + instanceIndexName; if (demo.Engine.Factory.PhysicsSceneManager.Find(sceneInstanceIndexName) != null) { return; } scene = demo.Engine.Factory.PhysicsSceneManager.Create(sceneInstanceIndexName); // Initialize maximum number of solver iterations for the scene scene.MaxIterationCount = 15; // Initialize time of simulation for the scene scene.TimeOfSimulation = 1.0f / 15.0f; Initialize(); // Initialize objects in the scene skyInstance1.Initialize(scene); quadInstance1.Initialize(scene); cursorInstance.Initialize(scene); shotInstance.Initialize(scene); jengaInstance1.Initialize(scene); pyramidInstance1.Initialize(scene); wallInstance1.Initialize(scene); camera1Instance1.Initialize(scene); lightInstance.Initialize(scene); // Initialize controllers in the scene skyDraw1Instance1.Initialize(scene); cursorDraw1Instance.Initialize(scene); camera1Animation1Instance1.Initialize(scene); camera1Draw1Instance1.Initialize(scene); // Create shapes shared for all physics objects in the scene // These shapes are used by all objects in the scene Demo.CreateSharedShapes(demo, scene); // Create shapes for objects in the scene Sky.CreateShapes(demo, scene); Quad.CreateShapes(demo, scene); Cursor.CreateShapes(demo, scene); Shot.CreateShapes(demo, scene); Jenga.CreateShapes(demo, scene); Pyramid.CreateShapes(demo, scene); Wall.CreateShapes(demo, scene); Camera1.CreateShapes(demo, scene); Lights.CreateShapes(demo, scene); // Create physics objects for objects in the scene skyInstance1.Create(new Vector3(0.0f, 0.0f, 0.0f)); quadInstance1.Create(new Vector3(0.0f, -40.0f, 20.0f), new Vector3(1000.0f, 31.0f, 1000.0f), Quaternion.Identity); cursorInstance.Create(); shotInstance.Create(); jengaInstance1.Create(new Vector3(-30.0f, -9.0f, 20.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(60.0f)), "Box", 16, 3, new Vector3(2.0f, 2.0f, 2.0f), 1.0f, true); pyramidInstance1.Create(new Vector3(0.0f, -9.0f, 20.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(-45.0f)), "Box", 14, new Vector3(2.0f, 2.0f, 2.0f), 1.0f, true); wallInstance1.Create(new Vector3(30.0f, -9.0f, 20.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(-100.0f)), "Box", 12, new Vector3(2.0f, 2.0f, 2.0f), 1.0f, true); camera1Instance1.Create(new Vector3(0.0f, 5.0f, -22.0f), Quaternion.Identity, Quaternion.Identity, Quaternion.Identity, true); lightInstance.CreateLightPoint(0, "Glass", new Vector3(-30.0f, 0.0f, 40.0f), new Vector3(0.2f, 1.0f, 1.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(1, "Glass", new Vector3(0.0f, 0.0f, 40.0f), new Vector3(1.0f, 0.5f, 0.1f), 20.0f, 1.0f); lightInstance.CreateLightPoint(2, "Glass", new Vector3(20.0f, 0.0f, 40.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f); lightInstance.CreateLightPoint(3, "Glass", new Vector3(-30.0f, 7.0f, 15.0f), new Vector3(1.0f, 0.7f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(4, "Glass", new Vector3(0.0f, 7.0f, 15.0f), new Vector3(1.0f, 1.0f, 0.5f), 20.0f, 1.0f); lightInstance.CreateLightPoint(5, "Glass", new Vector3(20.0f, 7.0f, 15.0f), new Vector3(0.7f, 0.5f, 0.2f), 20.0f, 1.0f); lightInstance.CreateLightSpot(0, "Glass", new Vector3(-20.0f, 8.0f, 15.0f), new Vector3(0.1f, 0.7f, 1.0f), 20.0f, 1.0f); lightInstance.CreateLightSpot(1, "Glass", new Vector3(0.0f, 8.0f, 5.0f), new Vector3(1.0f, 0.5f, 0.2f), 20.0f, 1.0f); lightInstance.CreateLightSpot(2, "Glass", new Vector3(20.0f, 8.0f, 10.0f), new Vector3(0.5f, 1.0f, 0.2f), 20.0f, 1.0f); // Set controllers for objects in the scene SetControllers(); }