Skip to content
Snippets Groups Projects
Commit cd1947f3 authored by Vesa Lappalainen's avatar Vesa Lappalainen :bicyclist:
Browse files

liitospisteet merkitty

parent 0e1eacdc
No related branches found
No related tags found
No related merge requests found
......@@ -191,6 +191,12 @@ public class Hirsi : PhysicsObject
}
/// <summary>
/// Luo uuden akseliliitoksen kahden olion välille.
/// </summary>
/// <param name="firstObject">Ensimmäinen olio</param>
/// <param name="secondObject">Toinen olio</param>
/// <param name="axlePosition">Liitoksen akselin paikka</param>
/// <summary>
/// Luo uuden akseliliitoksen kahden olion välille.
/// </summary>
......@@ -210,13 +216,19 @@ public class Hirsi : PhysicsObject
// axlePosition2 * FSConvert.DisplayToSim);
InnerJoint.DampingRatio = 0.5f;
InnerJoint.Frequency = 50;
var dot = new GameObject(20, 20, Shape.Circle);
dot.Color = Color.Red;
dot.Position = firstObject.Position + axlePosition;
firstObject.Add(dot);
//InnerJoint.Enabled = false;
}
}
private static readonly Image Kuva = Game.LoadImage("puupalikka");
private static readonly Image Kuva = Game.LoadImage("puupalikka");
private readonly PhysicsGame peli;
private readonly IntMeter palikoita = new IntMeter(0);
private readonly PhysicsObject taso;
......@@ -303,7 +315,7 @@ public class Hirsi : PhysicsObject
PhysicsObject oikeaKasi = LuoOlio(peli, paa.Position + new Vector(-50 + -65, -20), 150, 40, Game.LoadImage("kasi"));
oikeaKasi.Angle = Angle.FromDegrees(180);
peli.Add(new AxleJoint(torso, oikeaKasi, new Vector(-torso.Width/2, -torso.Height/2)));
peli.Add(new AxleJoint(torso, oikeaKasi, new Vector(-torso.Width/2, torso.Height/2)));
PhysicsObject vasenJalka = LuoOlio(peli, torso.Position + new Vector(40, -110 - 75), 75, 190, Game.LoadImage("jalka"));
peli.Add(new AxleJoint(vasenJalka, torso, new Vector(0, vasenJalka.Height)));
......
......@@ -44,6 +44,10 @@ public class Liitos : PhysicsGame
// axlePosition2 * FSConvert.DisplayToSim);
InnerJoint.DampingRatio = 0.5f;
InnerJoint.Frequency = 50;
var dot = new GameObject(20, 20, Shape.Circle);
dot.Color = Color.Red;
dot.Position = firstObject.Position + axlePosition;
firstObject.Add(dot);
//InnerJoint.Enabled = false;
}
......@@ -63,7 +67,7 @@ public class Liitos : PhysicsGame
osa2.AddCollisionIgnoreGroup(1);
Add(osa2);
var liitos = new AxleJoint(osa1, osa2, new Vector(osa1.Width/2, 0));
liitos.Softness = 0;
// liitos.Softness = 0;
Add(liitos);
var osa3 = new PhysicsObject(200, 30);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment