refactor(Core/Collision): Store collision data on map context (#25049)

This commit is contained in:
Takenbacon
2026-03-22 18:33:04 -07:00
committed by GitHub
parent 80b6984274
commit 27b0ecc6dc
32 changed files with 527 additions and 992 deletions

View File

@@ -23,6 +23,7 @@
#include <G3D/Matrix3.h>
#include <G3D/Ray.h>
#include <G3D/Vector3.h>
#include <memory>
namespace VMAP
{
@@ -63,16 +64,15 @@ namespace VMAP
{
public:
ModelInstance() { }
ModelInstance(const ModelSpawn& spawn, WorldModel* model);
void setUnloaded() { iModel = nullptr; }
ModelInstance(const ModelSpawn& spawn, std::shared_ptr<WorldModel> model);
bool intersectRay(const G3D::Ray& pRay, float& pMaxDist, bool StopAtFirstHit, ModelIgnoreFlags ignoreFlags) const;
bool GetLocationInfo(const G3D::Vector3& p, LocationInfo& info) const;
bool GetLiquidLevel(const G3D::Vector3& p, LocationInfo& info, float& liqHeight) const;
WorldModel* getWorldModel() { return iModel; }
WorldModel* getWorldModel() { return iModel.get(); }
protected:
G3D::Matrix3 iInvRot;
float iInvScale{0.0f};
WorldModel* iModel{nullptr};
std::shared_ptr<WorldModel> iModel;
};
} // namespace VMAP