dCollide

@brief Given two geoms o1 and o2 that potentially intersect, generate contact information for them.

Internally, this just calls the correct class-specific collision functions for o1 and o2.

@param o1 The first geom to test. @param o2 The second geom to test.

@param flags The flags specify how contacts should be generated if the geoms touch. The lower 16 bits of flags is an integer that specifies the maximum number of contact points to generate. You must ask for at least one contact. Additionally, following bits may be set: CONTACTS_UNIMPORTANT -- just generate any contacts (skip contact refining). All other bits in flags must be set to zero. In the future the other bits may be used to select from different contact generation strategies.

@param contact Points to an array of dContactGeom structures. The array must be able to hold at least the maximum number of contacts. These dContactGeom structures may be embedded within larger structures in the array -- the skip parameter is the byte offset from one dContactGeom to the next in the array. If skip is sizeof(dContactGeom) then contact points to a normal (C-style) array. It is an error for skip to be smaller than sizeof(dContactGeom).

@returns If the geoms intersect, this function returns the number of contact points generated (and updates the contact array), otherwise it returns 0 (and the contact array is not touched).

@remarks If a space is passed as o1 or o2 then this function will collide all objects contained in o1 with all objects contained in o2, and return the resulting contact points. This method for colliding spaces with geoms (or spaces with spaces) provides no user control over the individual collisions. To get that control, use dSpaceCollide or dSpaceCollide2 instead.

@remarks If o1 and o2 are the same geom then this function will do nothing and return 0. Technically speaking an object intersects with itself, but it is not useful to find contact points in this case.

@remarks This function does not care if o1 and o2 are in the same space or not (or indeed if they are in any space at all).

@ingroup collide

extern (C) nothrow
int
dCollide

Meta