Exemple #1
0
        protected virtual void CollideCallback(Ode.Geom o1, Ode.Geom o2)
        {
            ContactGeom[] cgeoms = o1.Collide(o2, 30);
            if (cgeoms.Length > 0)
            {
                Contact[] contacts = Contact.FromContactGeomArray(cgeoms);

                for (int i = 0; i < contacts.Length; i++)
                {
                    contacts[i].Surface.mode       = SurfaceMode.Bounce;
                    contacts[i].Surface.mu         = 100; //World.Infinity;
                    contacts[i].Surface.bounce     = 0.70f;
                    contacts[i].Surface.bounce_vel = 0.05f;
                    ContactJoint cj = new ContactJoint(_world, _contactGroup, contacts[i]);
                    cj.Attach(contacts[i].Geom.Geom1.Body, contacts[i].Geom.Geom2.Body);
                }
            }
        }
Exemple #2
0
        protected virtual void CollideCallback( Ode.Geom o1, Ode.Geom o2 )
        {
            ContactGeom[] cgeoms = o1.Collide( o2, 30 );
            if ( cgeoms.Length > 0 )
            {
                Contact[] contacts = Contact.FromContactGeomArray( cgeoms );

                for ( int i = 0; i < contacts.Length; i++ )
                {
                    contacts[ i ].Surface.mode = SurfaceMode.Bounce;
                    contacts[ i ].Surface.mu = 100;  //World.Infinity;
                    contacts[ i ].Surface.bounce = 0.70f;
                    contacts[ i ].Surface.bounce_vel = 0.05f;
                    ContactJoint cj = new ContactJoint( _world, _contactGroup, contacts[ i ] );
                    cj.Attach( contacts[ i ].Geom.Geom1.Body, contacts[ i ].Geom.Geom2.Body );
                }
            }
        }