home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / misc / aspringies-1.0.lha / ASpringies / src / obj.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-24  |  2.0 KB  |  74 lines

  1. /* obj.h -- ASpringies object handling - defines, types and external variables
  2.  * Copyright (C) 1991  Douglas M. DeCarlo
  3.  *
  4.  * Modifications for the Amiga port Copyright (C) 1994  Torsten Klein
  5.  *
  6.  * This file is part of ASpringies, a mass and spring simulation system for the Amiga
  7.  *
  8.  * ASpringies is free software; you can redistribute it and/or modify
  9.  * it under the terms of the GNU General Public License as published by
  10.  * the Free Software Foundation; either version 1, or (at your option)
  11.  * any later version.
  12.  *
  13.  * ASpringies is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  * GNU General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU General Public License
  19.  * along with ASpringies; see the file COPYING.  If not, write to
  20.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  *
  22.  * $Id: obj.h,v 1.4 1994/06/26 20:48:28 Torsten_Klein Exp $
  23.  */
  24.  
  25. #define S_ALIVE        0x01
  26. #define S_SELECTED    0x02
  27. #define S_FIXED        0x04
  28. #define S_TEMPFIXED    0x08
  29.  
  30. #define ALLOC_SIZE    32
  31.  
  32. typedef struct {
  33.     /* Current position, velocity, acceleration */
  34.     double x, y;
  35.     double vx, vy;
  36.     double ax, ay;
  37.  
  38.     /* Mass and radius of mass */
  39.     double mass;
  40.     double elastic;
  41.     int radius;
  42.  
  43.     /* Connections to springs */
  44.     int *pars;
  45.     int num_pars;
  46.  
  47.     int status;
  48.  
  49.     /* RK temporary space */
  50.     double cur_x, cur_y, cur_vx, cur_vy;
  51.     double old_x, old_y, old_vx, old_vy;
  52.     double test_x, test_y, test_vx, test_vy;
  53.     double k1x, k1y, k1vx, k1vy;
  54.     double k2x, k2y, k2vx, k2vy;
  55.     double k3x, k3y, k3vx, k3vy;
  56.     double k4x, k4y, k4vx, k4vy;
  57. } mass;
  58.  
  59. typedef struct {
  60.     /* Ks, Kd and rest length of spring */
  61.     double ks, kd;
  62.     double restlen;
  63.  
  64.     /* Connected to masses m1 and m2 */
  65.     int m1, m2;
  66.  
  67.     int status;
  68. } spring;
  69.  
  70. extern mass *masses;
  71. extern spring *springs;
  72. extern int num_mass, num_spring, fake_mass, fake_spring;
  73.  
  74.