/// <summary> /// Implements logic to update any relevant sample state. /// </summary> protected virtual void OnUpdate() { if (Freelook.Update(FrameDelta)) { Device.SetTransform(TransformState.View, Freelook.View); } PhysicsContext.Update(FrameDelta); }
protected override void OnInitialize() { Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - SoftBody Demo"); DemoText = "B - Previous Demo\n" + "N - Next Demo"; }
protected override void OnInitialize() { Freelook.Up = Vector3.UnitY; Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - Character Demo"); DemoText = "Space - Jump"; }
protected virtual void OnUpdate() { if (Freelook.Update(_frameDelta)) { SetSceneConstants(); } PhysicsContext.Update(_frameDelta); }
protected override void OnInitialize() { Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - Distance Demo"); IsDebugDrawEnabled = true; }
protected override void OnInitialize() { PhysicsContext = new Physics(); Freelook.SetEyeTarget(eye, target); Form.Text = "BulletSharp - Basic Demo"; base.OnInitialize(); }
protected override void OnInitialize() { Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - Constraints Demo"); IsDebugDrawEnabled = true; DebugDrawMode = debugMode; }
protected override void OnInitialize() { Physics = new Physics(); IsDebugDrawEnabled = true; Freelook.SetEyeTarget(eye, target); base.OnInitialize(); }
protected override void OnInitialize() { Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - GImpact Test Demo"); DemoText = ". - Shoot Bunny"; Graphics.FarPlane = 400.0f; }
protected override void OnInitialize() { PhysicsContext = new Physics(); Freelook.SetEyeTarget(eye, target); Info.Text = infoText + "\nCCD enabled (P to disable)"; base.OnInitialize(); }
protected override void OnInitialize() { Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - Vehicle Demo"); Graphics.FarPlane = 600.0f; //DebugDrawMode = DebugDrawModes.DrawAabb; IsDebugDrawEnabled = false; }
protected override void OnInitialize() { PhysicsContext = new Physics(); Freelook.SetEyeTarget(eye, target); DemoText = "CCD enabled (P to disable)"; Form.Text = "BulletSharp - CCD Demo"; base.OnInitialize(); }
protected override void OnInitialize() { Physics = new Physics(); Fps.Text = fpsText + "\nCCD enabled (P to disable)"; Freelook.SetEyeTarget(eye, target); base.OnInitialize(); }
protected override void OnInitialize() { Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - Box 2D Demo"); Graphics.SetInfoText("Move using mouse and WASD+shift\n" + "F3 - Toggle debug\n" + //"F11 - Toggle fullscreen\n" + "Space - Shoot box"); }
protected override void OnInitialize() { Freelook.Up = Vector3.UnitY; Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - Character Demo"); Graphics.SetInfoText("Move using arrow keys\n" + "F3 - Toggle debug\n" + //"F11 - Toggle fullscreen\n" + "Space - Jump"); }
protected override void OnInitialize() { Freelook.Up = Vector3.UnitZ; Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - Quake BSP Physics Viewer"); Graphics.SetInfoText("Move using mouse and WASD+shift\n" + "F3 - Toggle debug\n" + //"F11 - Toggle fullscreen\n" + "Space - Shoot box"); }
//Vector3 boxMin = new Vector3(-1, -1, -1); //Vector3 boxMax = new Vector3(1, 1, 1); //Vector3 white = new Vector3(1, 1, 1); protected override void OnInitialize() { Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - Collision Interface Demo"); Graphics.SetInfoText("Move using mouse and WASD+shift\n" + "F3 - Toggle debug\n" + //"F11 - Toggle fullscreen\n" + "Space - Shoot box"); IsDebugDrawEnabled = false; }
protected override void OnInitialize() { Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - Motor Demo"); Graphics.SetInfoText("Move using mouse and WASD+shift\n" + "F3 - Toggle debug\n" + //"F11 - Toggle fullscreen\n" + "Space - Shoot box"); DebugDrawMode = DebugDrawModes.DrawConstraintLimits | DebugDrawModes.DrawConstraints | DebugDrawModes.DrawWireframe; }
protected override void OnInitialize() { Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - Vehicle Demo"); DemoText = "Drive with arrow keys\n" + "Space - break"; Graphics.FarPlane = 600.0f; //DebugDrawMode = DebugDrawModes.DrawAabb; IsDebugDrawEnabled = true; }
protected override void OnInitialize() { Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - Pendulum Demo"); Graphics.SetInfoText("Move using mouse and WASD+shift\n" + "F3 - Toggle debug\n" + //"F11 - Toggle fullscreen\n" + "Space - Shoot box"); IsDebugDrawEnabled = false; DebugDrawMode = DebugDrawModes.DrawWireframe | DebugDrawModes.DrawContactPoints | DebugDrawModes.DrawAabb; }
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() { Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - Concave Raycast Demo"); Graphics.SetInfoText("Move using mouse and WASD+shift\n" + "F3 - Toggle debug\n" + //"F11 - Toggle fullscreen\n" + "Space - Shoot box"); IsDebugDrawEnabled = true; DebugDrawMode = debugMode; }
protected override void OnInitialize() { Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - GImpact Test Demo"); Graphics.SetInfoText("Move using mouse and WASD+shift\n" + "F3 - Toggle debug\n" + //"F11 - Toggle fullscreen\n" + "Space - Shoot box\n" + ". - Shoot Bunny"); Graphics.FarPlane = 400.0f; }
//public CustomVehicle vehicle; protected override void OnInitialize() { Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - Vehicle Demo"); Graphics.SetInfoText("Move using mouse and WASD+shift\n" + "F3 - Toggle debug\n" + //"F11 - Toggle fullscreen\n" + "Space - Shoot box, break\n" + "Drive with arrow keys"); Graphics.FarPlane = 600.0f; //DebugDrawMode = DebugDrawModes.DrawAabb; }
protected override void OnInitialize() { PhysicsContext = new Physics(); PhysicsContext.World.SetInternalTickCallback(PickingPreTickCallback, this, true); DemoText = "B - Previous Demo\n" + "N - Next Demo"; Form.Text = "BulletSharp - SoftBody Demo"; Freelook.SetEyeTarget(eye, target); CullingEnabled = false; base.OnInitialize(); }
protected override void OnInitialize() { Freelook.SetEyeTarget(eye, target); Graphics.SetFormText("BulletSharp - Concave Convexcast Demo"); Graphics.SetInfoText("Move using mouse and WASD+shift\n" + "F3 - Toggle debug\n" + //"F11 - Toggle fullscreen\n" + "Space - Shoot box"); IsDebugDrawEnabled = false; DebugDrawMode = debugMode; const int totalVerts = NumVertsX * NumVertsY; const int totalTriangles = 2 * (NumVertsX - 1) * (NumVertsY - 1); indexVertexArrays = new TriangleIndexVertexArray(); IndexedMesh mesh = new IndexedMesh(); mesh.NumTriangles = totalTriangles; mesh.NumVertices = totalVerts; mesh.TriangleIndexStride = 3 * sizeof(int); mesh.VertexStride = Vector3.SizeInBytes; mesh.TriangleIndexBase = Marshal.AllocHGlobal(mesh.TriangleIndexStride * totalTriangles); mesh.VertexBase = Marshal.AllocHGlobal(mesh.VertexStride * totalVerts); var indicesStream = mesh.GetTriangleStream(); var indices = new BinaryWriter(indicesStream); for (int i = 0; i < NumVertsX - 1; i++) { for (int j = 0; j < NumVertsY - 1; j++) { indices.Write(j * NumVertsX + i); indices.Write(j * NumVertsX + i + 1); indices.Write((j + 1) * NumVertsX + i + 1); indices.Write(j * NumVertsX + i); indices.Write((j + 1) * NumVertsX + i + 1); indices.Write((j + 1) * NumVertsX + i); } } indices.Dispose(); indexVertexArrays.AddIndexedMesh(mesh); convexcastBatch = new ConvexcastBatch(40.0f, 0.0f, -10.0f, 80.0f); //convexcastBatch = new ConvexcastBatch(true, 40.0f, -50.0f, 50.0f); }
protected override void OnInitialize() { PhysicsContext = new Physics(); DebugDrawMode = debugMode; IsDebugDrawEnabled = true; 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(); }
protected override void OnInitialize() { Physics = new Physics(); IsDebugDrawEnabled = true; light = new Light(); light.Type = LightType.Point; light.Range = 70; light.Position = new Vector3(10, 25, 10); light.Diffuse = Color.LemonChiffon; light.Attenuation0 = 0.5f; Freelook.SetEyeTarget(eye, target); base.OnInitialize(); }
protected override void OnInitialize() { PhysicsContext = new Physics(); PhysicsContext.World.SetInternalTickCallback(PickingPreTickCallback, this, true); Info.Text = "Move using mouse and WASD+shift\n" + //"F3 - Toggle debug\n" + //"F11 - Toggle fullscreen\n" + "Space - Shoot box\n\n" + "B - Previous Demo\n" + "N - Next Demo"; Freelook.SetEyeTarget(eye, target); base.OnInitialize(); }
protected override void OnInitialize() { Physics = new Physics(); DebugDrawMode = debugMode; FarPlane = 800f; Freelook.SetEyeTarget(eye, target); Fps.Text = "Move using mouse and WASD+shift\n" + "F3 - Toggle debug\n" + "F11 - Toggle fullscreen\n" + "Space - Shoot box\n" + ". - Shoot Bunny"; base.OnInitialize(); }