22 #ifndef STARK_RESOURCES_FLOOR_H 23 #define STARK_RESOURCES_FLOOR_H 25 #include "common/array.h" 26 #include "common/str.h" 28 #include "math/line3d.h" 30 #include "math/vector3d.h" 32 #include "engines/stark/resources/object.h" 53 FloorEdge(uint16 vertexIndex1, uint16 vertexIndex2, uint32 faceIndex1);
56 void buildNeighbours(
const Floor *floor);
59 void computeMiddle(
const Floor *floor);
62 void setOtherFace(uint32 faceIndex);
65 bool hasVertices(uint16 vertexIndex1, uint16 vertexIndex2)
const;
76 float costTo(
const FloorEdge *other)
const;
83 Math::Vector3d getPosition()
const;
86 bool isFloorBorder()
const;
89 bool intersectsSegment(
const Floor *floor,
const Math::Line3d &segment)
const;
91 int32 getFaceIndex1()
const;
92 int32 getFaceIndex2()
const;
95 void enable(
bool enable);
98 bool isEnabled()
const;
104 void addNeighboursFromFace(
const FloorFace *face);
105 static bool intersectLine2d(
const Math::Line3d &s1,
const Math::Line3d &s2);
107 uint16 _vertexIndex1;
108 uint16 _vertexIndex2;
109 Math::Vector3d _middle;
126 static const Type::ResourceType TYPE = Type::kFloor;
132 void onAllLoaded()
override;
136 Math::Vector3d getVertex(uint32 index)
const;
144 int32 findFaceContainingPoint(
const Math::Vector3d &point)
const;
147 void computePointHeightInFace(Math::Vector3d &point, uint32 faceIndex)
const;
158 int32 findFaceHitByRay(
const Math::Ray &ray, Math::Vector3d &intersection)
const;
169 int32 findFaceClosestToRay(
const Math::Ray &ray, Math::Vector3d ¢er)
const;
172 float getDistanceFromCamera(uint32 faceIndex)
const;
178 bool isSegmentInside(
const Math::Line3d &segment)
const;
181 void enableFloorField(
FloorField *floorfield,
bool enable);
185 void printData()
override;
187 void buildEdgeList();
188 void addFaceEdgeToList(uint32 faceIndex, uint32 index1, uint32 index2);
199 #endif // STARK_RESOURCES_FLOOR_H
Definition: floorface.h:46
Definition: floorfield.h:42
Definition: stateprovider.h:51