mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-11-27 15:02:06 +00:00
chore: reorder classes functions before members
This commit is contained in:
@@ -23,21 +23,21 @@ namespace BSP
|
||||
class BSPObject
|
||||
{
|
||||
public:
|
||||
BSPObject(float xMin, float yMin, float zMin, float xMax, float yMax, float zMax, int objPartitionIndex);
|
||||
|
||||
T6::vec3_t min;
|
||||
T6::vec3_t max;
|
||||
int partitionIndex; // index of the partition the object is contained in
|
||||
|
||||
BSPObject(float xMin, float yMin, float zMin, float xMax, float yMax, float zMax, int objPartitionIndex);
|
||||
};
|
||||
|
||||
class BSPLeaf
|
||||
{
|
||||
public:
|
||||
std::vector<std::shared_ptr<BSPObject>> objectList;
|
||||
|
||||
void addObject(std::shared_ptr<BSPObject> object);
|
||||
[[nodiscard]] BSPObject* getObject(size_t index) const;
|
||||
[[nodiscard]] size_t getObjectCount() const;
|
||||
|
||||
std::vector<std::shared_ptr<BSPObject>> objectList;
|
||||
};
|
||||
|
||||
class BSPTree;
|
||||
@@ -45,19 +45,23 @@ namespace BSP
|
||||
class BSPNode
|
||||
{
|
||||
public:
|
||||
BSPNode(std::unique_ptr<BSPTree> frontTree, std::unique_ptr<BSPTree> backTree, PlaneAxis nodeAxis, float nodeDistance);
|
||||
[[nodiscard]] PlaneSide objectIsInFront(const BSPObject& object) const;
|
||||
|
||||
std::unique_ptr<BSPTree> front;
|
||||
std::unique_ptr<BSPTree> back;
|
||||
|
||||
PlaneAxis axis; // axis that the split plane is on
|
||||
float distance; // distance from the origin (0, 0, 0) to the plane
|
||||
|
||||
BSPNode(std::unique_ptr<BSPTree> frontTree, std::unique_ptr<BSPTree> backTree, PlaneAxis nodeAxis, float nodeDistance);
|
||||
[[nodiscard]] PlaneSide objectIsInFront(const BSPObject& object) const;
|
||||
};
|
||||
|
||||
class BSPTree
|
||||
{
|
||||
public:
|
||||
BSPTree(float xMin, float yMin, float zMin, float xMax, float yMax, float zMax, int treeLevel);
|
||||
void splitTree();
|
||||
void addObjectToTree(std::shared_ptr<BSPObject> object) const;
|
||||
|
||||
bool isLeaf;
|
||||
std::unique_ptr<BSPLeaf> leaf;
|
||||
std::unique_ptr<BSPNode> node;
|
||||
@@ -65,9 +69,5 @@ namespace BSP
|
||||
int level; // level in the BSP tree
|
||||
T6::vec3_t min;
|
||||
T6::vec3_t max;
|
||||
|
||||
BSPTree(float xMin, float yMin, float zMin, float xMax, float yMax, float zMax, int treeLevel);
|
||||
void splitTree();
|
||||
void addObjectToTree(std::shared_ptr<BSPObject> object) const;
|
||||
};
|
||||
} // namespace BSP
|
||||
|
||||
@@ -16,10 +16,6 @@ namespace BSP
|
||||
[[nodiscard]] T6::clipMap_t* linkClipMap(const BSPData& bsp);
|
||||
|
||||
private:
|
||||
MemoryManager& m_memory;
|
||||
ISearchPath& m_search_path;
|
||||
AssetCreationContext& m_context;
|
||||
|
||||
void loadBoxData(T6::clipMap_t& clipMap) const;
|
||||
void loadVisibility(T6::clipMap_t& clipMap) const;
|
||||
void loadDynEnts(T6::clipMap_t& clipMap) const;
|
||||
@@ -27,16 +23,20 @@ namespace BSP
|
||||
void loadSubModelCollision(T6::clipMap_t& clipMap, const BSPData& bsp) const;
|
||||
void loadXModelCollision(T6::clipMap_t& clipMap) const;
|
||||
|
||||
std::vector<T6::cplane_s> planeVec;
|
||||
std::vector<T6::cNode_t> nodeVec;
|
||||
std::vector<T6::cLeaf_s> leafVec;
|
||||
std::vector<T6::CollisionAabbTree> AABBTreeVec;
|
||||
size_t highestLeafObjectCount = 0;
|
||||
|
||||
void addAABBTreeFromLeaf(T6::clipMap_t& clipMap, const BSPTree& tree, size_t& out_parentCount, size_t& out_parentStartIndex);
|
||||
int16_t loadBSPNode(T6::clipMap_t& clipMap, const BSPTree& tree);
|
||||
void loadBSPTree(T6::clipMap_t& clipMap, const BSPData& bsp);
|
||||
bool loadPartitions(T6::clipMap_t& clipMap, const BSPData& bsp) const;
|
||||
bool loadWorldCollision(T6::clipMap_t& clipMap, const BSPData& bsp);
|
||||
|
||||
MemoryManager& m_memory;
|
||||
ISearchPath& m_search_path;
|
||||
AssetCreationContext& m_context;
|
||||
|
||||
std::vector<T6::cplane_s> planeVec;
|
||||
std::vector<T6::cNode_t> nodeVec;
|
||||
std::vector<T6::cLeaf_s> leafVec;
|
||||
std::vector<T6::CollisionAabbTree> AABBTreeVec;
|
||||
size_t highestLeafObjectCount = 0;
|
||||
};
|
||||
} // namespace BSP
|
||||
|
||||
@@ -14,10 +14,6 @@ namespace BSP
|
||||
[[nodiscard]] T6::GfxWorld* linkGfxWorld(const BSPData& bsp) const;
|
||||
|
||||
private:
|
||||
MemoryManager& m_memory;
|
||||
ISearchPath& m_search_path;
|
||||
AssetCreationContext& m_context;
|
||||
|
||||
void loadDrawData(const BSPData& projInfo, T6::GfxWorld& gfxWorld) const;
|
||||
bool loadMapSurfaces(const BSPData& projInfo, T6::GfxWorld& gfxWorld) const;
|
||||
void loadXModels(const BSPData& projInfo, T6::GfxWorld& gfxWorld) const;
|
||||
@@ -33,5 +29,9 @@ namespace BSP
|
||||
bool loadOutdoors(T6::GfxWorld& gfxWorld) const;
|
||||
void loadSunData(T6::GfxWorld& gfxWorld) const;
|
||||
void loadWorldBounds(T6::GfxWorld& gfxWorld) const;
|
||||
|
||||
MemoryManager& m_memory;
|
||||
ISearchPath& m_search_path;
|
||||
AssetCreationContext& m_context;
|
||||
};
|
||||
} // namespace BSP
|
||||
|
||||
Reference in New Issue
Block a user