physics.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. Copyright (C) 2005, 2010 - Cryptic Sea
  3. This file is part of Gish.
  4. Gish is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License
  6. as published by the Free Software Foundation; either version 2
  7. of the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. See the GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  15. */
  16. void setupphysics(void);
  17. void particlecollision(int particlenum);
  18. void objectcollision(int objectnum);
  19. void objectcollisionobject(int objectnum);
  20. void bondsimulation2(void);
  21. int lineintersectline2(float *intersectpoint,float *normal,float *scale,float *startpoint,float *endpoint,float *vertex1,float *vertex2);
  22. struct
  23. {
  24. int numofbonds;
  25. struct
  26. {
  27. int part1;
  28. int part2;
  29. int part3;
  30. int part4;
  31. int type;
  32. int cycles;
  33. float elasticity;
  34. float length;
  35. float friction;
  36. float breakpoint;
  37. float point[3];
  38. float normal[3];
  39. float force[2];
  40. int objectnum[2];
  41. int blocknum;
  42. int blockx;
  43. int blocky;
  44. float forceapplied[2][3];
  45. } bond[8192];
  46. } physicstemp;
  47. int numoflevellines;
  48. struct
  49. {
  50. float line[2][3];
  51. float normal[3];
  52. float friction;
  53. int blocknum;
  54. int blockx;
  55. int blocky;
  56. } levelline[1024];