home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / source / macraysh.sit / Code / Headers / blob.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-06  |  1.8 KB  |  73 lines

  1. /*
  2.  * blob.h
  3.  *
  4.  * Copyright (C) 1990, 1991, Mark Polipec, Craig E. Kolb
  5.  * All rights reserved.
  6.  *
  7.  * This software may be freely copied, modified, and redistributed
  8.  * provided that this copyright notice is preserved on all copies.
  9.  *
  10.  * You may not distribute this software, in whole or in part, as part of
  11.  * any commercial product without the express consent of the authors.
  12.  *
  13.  * There is no warranty or other guarantee of fitness of this software
  14.  * for any purpose.  It is provided solely "as is".
  15.  *
  16.  * $Id: blob.h,v 4.0 91/07/17 14:36:12 kolb Exp Locker: kolb $
  17.  *
  18.  * $Log:    blob.h,v $
  19.  * Revision 4.0  91/07/17  14:36:12  kolb
  20.  * Initial version.
  21.  * 
  22.  */
  23. #ifndef BLOB_H
  24. #define BLOB_H
  25.  
  26. #define GeomBlobCreate(t,m,n) GeomCreate((GeomRef)BlobCreate(t,m,n), BlobMethods())
  27.  
  28. #define R_START 1
  29. #define R_END   0
  30.  
  31. /*
  32.  * Blob
  33.  */
  34. typedef struct {
  35.     Float rs;    /* radius */
  36.     Float c4;    /* coeefficient */
  37.     Float c2;    /* coeefficient */
  38.     Float c0;    /* coeefficient */
  39.     Float x;    /* x position */
  40.     Float y;    /* y position */
  41.     Float z;    /* z position */
  42. } MetaVector;
  43.  
  44. typedef struct {
  45.     int type,pnt;
  46.     Float bound;
  47.     Float c[5];
  48. } MetaInt;
  49.  
  50. typedef struct {
  51.     Float T;        /* Threshold   */
  52.     int num;        /* number of points */
  53.     MetaVector *list;    /* list of points */
  54.     MetaInt *ilist, **iarr;
  55. } Blob;
  56.  
  57. typedef struct MetaList {
  58.     MetaVector mvec;
  59.     struct MetaList *next;
  60. } MetaList;
  61.  
  62. extern Blob *BlobCreate(Float T, MetaList *mlist, int npoints);
  63. extern Methods *BlobMethods();
  64. extern int BlobIntersect(Blob *blob, Ray *ray, Float mindist, Float *maxdist);
  65. extern int BlobNormal(Blob *blob, Vector *pos, Vector *nrm, Vector *gnrm);
  66. extern void BlobBounds(Blob *blob, Float bounds[2][3]);
  67. extern char *BlobName();
  68. extern void BlobStats(unsigned long *tests, unsigned long *hits);
  69. extern void BlobMethodRegister(UserMethodType meth) ;
  70. extern int MetaCompare(char *A, char *B) ;
  71.  
  72. #endif /* BLOB_H */
  73.