clip.c File Reference
#include "common.h"
#include "vmath.h"
#include "dm.h"
Include dependency graph for clip.c:

Go to the source code of this file.


#define EPSILON   0.0001
#define CLIP_DISTANCE   100000000.0


HIDDEN int code (fastf_t x, fastf_t y)
int clip (fastf_t *xp1, fastf_t *yp1, fastf_t *xp2, fastf_t *yp2)
int vclip (vect_t a, vect_t b, fastf_t *min, fastf_t *max)

Detailed Description

Authors - clip() was started on 14 October 81, Based on the clipping routine in "Principles of Computer Graphics" by Newman and Sproull, 1973, McGraw/Hill.

Definition in file clip.c.

Macro Definition Documentation

#define EPSILON   0.0001

Definition at line 38 of file clip.c.

Referenced by vclip().

#define CLIP_DISTANCE   100000000.0

Definition at line 39 of file clip.c.

Referenced by vclip().

Function Documentation

int vclip ( vect_t  a,
vect_t  b,
fastf_t min,
fastf_t max 

Clip a ray against a rectangular parallelepiped (RPP) that has faces parallel to the coordinate planes (a clipping RPP). The RPP is defined by a minimum point and a maximum point.

Returns - 0 if ray does not hit RPP, !0 if ray hits RPP.

Implicit Return - if !0 was returned, "a" and "b" have been clipped to the RPP.

Definition at line 133 of file clip.c.

References CLIP_DISTANCE, EPSILON, and st.