Redesign of animation queue for unreal, add get_tangibles_near to drivenengine

This commit is contained in:
2023-07-24 17:19:25 -04:00
parent 4da86e6f89
commit 87aa47b96d
19 changed files with 1406 additions and 980 deletions

View File

@@ -87,6 +87,7 @@
class PlaneMap;
class PlaneTree;
class PlaneScan : public eng::nevernew {
public:
friend class PlaneMap;
@@ -94,7 +95,11 @@ public:
enum Shape { BOX, CYLINDER, SPHERE };
private:
// The plane to scan.
eng::string plane_;
//
// Note: the reason this uses std::string instead of eng::string
// is that we want plane scans to not touch the engine heap.
//
std::string plane_;
// The bounding box of the scan.
util::XYZ center_, radius_;
@@ -119,13 +124,14 @@ private:
public:
void clear() {
plane_ = "";
plane_.clear();
shape_ = BOX;
sorted_ = true;
near_ = 0;
include_near_ = false;
omit_nowhere_ = false;
radius_ = center_ = util::XYZ();
radius_ = util::XYZ();
center_ = util::XYZ();
}
PlaneScan() { clear(); }
@@ -143,7 +149,7 @@ public:
//
void configure(LuaKeywordParser &kw);
void set_bbox_given_center_radius(const util::XYZ &center, float r) {
void set_center_and_radius(const util::XYZ &center, float r) {
set_center(center);
set_radius(r);
}
@@ -204,12 +210,12 @@ public:
class PlaneMap : public eng::nevernew {
friend class PlaneItem;
friend class PlaneTree;
public:
using IdVector = util::IdVector;
private:
float default_radius_;
eng::map<eng::string, std::unique_ptr<PlaneTree>> planes_;
// Plane Trees table.
//
eng::map<eng::string, std::unique_ptr<PlaneTree>, std::less<>> planes_;
public:
// No special code is needed for construction or destruction.
@@ -220,7 +226,11 @@ public:
// PlaneItem. See PlaneItem::track and PlaneItem::untrack.
// Scan the PlaneMap for items, return their IDs.
IdVector scan(const PlaneScan &s) const;
//
// Note: the reason this uses IdVector instead of IdVector
// is that we want scans to not touch the engine heap.
//
void scan(const PlaneScan &sc, util::IdVector *into) const;
// Set the default radius for all planes.
// Maybe we'll make it adaptive some day.