public BasicDemo(GraphicsMode mode) : base(800, 600, mode, "BulletSharp OpenTK Demo") { VSync = VSyncMode.Off; physics = new Physics(); }
public override void CreateScene() { // Set ambient light and fog sceneMgr.AmbientLight = new ColourValue(0, 0, 0); sceneMgr.SetFog(FogMode.FOG_LINEAR, skyColor, 0, 150, 300); // Create sun-light Light light = sceneMgr.CreateLight("Sun"); light.Type = Light.LightTypes.LT_POINT; light.Position = new Vector3(150, 100, 150); sceneMgr.ShadowTechnique = ShadowTechnique.SHADOWTYPE_STENCIL_MODULATIVE; sceneMgr.ShadowFarDistance = 100; sceneMgr.ShadowColour = new ColourValue(0.7f, 0.7f, 0.7f); sceneMgr.SetShadowTextureSize(512); // Ground Plane ground = new Plane(Vector3.UNIT_Y, 1); MeshManager.Singleton.CreatePlane("groundPlane", ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME, ground, 500, 500, 20, 20, true, 1, 1, 1, Vector3.UNIT_Z); Entity groundEnt = sceneMgr.CreateEntity("groundPlaneEntity", "groundPlane"); groundEnt.CastShadows = true; groundEnt.SetMaterialName("BoxMaterial/Ground"); planeNode = sceneMgr.RootSceneNode.CreateChildSceneNode(); planeNode.AttachObject(groundEnt); physics = new Physics(sceneMgr); }
protected override void OnInitialize() { PhysicsContext = new Physics(); Freelook.SetEyeTarget(eye, target); Form.Text = "BulletSharp - Basic Demo"; base.OnInitialize(); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { physics = new Physics(); DebugDrawer = new Physics.PhysicsDebugDraw(graphics.GraphicsDevice, basicEffect); physics.World.DebugDrawer = DebugDrawer; base.Initialize(); }
protected override void OnInitialize() { PhysicsContext = new Physics(); Freelook.SetEyeTarget(eye, target); Info.Text = "Move using mouse and WASD+shift\n" + //"F3 - Toggle debug\n" + //"F11 - Toggle fullscreen\n" + "Space - Shoot box"; base.OnInitialize(); }
protected override void OnInitialize() { PhysicsContext = new Physics(); light = new Light(); light.Type = LightType.Point; light.Range = 70; light.Position = new Vector3(10, 25, 10); light.Diffuse = Color.LemonChiffon; light.Attenuation0 = 1.0f; Freelook.SetEyeTarget(eye, target); Fps.Text = "Move using mouse and WASD+shift\n" + "F3 - Toggle debug\n" + "F11 - Toggle fullscreen\n" + "Space - Shoot box"; base.OnInitialize(); }