ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/fvect.h
(Generate patch)

Comparing ray/src/common/fvect.h (file contents):
Revision 2.17 by greg, Thu Dec 4 05:26:27 2014 UTC vs.
Revision 2.21 by greg, Fri Jul 23 17:54:47 2021 UTC

# Line 19 | Line 19 | extern "C" {
19   #endif
20   #define  FHUGE          (1e10)
21  
22 + #define  FABSEQ(x1,x2)  (fabs((x1)-(x2)) <= FTINY)
23 + #define  FRELEQ(x1,x2)  (fabs((x1)-(x2)) <= FTINY*0.5*(fabs(x1)+fabs(x2)))
24 +
25 + #define  VABSEQ(v,w)    (FABSEQ((v)[0],(w)[0]) && FABSEQ((v)[1],(w)[1]) \
26 +                                && FABSEQ((v)[2],(w)[2]))
27 + #define  VRELEQ(v,w)    (FRELEQ((v)[0],(w)[0]) && FRELEQ((v)[1],(w)[1]) \
28 +                                && FRELEQ((v)[2],(w)[2]))
29 +
30   typedef RREAL  FVECT[3];
31  
32   #define  VCOPY(v1,v2)   ((v1)[0]=(v2)[0],(v1)[1]=(v2)[1],(v1)[2]=(v2)[2])
# Line 33 | Line 41 | typedef RREAL  FVECT[3];
41   #define  VSUM(vr,v1,v2,f)       ((vr)[0]=(v1)[0]+(f)*(v2)[0], \
42                                  (vr)[1]=(v1)[1]+(f)*(v2)[1], \
43                                  (vr)[2]=(v1)[2]+(f)*(v2)[2])
44 + #define  VLERP(vr,v1,a,v2)      ((vr)[0]=(1.-(a))*(v1)[0]+(a)*(v2)[0], \
45 +                                (vr)[1]=(1.-(a))*(v1)[1]+(a)*(v2)[1], \
46 +                                (vr)[2]=(1.-(a))*(v1)[2]+(a)*(v2)[2])
47   #define  VCROSS(vr,v1,v2) \
48                          ((vr)[0]=(v1)[1]*(v2)[2]-(v1)[2]*(v2)[1], \
49                          (vr)[1]=(v1)[2]*(v2)[0]-(v1)[0]*(v2)[2], \
# Line 51 | Line 62 | extern double  dist2lseg(const FVECT p, const FVECT ep1
62   extern void     fcross(FVECT vres, const FVECT v1, const FVECT v2);
63   extern void     fvsum(FVECT vres, const FVECT v0, const FVECT v1, double f);
64   extern double   normalize(FVECT v);
65 < extern int      getperpendicular(FVECT vp, const FVECT v);
65 > extern int      getperpendicular(FVECT vp, const FVECT v, int randomize);
66   extern int      closestapproach(RREAL t[2],
67                          const FVECT rorg0, const FVECT rdir0,
68                          const FVECT rorg1, const FVECT rdir1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines