I’m tryng to implement collision detection in my engine, but i’m having some problems,
I’m not using the brushes to detect colision, i’m just tryng to detect colision with the faces…,
Each face as this structure:
long start; // First face vertex in the array
long nVertices; // Number of vertices in the face
long TexID; // Texture indice into the texture array
long LmapID; // Lmap ID into the lightmaps array
plane_t p; // plane equation, four floats;
This structure is extracted from a q3 bsp file.
Ok, the way i’m tryng to detect is like this:
For each face,
Normal = next_face->p.A;
Normal = next_face->p.B;
Normal = next_face->p.C;
// Here i get the distance from the camera
to the plane
d = DotProduct(Normal,camera);
d = abs(d);
//I got a radius of 20, from the camera to the planes
This works with same planes, but not to all planes…why ? What i’m doing wrong here ?
p.s–> I’m not using curved surfaces.
thanks for any help,