private void button3_Click(object sender, EventArgs e) { var b = CreateOdeSphere(); var pos = new Ode.Net.Vector3(0, 0, 15); b.SetPosition(ref pos); }
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 OpenTK.Vector3 ToTkVector3(Ode.Net.Vector3 position) { return(new OpenTK.Vector3((float)position.X, (float)position.Y, (float)position.Z)); }