source: cpp/frams/vm/classes/3dobject.h @ 222

Last change on this file since 222 was 222, checked in by Maciej Komosinski, 10 years ago

"Distributed" deserializable class registry, so that ExtValue? does not depend on so many other classes

  • Property svn:eol-style set to native
File size: 2.7 KB
Line 
1// This file is a part of the Framsticks GDK.
2// Copyright (C) 1999-2014  Maciej Komosinski and Szymon Ulatowski.  See LICENSE.txt for details.
3// Refer to http://www.framsticks.com/ for further information.
4
5#ifndef _3DOBJECT_H_
6#define _3DOBJECT_H_
7
8#include <frams/util/3d.h>
9#include <frams/util/extvalue.h>
10
11class Pt3D_Ext: public DestrBase
12{
13  public:
14Pt3D p;
15
16Pt3D_Ext(double x,double y,double z):p(x,y,z) {}
17Pt3D_Ext():p(0,0,0) {}
18Pt3D_Ext(const Pt3D &i):p(i) {}
19#define STATRICKCLASS Pt3D_Ext
20PARAMPROCDEF(p_new);
21PARAMPROCDEF(p_newFromVector);
22PARAMPROCDEF(p_clone);
23PARAMGETDEF(length);
24PARAMPROCDEF(p_addvec);
25PARAMPROCDEF(p_subvec);
26PARAMPROCDEF(p_scale);
27PARAMPROCDEF(p_rotate);
28PARAMPROCDEF(p_revrotate);
29PARAMPROCDEF(p_normalize);
30PARAMGETDEF(toString);
31PARAMGETDEF(toVector);
32PARAMPROCDEF(p_set);
33PARAMPROCDEF(p_set3);
34PARAMPROCDEF(p_get);
35#undef STATRICKCLASS
36
37static ParamInterface* getInterface();
38static ExtObject makeStaticObject(Pt3D* p);
39static ExtObject makeDynamicObject(Pt3D_Ext* p);
40static ExtObject makeDynamicObject(const Pt3D& p);
41static Pt3D_Ext* fromObject(const ExtValue& v);
42static Param& getStaticParam();
43static ParamEntry* getStaticParamtab();
44};
45
46class Orient_Ext: public DestrBase
47{
48  public:
49Orient o;
50
51Orient_Ext():o(Orient_1) {}
52Orient_Ext(const Orient& other):o(other) {}
53#define STATRICKCLASS Orient_Ext
54PARAMPROCDEF(p_new);
55PARAMPROCDEF(p_newFromVector);
56PARAMPROCDEF(p_clone);
57PARAMGETDEF(toString);
58PARAMGETDEF(toVector);
59PARAMGETDEF(x);
60PARAMGETDEF(y);
61PARAMGETDEF(z);
62PARAMPROCDEF(p_rotate3);
63PARAMPROCDEF(p_rotate);
64PARAMPROCDEF(p_revrotate);
65PARAMPROCDEF(p_lookat);
66PARAMPROCDEF(p_normalize);
67PARAMPROCDEF(p_between2);
68PARAMPROCDEF(p_betweenOV);
69PARAMPROCDEF(p_set);
70PARAMPROCDEF(p_reset);
71PARAMPROCDEF(p_localToWorld);
72PARAMPROCDEF(p_worldToLocal);
73#undef STATRICKCLASS
74
75static ParamInterface* getInterface();
76static ExtObject makeStaticObject(Orient* p);
77static ExtObject makeDynamicObject(Orient_Ext* p);
78static Orient_Ext* fromObject(const ExtValue& v);
79static Param& getStaticParam();
80static ParamEntry* getStaticParamtab();
81};
82
83class ReferenceObj: public DestrBase
84{
85  public:
86ExtValue *value;
87ExtObject obj;
88int prop;
89
90ReferenceObj(ExtValue *val):value(val) {}
91ReferenceObj() {}
92ReferenceObj(const ExtObject &o,int p):value(0),obj(o),prop(p) {}
93ReferenceObj(const ExtObject &o,const SString &p);
94#define STATRICKCLASS ReferenceObj
95PARAMPROCDEF(p_newS);
96PARAMPROCDEF(p_newO);
97PARAMPROCDEF(p_copyFrom);
98PARAMGETDEF(toString);
99PARAMGETDEF(value);
100PARAMSETDEF(value);
101#undef STATRICKCLASS
102
103static ParamInterface* getInterface();
104static ExtObject makeDynamicObject(ReferenceObj* r);
105static ReferenceObj* fromObject(const ExtValue& v);
106static Param& getStaticParam();
107static ParamEntry* getStaticParamtab();
108};
109
110#endif
Note: See TracBrowser for help on using the repository browser.