Skip to content

Commit

Permalink
Preparing for 0.1.5 Release.
Browse files Browse the repository at this point in the history
  • Loading branch information
jigglex committed Jun 7, 2011
1 parent 0f53125 commit 1d98416
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 81 deletions.
34 changes: 34 additions & 0 deletions Jitter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JitterDemoContent", "Jitter
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "JitterDemo", "JitterDemo", "{5FC265FF-3CD8-4120-905C-B0548A8E1EF4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JitterPhone", "Jitter\JitterPhone.csproj", "{812E48A0-03B3-462F-8873-612A0811865E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jitter360", "Jitter\Jitter360.csproj", "{5054125C-91FF-44F9-8CB8-550B95B1509D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -65,6 +69,36 @@ Global
{5D1B10F2-1490-400F-A178-60D991F2509F}.Release|Windows Phone.ActiveCfg = Release|x86
{5D1B10F2-1490-400F-A178-60D991F2509F}.Release|x86.ActiveCfg = Release|x86
{5D1B10F2-1490-400F-A178-60D991F2509F}.Release|Xbox 360.ActiveCfg = Release|x86
{812E48A0-03B3-462F-8873-612A0811865E}.Debug|Any CPU.ActiveCfg = Debug|Windows Phone
{812E48A0-03B3-462F-8873-612A0811865E}.Debug|Mixed Platforms.ActiveCfg = Debug|Windows Phone
{812E48A0-03B3-462F-8873-612A0811865E}.Debug|Mixed Platforms.Build.0 = Debug|Windows Phone
{812E48A0-03B3-462F-8873-612A0811865E}.Debug|Windows Phone.ActiveCfg = Debug|Windows Phone
{812E48A0-03B3-462F-8873-612A0811865E}.Debug|Windows Phone.Build.0 = Debug|Windows Phone
{812E48A0-03B3-462F-8873-612A0811865E}.Debug|x86.ActiveCfg = Debug|Windows Phone
{812E48A0-03B3-462F-8873-612A0811865E}.Debug|Xbox 360.ActiveCfg = Debug|Windows Phone
{812E48A0-03B3-462F-8873-612A0811865E}.Debug|Xbox 360.Build.0 = Debug|Windows Phone
{812E48A0-03B3-462F-8873-612A0811865E}.Release|Any CPU.ActiveCfg = Release|Windows Phone
{812E48A0-03B3-462F-8873-612A0811865E}.Release|Mixed Platforms.ActiveCfg = Release|Windows Phone
{812E48A0-03B3-462F-8873-612A0811865E}.Release|Mixed Platforms.Build.0 = Release|Windows Phone
{812E48A0-03B3-462F-8873-612A0811865E}.Release|Windows Phone.ActiveCfg = Release|Windows Phone
{812E48A0-03B3-462F-8873-612A0811865E}.Release|Windows Phone.Build.0 = Release|Windows Phone
{812E48A0-03B3-462F-8873-612A0811865E}.Release|x86.ActiveCfg = Release|Windows Phone
{812E48A0-03B3-462F-8873-612A0811865E}.Release|Xbox 360.ActiveCfg = Release|Windows Phone
{812E48A0-03B3-462F-8873-612A0811865E}.Release|Xbox 360.Build.0 = Release|Windows Phone
{5054125C-91FF-44F9-8CB8-550B95B1509D}.Debug|Any CPU.ActiveCfg = Debug|Xbox 360
{5054125C-91FF-44F9-8CB8-550B95B1509D}.Debug|Mixed Platforms.ActiveCfg = Debug|Xbox 360
{5054125C-91FF-44F9-8CB8-550B95B1509D}.Debug|Mixed Platforms.Build.0 = Debug|Xbox 360
{5054125C-91FF-44F9-8CB8-550B95B1509D}.Debug|Windows Phone.ActiveCfg = Debug|Xbox 360
{5054125C-91FF-44F9-8CB8-550B95B1509D}.Debug|x86.ActiveCfg = Debug|Xbox 360
{5054125C-91FF-44F9-8CB8-550B95B1509D}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360
{5054125C-91FF-44F9-8CB8-550B95B1509D}.Debug|Xbox 360.Build.0 = Debug|Xbox 360
{5054125C-91FF-44F9-8CB8-550B95B1509D}.Release|Any CPU.ActiveCfg = Release|Xbox 360
{5054125C-91FF-44F9-8CB8-550B95B1509D}.Release|Mixed Platforms.ActiveCfg = Release|Xbox 360
{5054125C-91FF-44F9-8CB8-550B95B1509D}.Release|Mixed Platforms.Build.0 = Release|Xbox 360
{5054125C-91FF-44F9-8CB8-550B95B1509D}.Release|Windows Phone.ActiveCfg = Release|Xbox 360
{5054125C-91FF-44F9-8CB8-550B95B1509D}.Release|x86.ActiveCfg = Release|Xbox 360
{5054125C-91FF-44F9-8CB8-550B95B1509D}.Release|Xbox 360.ActiveCfg = Release|Xbox 360
{5054125C-91FF-44F9-8CB8-550B95B1509D}.Release|Xbox 360.Build.0 = Release|Xbox 360
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
1 change: 0 additions & 1 deletion Jitter/Collision/CollisionSystemSAP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public int Compare(IBroadphaseEntity body1, IBroadphaseEntity body2)
/// </summary>
public CollisionSystemSAP()
{
//xComparer = new Comparison<IBroadphaseEntity>(Compare);
xComparer = new IBroadphaseEntityXCompare();
detectCallback = new Action<object>(DetectCallback);
}
Expand Down
7 changes: 5 additions & 2 deletions Jitter/Jitter360.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</PropertyGroup>
<ItemGroup />
<ItemGroup>
<Compile Include="Collision\CollisionIsland.cs" />
<Compile Include="Collision\CollisionIsland.cs" />
<Compile Include="Collision\CollisionSystem.cs" />
<Compile Include="Collision\CollisionSystemBrute.cs" />
<Compile Include="Collision\CollisionSystemSAP.cs" />
Expand All @@ -62,6 +62,7 @@
<Compile Include="Collision\Shapes\TriangleMeshShape.cs" />
<Compile Include="Collision\XenoCollide.cs" />
<Compile Include="DataStructures\Hashset.cs" />
<Compile Include="DataStructures\ReadOnlyHashset.cs" />
<Compile Include="Dynamics\Arbiter.cs" />
<Compile Include="Dynamics\ArbiterMap.cs" />
<Compile Include="Dynamics\Constraints\FixedAngle.cs" />
Expand All @@ -78,16 +79,18 @@
<Compile Include="Dynamics\Joints\Joint.cs" />
<Compile Include="Dynamics\Material.cs" />
<Compile Include="Dynamics\RigidBody.cs" />
<Compile Include="Collision\DynamicTree.cs" />
<Compile Include="IDebugDraw.cs" />
<Compile Include="LinearMath\JBBox.cs" />
<Compile Include="LinearMath\JConvexHull.cs" />
<Compile Include="LinearMath\JMath.cs" />
<Compile Include="LinearMath\JMatrix.cs" />
<Compile Include="LinearMath\JOctree.cs" />
<Compile Include="Collision\Octree.cs" />
<Compile Include="LinearMath\JQuaternion.cs" />
<Compile Include="LinearMath\JVector.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ResourcePool.cs" />
<Compile Include="Dynamics\SoftBody.cs" />
<Compile Include="ThreadManager.cs" />
<Compile Include="World.cs" />
</ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion Jitter/JitterPhone.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
<Compile Include="Collision\Shapes\TriangleMeshShape.cs" />
<Compile Include="Collision\XenoCollide.cs" />
<Compile Include="DataStructures\Hashset.cs" />
<Compile Include="DataStructures\ReadOnlyHashset.cs" />
<Compile Include="Dynamics\Arbiter.cs" />
<Compile Include="Dynamics\ArbiterMap.cs" />
<Compile Include="Dynamics\Constraints\FixedAngle.cs" />
Expand All @@ -114,16 +115,18 @@
<Compile Include="Dynamics\Joints\Joint.cs" />
<Compile Include="Dynamics\Material.cs" />
<Compile Include="Dynamics\RigidBody.cs" />
<Compile Include="Collision\DynamicTree.cs" />
<Compile Include="IDebugDraw.cs" />
<Compile Include="LinearMath\JBBox.cs" />
<Compile Include="LinearMath\JConvexHull.cs" />
<Compile Include="LinearMath\JMath.cs" />
<Compile Include="LinearMath\JMatrix.cs" />
<Compile Include="LinearMath\JOctree.cs" />
<Compile Include="Collision\Octree.cs" />
<Compile Include="LinearMath\JQuaternion.cs" />
<Compile Include="LinearMath\JVector.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ResourcePool.cs" />
<Compile Include="Dynamics\SoftBody.cs" />
<Compile Include="ThreadManager.cs" />
<Compile Include="World.cs" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Jitter/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[assembly: AssemblyProduct("Jitter")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCopyright("Copyright © Thorben Linneweber 2010")]
[assembly: AssemblyCopyright("Copyright © Thorben Linneweber 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -29,4 +29,4 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.1.4.8")]
[assembly: AssemblyVersion("0.1.5.0")]
22 changes: 12 additions & 10 deletions Jitter/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -555,16 +555,17 @@ public void Step(float timestep, bool multithread)
CollisionSystem.Detect(multithread);
BuildIslands();
CheckDeactivation();
IntegrateForces();
HandleArbiter(contactIterations, multithread);
Integrate(multithread);

foreach (SoftBody body in softbodies)
{
body.Update(timestep);
body.AddPressureForces(timestep);
}

IntegrateForces();
HandleArbiter(contactIterations, multithread);
Integrate(multithread);

foreach (RigidBody body in rigidBodies) body.PostStep();
events.RaiseWorldPostStep(timestep);
#else
Expand All @@ -589,6 +590,14 @@ public void Step(float timestep, bool multithread)
CheckDeactivation();
sw.Stop(); debugTimes[(int)DebugType.DeactivateBodies] = sw.Elapsed.TotalMilliseconds;

sw.Reset(); sw.Start();
foreach(SoftBody body in softbodies)
{
body.Update(timestep);
body.AddPressureForces(timestep);
}
sw.Stop(); debugTimes[(int)DebugType.ClothUpdate] = sw.Elapsed.TotalMilliseconds;

sw.Reset(); sw.Start();
IntegrateForces();
sw.Stop(); debugTimes[(int)DebugType.IntegrateForces] = sw.Elapsed.TotalMilliseconds;
Expand All @@ -601,13 +610,6 @@ public void Step(float timestep, bool multithread)
Integrate(multithread);
sw.Stop(); debugTimes[(int)DebugType.Integrate] = sw.Elapsed.TotalMilliseconds;

sw.Reset(); sw.Start();
foreach(SoftBody body in softbodies)
{
body.Update(timestep);
body.AddPressureForces(timestep);
}
sw.Stop(); debugTimes[(int)DebugType.ClothUpdate] = sw.Elapsed.TotalMilliseconds;

sw.Reset(); sw.Start();
foreach (RigidBody body in rigidBodies) body.PostStep();
Expand Down
48 changes: 5 additions & 43 deletions JitterDemo/JitterDemo/JitterDemo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ private enum Primitives { box,sphere,cylinder,cone,capsule }

private Color backgroundColor = new Color(63, 66, 73);
private bool multithread = true;
private int activeBodies = 0;

private bool debugDraw = false;

Expand Down Expand Up @@ -87,34 +88,6 @@ public JitterDemo()
cullMode.CullMode = CullMode.None;

normal = new RasterizerState();


CompoundShape.TransformedShape[] subShapes
= new CompoundShape.TransformedShape[12];

for (int i = 0; i < 4; i++)
{
subShapes[i] = new CompoundShape.TransformedShape(new BoxShape(1, 1, 1), JMatrix.Identity, new JVector(0, i, 0));
}

for (int i = 4; i < 8; i++)
{
subShapes[i] = new CompoundShape.TransformedShape(new BoxShape(1, 1, 1), JMatrix.Identity, new JVector(0, i-4, 5));
}

for (int i = 8; i < 12; i++)
{
subShapes[i] = new CompoundShape.TransformedShape(new BoxShape(1, 1, 1), JMatrix.Identity, new JVector(0, 0, i-7));
}

CompoundShape compound = new CompoundShape(subShapes);
RigidBody compoundBody = new RigidBody(compound);

System.Diagnostics.Debug.WriteLine(compound.Shift.ToString());

World.AddBody(compoundBody);

compoundBody.Position = new JVector(0, 35, 0);
}


Expand Down Expand Up @@ -207,8 +180,6 @@ private void RemoveComponents()
}
}



protected override void Update(GameTime gameTime)
{
GamePadState padState = GamePad.GetState(PlayerIndex.One);
Expand Down Expand Up @@ -325,15 +296,10 @@ protected override void Update(GameTime gameTime)

float step = (float)gameTime.ElapsedGameTime.TotalSeconds;

//World.StepFixed(step, true, 1.0f / 60.0f, 1);

if (step > 1.0f / 100.0f) step = 1.0f / 100.0f;

World.Step(1.0f/100.0f, multithread);

//if(!keyboardPreviousState.IsKeyDown(Keys.Space) && keyState.IsKeyDown(Keys.Space))
// World.Step(step,multithread);

gamePadPreviousState = padState;
keyboardPreviousState = keyState;
mousePreviousState = mouseState;
Expand All @@ -358,8 +324,7 @@ private void SpawnRandomPrimitive(JVector position, JVector velocity)
int rndn = random.Next(7);

// less of the more advanced objects
//if (rndn == 5 || rndn == 6) rndn = random.Next(7);
//if (rndn == 5 || rndn == 6) rndn = random.Next(7);
if (rndn == 5 || rndn == 6) rndn = random.Next(7);

switch (rndn)
{
Expand Down Expand Up @@ -623,8 +588,7 @@ private void DrawIslands()
}
#endregion

int activeBodies = 0;

#region Draw Cloth
VertexPositionColor[] triangles = new VertexPositionColor[8000];

private void DrawCloth()
Expand All @@ -633,7 +597,6 @@ private void DrawCloth()
{
this.GraphicsDevice.RasterizerState = cullMode;


for (int i = 0; i < body.Triangles.Count; i++)
{
triangles[i * 3 + 0] = new VertexPositionColor(
Expand All @@ -653,14 +616,13 @@ private void DrawCloth()
DrawDynamicTree(body);
}
}
#endregion

protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(backgroundColor);
GraphicsDevice.DepthStencilState = DepthStencilState.Default;

//GraphicsDevice.RasterizerState = wireframe;


BasicEffect.View = Camera.View;
BasicEffect.Projection = Camera.Projection;

Expand Down
2 changes: 1 addition & 1 deletion JitterDemo/JitterDemo/PhysicsObjects/Vehicle/CarObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private void DrawChassis()
{
Matrix matrix = Conversion.ToXNAMatrix(carBody.Orientation);
matrix.Translation = Conversion.ToXNAVector(carBody.Position) -
Vector3.Transform(new Vector3(0,0.5f,0),matrix);
Vector3.Transform(new Vector3(0,1.0f,0),matrix);

effect.EnableDefaultLighting();
effect.World = matrix;
Expand Down
8 changes: 4 additions & 4 deletions JitterDemo/JitterDemo/PhysicsObjects/Vehicle/DefaultCar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ public DefaultCar(World world,Shape shape) : base(shape)
this.SteerRate = 5.0f;

// create default wheels
wheels[(int)WheelPosition.FrontLeft] = new Wheel(world, this, JVector.Left + 1.8f * JVector.Forward + 0.4f * JVector.Down,0.6f);
wheels[(int)WheelPosition.FrontRight] = new Wheel(world, this, JVector.Right + 1.8f * JVector.Forward + 0.4f * JVector.Down, 0.6f);
wheels[(int)WheelPosition.BackLeft] = new Wheel(world, this, JVector.Left + 1.8f * JVector.Backward + 0.4f * JVector.Down, 0.6f);
wheels[(int)WheelPosition.BackRight] = new Wheel(world, this, JVector.Right + 1.8f * JVector.Backward + 0.4f * JVector.Down, 0.6f);
wheels[(int)WheelPosition.FrontLeft] = new Wheel(world, this, JVector.Left + 1.8f * JVector.Forward + 0.8f * JVector.Down,0.4f);
wheels[(int)WheelPosition.FrontRight] = new Wheel(world, this, JVector.Right + 1.8f * JVector.Forward + 0.8f * JVector.Down, 0.4f);
wheels[(int)WheelPosition.BackLeft] = new Wheel(world, this, JVector.Left + 1.8f * JVector.Backward + 0.8f * JVector.Down, 0.4f);
wheels[(int)WheelPosition.BackRight] = new Wheel(world, this, JVector.Right + 1.8f * JVector.Backward + 0.8f * JVector.Down, 0.4f);

AdjustWheelValues();
}
Expand Down
22 changes: 6 additions & 16 deletions JitterDemo/JitterDemo/Scenes/SoftBodyJenga.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,13 @@ public override void Build()
ConvexHullObject.ExtractData(vertices, indices, model);
RemoveDuplicateVertices(indices, vertices);

for (int i = 0; i < 3; i++)
{
SoftBody softBody = new SoftBody(indices, vertices);

if (i % 2 == 0) softBody.Rotate(JMatrix.CreateRotationY(JMath.PiOver2), JVector.Zero);
softBody.Translate(new JVector(10, 10 - i * 3, 0));
softBody.Pressure =1000.0f;
softBody.SetSpringValues(0.1f, 0.001f);
//softBody.TriangleExpansion = 0.05f;
SoftBody softBody = new SoftBody(indices, vertices);

Demo.World.AddBody(softBody);
softBody.Translate(new JVector(10, 5, 0));
softBody.Pressure = 1000.0f;
softBody.SetSpringValues(0.2f, 0.005f);

if (i == 0)
{
foreach (SoftBody.MassPoint point in softBody.VertexBodies) point.IsStatic = true;
}
}
Demo.World.AddBody(softBody);

indices.Clear(); vertices.Clear();
model = this.Demo.Content.Load<Model>("cloth");
Expand All @@ -113,7 +103,7 @@ public override void Build()
cloth.VertexBodies[234].IsStatic = true;
cloth.VertexBodies[356].IsStatic = true;

cloth.SetSpringValues(0.3f, 0.01f);
cloth.SetSpringValues(0.1f, 0.01f);

Demo.World.AddBody(cloth);
}
Expand Down
1 change: 0 additions & 1 deletion JitterDemo/JitterDemoContent/JitterDemoContent.contentproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
<Importer>XImporter</Importer>
<Processor>ModelProcessor</Processor>
<ProcessorParameters_Scale>10</ProcessorParameters_Scale>
<ProcessorParameters_RotationX>90</ProcessorParameters_RotationX>
</Compile>
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit 1d98416

Please sign in to comment.