public Geom CreateOdeBox(Ode.Net.Vector3 pos, float density = 1, Ode.Net.Vector3?lengths = null) { int w = 3; Ode.Net.Collision.Box b; if (lengths != null) { b = new Ode.Net.Collision.Box(lengths.Value.X, lengths.Value.Y, lengths.Value.Z); } else { b = new Ode.Net.Collision.Box(w, w, w); } var a = Mass.CreateBox(density, w, w, w); Ode.Net.Body body = new Body(Stuff.World); b.Body = body; body.Mass = a; var tag = new EntityTagInfo(); tag.UseOneColor = true; tag.Color = GetRandomColor(); b.Tag = tag; Stuff.OdeSpace.Add(b); b.SetPosition(ref pos); return(b); }
public static Geom CreateOdeGround() { Ode.Net.Collision.Box b = new Ode.Net.Collision.Box(500, 500, 1); var mass = Mass.CreateBoxTotal(1, 500, 500, 1); //var a = Mass.CreateBox(0, 25, 25, 1); Ode.Net.Body body = new Body(Stuff.World); body.Kinematic = true; body.Mass = mass; var tag = new EntityTagInfo(); b.Tag = tag; tag.UseOneColor = true; tag.Color = GetRandomColor(); Stuff.OdeSpace.Add(b); b.Body = body; body.Kinematic = true; //bode.Mass = mass; return(b); }