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