ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

floorface.h

Go to the documentation of this file.
00001 /* ResidualVM - A 3D game interpreter
00002  *
00003  * ResidualVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the AUTHORS
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef STARK_RESOURCES_FLOOR_FACE_H
00024 #define STARK_RESOURCES_FLOOR_FACE_H
00025 
00026 #include "common/array.h"
00027 #include "common/str.h"
00028 
00029 #include "math/ray.h"
00030 #include "math/vector3d.h"
00031 
00032 #include "engines/stark/resources/object.h"
00033 
00034 namespace Stark {
00035 
00036 namespace Formats {
00037 class XRCReadStream;
00038 }
00039 
00040 namespace Resources {
00041 
00042 class FloorEdge;
00043 
00047 class FloorFace : public Object {
00048 public:
00049     static const Type::ResourceType TYPE = Type::kFloorFace;
00050 
00051     FloorFace(Object *parent, byte subType, uint16 index, const Common::String &name);
00052     virtual ~FloorFace();
00053 
00054     // Resource API
00055     virtual void onAllLoaded() override;
00056 
00058     bool isPointInside(const Math::Vector3d &point) const;
00059 
00061     void computePointHeight(Math::Vector3d &point) const;
00062 
00071     bool intersectRay(const Math::Ray &ray, Math::Vector3d &intersection) const;
00072 
00076     float distanceToRay(const Math::Ray &ray) const;
00077 
00079     float getDistanceFromCamera() const;
00080 
00082     int16 getVertexIndex(int32 index) const;
00083 
00085     void addEdge(FloorEdge *edge);
00086 
00088     Common::Array<FloorEdge *> getEdges() const;
00089 
00095     FloorEdge *findNearestEdge(const Math::Vector3d &point) const;
00096 
00098     Math::Vector3d getCenter() const;
00099 
00101     bool hasVertices() const;
00102 
00104     void enable(bool enable);
00105     bool isEnabled() const;
00106 
00107 protected:
00108     void readData(Formats::XRCReadStream *stream) override;
00109     void printData() override;
00110 
00111     int16 _indices[3];
00112     Math::Vector3d _vertices[3];
00113 
00114     Common::Array<FloorEdge *> _edges; // Owned by Floor
00115 
00116     float _distanceFromCamera;
00117     float _unk2;
00118 };
00119 
00120 } // End of namespace Resources
00121 } // End of namespace Stark
00122 
00123 #endif // STARK_RESOURCES_FLOOR_FACE_H


Generated on Sat Feb 16 2019 05:00:51 for ResidualVM by doxygen 1.7.1
curved edge   curved edge