ScummVM API documentation
te_obp.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef TETRAEDGE_TE_TE_OBP_H
23 #define TETRAEDGE_TE_TE_OBP_H
24 
25 #include "tetraedge/te/te_3d_object2.h"
26 #include "tetraedge/te/te_vector2f32.h"
27 #include "tetraedge/te/te_vector3f32.h"
28 
29 namespace Tetraedge {
30 
31 class TeOBP : public Te3DObject2 {
32 public:
33  TeOBP();
34 
35  // Thse functions are overridden in original but just call the super or do
36  // exactly the same as the super..
37  // TeColor color() const override;
38  // byte colorInheritance() override;
39  // TeSignal0Param &onSizeChanged() override;
40  // TeSignal0Param &onWorldColorChanged() override;
41  // TeVector3f32 size() override;
42  // TeColor worldColor() override;
43  // float xSize() override;
44  // float ySize() override;
45  // float zSize() override;
46 
47  void addChild(Te3DObject2 *newchild) override;
48  void addChildBefore(Te3DObject2 *newchild, const Te3DObject2 *ref) override;
49 
50  void removeChild(Te3DObject2 *newchild) override;
51  void removeChildren() override;
52 
53  void setColor(const TeColor &col) override {}
54  void setColorInheritance(bool val) override {}
55 
56  void draw() override {}
57  bool isIn(const TeVector2f32 &pt);
58  bool isIn(const TeVector2f32 &v1, const TeVector2f32 &v2, const TeVector2f32 &v3);
59 
60  void setCorners(const TeVector3f32 &c1, const TeVector3f32 &c2, const TeVector3f32 &c3, const TeVector3f32 &c4);
61 
62  void setPosition(const TeVector3f32 &pos) override;
63  void setRotation(const TeQuaternion &rot) override;
64  void setScale(const TeVector3f32 &scale) override;
65 
66  void setSize(const TeVector3f32 &size) override {}
67  void setZPosition(float z) override {}
68 
69  void translate(const TeVector3f32 &offset) override;
70  void updateTransformed();
71 
72  static void deserialize(Common::ReadStream &stream, TeOBP &dest);
73  static void serialize(Common::WriteStream &stream, const TeOBP &src);
74 
75 private:
76  bool _boundsNeedUpdate;
77 
78  // Pre-transform bounds
79  TeVector3f32 _corner1;
80  TeVector3f32 _corner2;
81  TeVector3f32 _corner3;
82  TeVector3f32 _corner4;
83 
84  // Post-transform bounds
85  TeVector2f32 _transformedTL;
86  TeVector2f32 _transformedBR;
87 
88 };
89 
90 } // end namespace Tetraedge
91 
92 #endif // TETRAEDGE_TE_TE_OBP_H
Definition: detection.h:27
Definition: stream.h:77
Definition: te_quaternion.h:32
Definition: te_color.h:30
Definition: te_3d_object2.h:36
Definition: te_vector3f32.h:33
Definition: stream.h:385
Definition: te_vector2f32.h:32
Definition: te_obp.h:31