1 | // This file is a part of the Framsticks GDK. |
---|
2 | // Copyright (C) 2002-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 | |
---|
11 | class Pt3D_Ext: public DestrBase |
---|
12 | { |
---|
13 | public: |
---|
14 | Pt3D p; |
---|
15 | |
---|
16 | Pt3D_Ext(double x,double y,double z):p(x,y,z) {} |
---|
17 | Pt3D_Ext():p(0,0,0) {} |
---|
18 | Pt3D_Ext(const Pt3D &i):p(i) {} |
---|
19 | #define STATRICKCLASS Pt3D_Ext |
---|
20 | PARAMPROCDEF(p_new); |
---|
21 | PARAMPROCDEF(p_newFromVector); |
---|
22 | PARAMPROCDEF(p_clone); |
---|
23 | PARAMGETDEF(length); |
---|
24 | PARAMPROCDEF(p_addvec); |
---|
25 | PARAMPROCDEF(p_subvec); |
---|
26 | PARAMPROCDEF(p_scale); |
---|
27 | PARAMPROCDEF(p_rotate); |
---|
28 | PARAMPROCDEF(p_revrotate); |
---|
29 | PARAMPROCDEF(p_normalize); |
---|
30 | PARAMGETDEF(toString); |
---|
31 | PARAMGETDEF(toVector); |
---|
32 | PARAMPROCDEF(p_set); |
---|
33 | PARAMPROCDEF(p_set3); |
---|
34 | PARAMPROCDEF(p_get); |
---|
35 | #undef STATRICKCLASS |
---|
36 | |
---|
37 | static ParamInterface* getInterface(); |
---|
38 | static ExtObject makeStaticObject(Pt3D* p); |
---|
39 | static ExtObject makeDynamicObject(Pt3D_Ext* p); |
---|
40 | static Pt3D_Ext* fromObject(const ExtValue& v); |
---|
41 | static Param& getStaticParam(); |
---|
42 | static ParamEntry* getStaticParamtab(); |
---|
43 | }; |
---|
44 | |
---|
45 | class Orient_Ext: public DestrBase |
---|
46 | { |
---|
47 | public: |
---|
48 | Orient o; |
---|
49 | |
---|
50 | Orient_Ext():o(Orient_1) {} |
---|
51 | Orient_Ext(const Orient& other):o(other) {} |
---|
52 | #define STATRICKCLASS Orient_Ext |
---|
53 | PARAMPROCDEF(p_new); |
---|
54 | PARAMPROCDEF(p_newFromVector); |
---|
55 | PARAMPROCDEF(p_clone); |
---|
56 | PARAMGETDEF(toString); |
---|
57 | PARAMGETDEF(toVector); |
---|
58 | PARAMGETDEF(x); |
---|
59 | PARAMGETDEF(y); |
---|
60 | PARAMGETDEF(z); |
---|
61 | PARAMPROCDEF(p_rotate3); |
---|
62 | PARAMPROCDEF(p_rotate); |
---|
63 | PARAMPROCDEF(p_revrotate); |
---|
64 | PARAMPROCDEF(p_lookat); |
---|
65 | PARAMPROCDEF(p_normalize); |
---|
66 | PARAMPROCDEF(p_between2); |
---|
67 | PARAMPROCDEF(p_betweenOV); |
---|
68 | PARAMPROCDEF(p_set); |
---|
69 | PARAMPROCDEF(p_reset); |
---|
70 | PARAMPROCDEF(p_localToWorld); |
---|
71 | PARAMPROCDEF(p_worldToLocal); |
---|
72 | #undef STATRICKCLASS |
---|
73 | |
---|
74 | static ParamInterface* getInterface(); |
---|
75 | static ExtObject makeStaticObject(Orient* p); |
---|
76 | static ExtObject makeDynamicObject(Orient_Ext* p); |
---|
77 | static Orient_Ext* fromObject(const ExtValue& v); |
---|
78 | static Param& getStaticParam(); |
---|
79 | static ParamEntry* getStaticParamtab(); |
---|
80 | }; |
---|
81 | |
---|
82 | class ReferenceObj: public DestrBase |
---|
83 | { |
---|
84 | public: |
---|
85 | ExtValue *value; |
---|
86 | ExtObject obj; |
---|
87 | int prop; |
---|
88 | |
---|
89 | ReferenceObj(ExtValue *val):value(val) {} |
---|
90 | ReferenceObj() {} |
---|
91 | ReferenceObj(const ExtObject &o,int p):value(0),obj(o),prop(p) {} |
---|
92 | ReferenceObj(const ExtObject &o,const SString &p); |
---|
93 | #define STATRICKCLASS ReferenceObj |
---|
94 | PARAMPROCDEF(p_newS); |
---|
95 | PARAMPROCDEF(p_newO); |
---|
96 | PARAMPROCDEF(p_copyFrom); |
---|
97 | PARAMGETDEF(toString); |
---|
98 | PARAMGETDEF(value); |
---|
99 | PARAMSETDEF(value); |
---|
100 | #undef STATRICKCLASS |
---|
101 | |
---|
102 | static ParamInterface* getInterface(); |
---|
103 | static ExtObject makeDynamicObject(ReferenceObj* r); |
---|
104 | static ReferenceObj* fromObject(const ExtValue& v); |
---|
105 | static Param& getStaticParam(); |
---|
106 | static ParamEntry* getStaticParamtab(); |
---|
107 | }; |
---|
108 | |
---|
109 | #endif |
---|