diff options
author | Aki <please@ignore.pl> | 2024-03-12 22:07:03 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-03-12 22:07:36 +0100 |
commit | 81bb6873f1c0291fecbf6e429ad15ac3db66a4c0 (patch) | |
tree | fd7552ecabeeffb45a1fbe3730ab62bc7a64dd85 /contrib/Opcode/OPC_SweepAndPrune.h | |
parent | f43d32d6d2cc7ecd04f4f06f20d5a6fc2c87c9ae (diff) | |
download | starshatter-81bb6873f1c0291fecbf6e429ad15ac3db66a4c0.zip starshatter-81bb6873f1c0291fecbf6e429ad15ac3db66a4c0.tar.gz starshatter-81bb6873f1c0291fecbf6e429ad15ac3db66a4c0.tar.bz2 |
Legal notices updated
Rename contrib -> third-party intendes to express the origin and purpose
of that part of the code better. I plan to readd contrib/ again but with
more in-project things like bash-completions, dev workflow scripts etc.
Diffstat (limited to 'contrib/Opcode/OPC_SweepAndPrune.h')
-rw-r--r-- | contrib/Opcode/OPC_SweepAndPrune.h | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/contrib/Opcode/OPC_SweepAndPrune.h b/contrib/Opcode/OPC_SweepAndPrune.h deleted file mode 100644 index cbb87ac..0000000 --- a/contrib/Opcode/OPC_SweepAndPrune.h +++ /dev/null @@ -1,86 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -/* - * OPCODE - Optimized Collision Detection - * Copyright (C) 2001 Pierre Terdiman - * Homepage: http://www.codercorner.com/Opcode.htm - */ -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -/** - * Contains an implementation of the sweep-and-prune algorithm (moved from Z-Collide) - * \file OPC_SweepAndPrune.h - * \author Pierre Terdiman - * \date January, 29, 2000 - */ -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Include Guard -#ifndef __OPC_SWEEPANDPRUNE_H__ -#define __OPC_SWEEPANDPRUNE_H__ - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** - * User-callback, called by OPCODE for each colliding pairs. - * \param id0 [in] id of colliding object - * \param id1 [in] id of colliding object - * \param user_data [in] user-defined data - * \return TRUE to continue enumeration - */ - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - typedef BOOL (*PairCallback) (udword id0, udword id1, void* user_data); - - class SAP_Element; - class SAP_EndPoint; - class SAP_Box; - - class OPCODE_API SAP_PairData - { - public: - SAP_PairData(); - ~SAP_PairData(); - - bool Init(udword nb_objects); - - void AddPair(udword id1, udword id2); - void RemovePair(udword id1, udword id2); - - void DumpPairs(Pairs& pairs) const; - void DumpPairs(PairCallback callback, void* user_data) const; - private: - udword mNbElements; //!< Total number of elements in the pool - udword mNbUsedElements; //!< Number of used elements - SAP_Element* mElementPool; //!< Array of mNbElements elements - SAP_Element* mFirstFree; //!< First free element in the pool - - udword mNbObjects; //!< Max number of objects we can handle - SAP_Element** mArray; //!< Pointers to pool - // Internal methods - SAP_Element* GetFreeElem(udword id, SAP_Element* next, udword* remap=null); - inline_ void FreeElem(SAP_Element* elem); - void Release(); - }; - - class OPCODE_API SweepAndPrune - { - public: - SweepAndPrune(); - ~SweepAndPrune(); - - bool Init(udword nb_objects, const AABB** boxes); - bool UpdateObject(udword i, const AABB& box); - - void GetPairs(Pairs& pairs) const; - void GetPairs(PairCallback callback, void* user_data) const; - private: - SAP_PairData mPairs; - - udword mNbObjects; - SAP_Box* mBoxes; - SAP_EndPoint* mList[3]; - // Internal methods - bool CheckListsIntegrity(); - }; - -#endif //__OPC_SWEEPANDPRUNE_H__
\ No newline at end of file |