source: golgotha/src/i4/math/spline.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 11 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 1.7 KB
RevLine 
[80]1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#ifndef I4_BSPLINE_HH
10#define I4_BSPLINE_HH
11
12#include "arch.hh"
13#include "math/num_type.hh"
14
15class i4_file_class;
16class i4_linear_allocator;
17
18class i4_spline_class
19{
20  w32 t_points;
21
22
23  static i4_linear_allocator *p_alloc;
24  static w32 point_refs;
25
26  void cleanup();
27
28public:
29  class point
30  {
31  public:
32    i4_float x,y,z;
33    w32 frame;         // frame in time this point exsist, golgotha runs at 15hz
34
35    i4_bool selected;
36    point *next;
37  };
38
39protected:
40  point *points;
41public:
42  void move(i4_float x_add, i4_float y_add, i4_float z_add);
43
44  point *begin() { return points; }
45  i4_spline_class *next;
46
47  w32 total() { return t_points; }
48
49  point *add_control_point(i4_float x, i4_float y, i4_float z, w32 frame);
50  point *get_control_point(w32 p);
51
52  point *get_control_point_previous_to_frame(w32 frame);
53
54  i4_bool get_point(w32 frame, i4_float &x, i4_float &y, i4_float &z);
55
56  // inserts a new control point after ever selected node
57  void insert_control_points();
58
59  void delete_selected();
60  w32 last_frame();
61  i4_spline_class();
62  ~i4_spline_class();
63
64  void save(i4_file_class *fp);
65  void load(i4_file_class *fp);
66};
67
68
69#endif
Note: See TracBrowser for help on using the repository browser.