Skip to content

Commit

Permalink
Fixed some mistakes in the component packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Dec 15, 2015
1 parent 11f3ca6 commit add4075
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
23 changes: 16 additions & 7 deletions component/Details.md
Expand Up @@ -10,32 +10,38 @@ languages.
- Every platform which supports .NET/Mono
- Works with the Mono framework on Linux/Mac without any recompilation
- No dependencies. Every 3D engine/framework is supported: OpenTK, SlimDX,
SharpDX, XNA, IrrlichtEngine
SharpDX, XNA, MonoGame, IrrlichtEngine

**Overall Design**
- Written in pure C# with a clean and object orientated API
- Optimized for low to no garbage collections and maximum speed
- Supported Shapes: TriangleMesh, Terrain, Compound, MinkowskiSum, Box, Sphere,
Cylinder, Cone, Capsule, ConvexHull
- Take advantage of multi-core CPUs by using the internal multithreading of
- Take advantage of multi-core CPUs by using the internal multi-threading of
the engine

## The Samples
_The samples use the [MonoGame][mg] framework and the MonoGame content
pipeline. To build the samples, and the content, the MonoGame content
pipeline needs to be installed using the [MonoGame installer][mg-setup]._

## Quick Start

### Initialize the Physics System
Create a world class and initialize it with a `CollisionSystem`:
Create a `World` instance and initialize it with a `CollisionSystem`:

CollisionSystem collision = new CollisionSystemSAP();
World world = new World(collision);

### Add Objects to the World
Create a shape of your choice and pass it to a body:
Create a shape of your choice, and pass it to a body:

Shape shape = new BoxShape(1.0f, 2.0f, 3.0f);
RigidBody body = new RigidBody(shape);

It's valid to use the same shape for different bodies.
Set the position and orientation of the body by using it's properties.
It is valid to use the same shape for different bodies. The
position and orientation of the body can be set using it's properties.

The next step is to add the `Body` to the world:

world.AddBody(body);
Expand All @@ -53,6 +59,9 @@ This should be done in you main game loop:

The first parameter is the timestep. This value should be as small as possible
to get a stable simulation. The second parameter is for whether using internal
multithreading or not. That's it the body is now simulated and affected by
multi-threading or not. That's it the body is now simulated and affected by
default gravity specified in `World.Gravity`. After each timestep the `Position`
of the body should be different.

[mg]: http://www.monogame.net/
[mg-setup]: http://www.monogame.net/2015/04/29/monogame-3-4/
6 changes: 3 additions & 3 deletions component/GettingStarted.md
Expand Up @@ -85,7 +85,7 @@ Raycasting means that a ray (a line with a start and an direction in
3-dimensional space. here: (1,1,1) and (-100,0,0)) is 'shot' from it's start
along it's direction. The ray 'hits' one of the bodies within the scene and
the collision information is reported back. 'fraction' gives you the
information where (at the ray) the collision occured:
information where (at the ray) the collision occurred:

JVector hitPoint = JVector.One + fraction * (JVector.Right * 100.0 f);

Expand Down Expand Up @@ -135,12 +135,12 @@ physics state a timestep further:
world.Step(1.0f / 100.0f, true);

The first parameter is the timestep, the second one tells the engine to use
internal multithreading or not. In our simple one-body world the box gets
internal multi-threading or not. In our simple one-body world the box gets
affected by gravity and the position changes. In your 'Draw' method you are now
able to draw a box with the position and orientation of the body.

## Complete Sample
Here, we careate a complete physics scene, and simulated using just a few
Here, we create a complete physics scene, and simulated using just a few
lines of code.

private void BuildScene()
Expand Down
2 changes: 1 addition & 1 deletion component/component.yaml
Expand Up @@ -3,7 +3,7 @@
name: Jitter Physics
id: JitterPhysics
publisher: Xamarin Inc
publisher-url: http://dotnetdevaddict.co.za
publisher-url: https://xamarin.com
summary: Jitter Physics is a fast and lightweight physics engine for all managed languages.
version: $version$
src-url: https://github.com/mattleibow/jitterphysics
Expand Down

0 comments on commit add4075

Please sign in to comment.