Header to include: iplane.h
Iplane *imodPlanesNew(int size)
void imodPlaneDelete(Iplane *plane)
void imodPlaneInit(Iplane *plane)
void imodPlaneSetPN(Iplane *plane, Ipoint *pnt, Ipoint *nor)
int imodPlaneClip(Iplane *plane, Ipoint *pnt)
int imodPlanesClip(Iplane *plane, int nplanes, Ipoint *pnt)
void imodClipsInitialize(IclipPlanes *clips)
void imodClipsCopy(IclipPlanes *fromClips, IclipPlanes *toClips)
int imodClipsRead(IclipPlanes *clips, FILE *fin)
void imodClipsFixCount(IclipPlanes *clips, b3dUInt32 flags)
void imodPlaneSetFromClips(IclipPlanes *objClips, IclipPlanes *glbClips,
Iplane *plane, int maxPlanes, int *nPlanes)
void imodClipsTrans(IclipPlanes *clips, Imat *mat, Imat *mat2)
Iplane structure
IclipPlanes structure
Allocates an array of size Iplane structure, initializes them, and returns the pointer to the array, or NULL for error.
Frees an array of Iplane structure in plane.
Initializes the Iplane structure in plane to the X/Y plane with a negative Z normal.
Set parameters of plane from a point pnt on a plane and a normal vector nor
Tests whether point pnt is in the half space defined by the clipping plane plane, and returns 1 if it is or 0 if the point needs to be clipped.
Tests whether point pnt is in the region defined by the nplanes clipping planes in plane, and returns 1 if it is or 0 if the point needs to be clipped.
Initializes all clip planes and other parameters of the clip plane set in the IclipPlanes structure clips
Copies the clip planes and parameters of the clip plane set in fromClips to toClips.
Reads all the clip planes of a set into clips from the model file in fin; the number of vectors and normals read is based on the size of the data chunk
Fixes the count of clip planes in clips for old files or for a count set to zero when written in a new file. flags should be the flags from the model structure.
Sets plane parameters in the plane array from the clipping plane sets in both objClips and glbClips, based upon which planes are on in each set. Either objClips or glbClips can be NULL; i.e. one set of planes can be used. maxPlanes should specify the size of the plane array or the maximum number of planes to set. nPlanes is returned with the number of planes set up. It should be set to zero before first the (first) call to this function.
Transforms the clipping planes in clips, using mat to transform the points and mat2 to transform the normals.
typedef struct Mod_Plane { b3dFloat a, b, c, d; } Iplane;
typedef struct Mod_Planes { b3dUByte count; /* number of clip planes. */ b3dUByte flags; /* Which clip planes are on. */ b3dUByte trans; /* Transparency for clipped area */ b3dUByte plane; /* Current clip plane. */ Ipoint normal[IMOD_CLIPSIZE]; /* Normal vector to plane */ Ipoint point[IMOD_CLIPSIZE]; /* Negative of point in clip plane */ } IclipPlanes;