Exemple #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            var b   = CreateOdeSphere();
            var pos = new Ode.Net.Vector3(0, 0, 15);

            b.SetPosition(ref pos);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public static OpenTK.Vector3 ToTkVector3(Ode.Net.Vector3 position)
 {
     return(new OpenTK.Vector3((float)position.X, (float)position.Y, (float)position.Z));
 }