Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

gtccollider.h

00001 /*
00002     Sebastien Loisel's Toolchest
00003     Copyright (C) 1998 Sebastien Loisel
00004 
00005     $Header: /home/gtc/public_html/gtc-cvs/toolchest/include/gtccollider.h,v 1.8 2000/01/04 04:08:17 loisel Exp $
00006     */
00007 #ifndef Z_COLLIDER_H
00008 #define Z_COLLIDER_H
00009 
00010 #include <gtcutils.h>
00011 
00012 typedef void (*gtcboing)(void *a, void *b, void *data);
00013 /* performance of gtc_collider is roughly nlogn in numb in cases where
00014    the actual number of collisions is small but the constant is large
00015    and in cases where actual number of collisions or near collisions is
00016    large, the algorithm becomes quadratic AND it starts eating up lots
00017    of space. */
00018 typedef struct
00019 {
00020   gtcReal box[3][2];
00021   void *data;
00022 } gtcBBox;
00023 void gtc_collider(gtcBBox *bboxes[], int numb, gtcboing bong,
00024                   void *data);
00025 /* performance is always quadratic, with small constant and doesn't use
00026      any space except that of the parameters. */
00027 void gtc_naive_collider(gtcBBox *bboxes[], int numb, gtcboing bong,
00028                         void *data);
00029 /* experience suggests that for numb>200, gtc_collider becomes superior to
00030      gtc_naive_collider */
00031 
00032 typedef struct _gtcAABBTree gtcAABBTree;
00033 struct _gtcAABBTree
00034 {
00035   gtcReal box[3][2];
00036   gtcAABBTree *left, *right;
00037   int tri;
00038 };
00039 
00040 gtcAABBTree *gtc_make_tree(int (*f)[3], gtcReal (*v)[3], int numf);
00041 int gtc_collide_AABBTrees(gtcAABBTree *A, gtcAABBTree *B,
00042                           gtcReal M[4][4], gtcReal N[4][4],
00043                           int (*cb)(int a, int b, void *data),
00044                           void *data);
00045 
00046 #endif
00047  

Generated at Sat Jul 14 18:53:52 2001 for GTC by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001