source: golgotha/src/i4/lisp/li_vect.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 12 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.3 KB
Line 
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 LI_VECT_HH
10#define LI_VECT_HH
11
12
13#include "lisp/li_types.hh"
14#include "math/vector.hh"
15#include "lisp/li_class.hh"
16
17extern li_type_number li_vect_type;
18class li_vect : public li_object
19{
20  friend class li_vect_type_function_table;
21  i4_3d_vector *v;
22public:
23  li_vect(i4_3d_vector _v) : v(new i4_3d_vector), li_object(li_vect_type)
24  {
25    *v=_v;
26  }
27
28  li_vect(i4_3d_vector *v) : v(v), li_object(li_vect_type) {}
29
30  i4_3d_vector &value() { return *v; } 
31  static li_vect *get(li_object *o, li_environment *env)
32  { check_type(o, li_vect_type, env); return ((li_vect *)o); }
33} ;
34
35
36
37struct li_vect_class_member : public li_class_member
38{
39  li_vect_class_member(char *name) : li_class_member(name) {}
40  i4_3d_vector &operator()() { return li_vect::get(li_this->get(*this),0)->value(); }
41};
42
43
44#endif
Note: See TracBrowser for help on using the repository browser.