This project has moved and is read-only. For the latest updates, please go here.

having custom geom issues.. geom not colliding

Apr 30, 2009 at 6:36 PM
hi there. im trying to make a custom geom shape but it doesn't seem to be colliding with he rest of the scene.

pretty much i want to replace this code which works:
            //this.geom_ = GeomFactory.Instance.CreateRectangleGeom(Farseer.Physics, this.body_, 5.5f, 4.7f);  // handels collision for avatarBody
with this code which doesn't:
            Vertices vertices = new Vertices();
            vertices.Add(new Vector2(-2.25f, -2.35f));
            vertices.Add(new Vector2(2.25f, -2.35f));
            vertices.Add(new Vector2(2.25f, 2.35f));
            vertices.Add(new Vector2(-2.25f, 2.35f));

            this.geom_ = new Geom(this.body_, vertices, 11);

i have a feeling it has to do with the physicsSimulator portion of the first code which is not included in the second. Is there a way i can add it in if its the problem? or does it have to do with something else?.
what the result is of the second code is the object just drops though all the other objects as if the collision has been turned off..
thanks for any help
Apr 30, 2009 at 6:40 PM
note i tried adding

but now it only collides with some of the objects..
Apr 30, 2009 at 7:14 PM
try making it a
this.geom = GeomFactory.Instance.PolygonGeom(farseer.physics, body, vertices, 10);


this.geom = new geom
Apr 30, 2009 at 7:31 PM
it turns out my grid cell size was way too large :(
thanks for the help:)