diff options
author | Aki <please@ignore.pl> | 2022-01-30 17:44:05 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-01-30 17:44:05 +0100 |
commit | c01469dddabe404506ef3a64542e8423f9e11f2c (patch) | |
tree | 740f6e0e0811227a6e40aac51ba48057f1166b41 /Opcode/OPC_LSSCollider.h | |
parent | 51657e10769faa2617d546a06c42e4c62a19bb50 (diff) | |
download | starshatter-c01469dddabe404506ef3a64542e8423f9e11f2c.zip starshatter-c01469dddabe404506ef3a64542e8423f9e11f2c.tar.gz starshatter-c01469dddabe404506ef3a64542e8423f9e11f2c.tar.bz2 |
Converted Opcode and Ice into unix newlines format
Diffstat (limited to 'Opcode/OPC_LSSCollider.h')
-rw-r--r-- | Opcode/OPC_LSSCollider.h | 198 |
1 files changed, 99 insertions, 99 deletions
diff --git a/Opcode/OPC_LSSCollider.h b/Opcode/OPC_LSSCollider.h index a533419..426564c 100644 --- a/Opcode/OPC_LSSCollider.h +++ b/Opcode/OPC_LSSCollider.h @@ -1,99 +1,99 @@ -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/*
- * OPCODE - Optimized Collision Detection
- * Copyright (C) 2001 Pierre Terdiman
- * Homepage: http://www.codercorner.com/Opcode.htm
- */
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/**
- * Contains code for an LSS collider.
- * \file OPC_LSSCollider.h
- * \author Pierre Terdiman
- * \date December, 28, 2002
- */
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// Include Guard
-#ifndef __OPC_LSSCOLLIDER_H__
-#define __OPC_LSSCOLLIDER_H__
-
- struct OPCODE_API LSSCache : VolumeCache
- {
- LSSCache()
- {
- Previous.mP0 = IcePoint(0.0f, 0.0f, 0.0f);
- Previous.mP1 = IcePoint(0.0f, 0.0f, 0.0f);
- Previous.mRadius = 0.0f;
- FatCoeff = 1.1f;
- }
-
- // Cached faces signature
- LSS Previous; //!< LSS used when performing the query resulting in cached faces
- // User settings
- float FatCoeff; //!< mRadius2 multiplier used to create a fat LSS
- };
-
- class OPCODE_API LSSCollider : public VolumeCollider
- {
- public:
- // Constructor / Destructor
- LSSCollider();
- virtual ~LSSCollider();
-
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- /**
- * Generic collision query for generic OPCODE models. After the call, access the results:
- * - with GetContactStatus()
- * - with GetNbTouchedPrimitives()
- * - with GetTouchedPrimitives()
- *
- * \param cache [in/out] an lss cache
- * \param lss [in] collision lss in local space
- * \param model [in] Opcode model to collide with
- * \param worldl [in] lss world matrix, or null
- * \param worldm [in] model's world matrix, or null
- * \return true if success
- * \warning SCALE NOT SUPPORTED. The matrices must contain rotation & translation parts only.
- */
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- bool Collide(LSSCache& cache, const LSS& lss, const Model& model, const Matrix4x4* worldl=null, const Matrix4x4* worldm=null);
- //
- bool Collide(LSSCache& cache, const LSS& lss, const AABBTree* tree);
- protected:
- // LSS in model space
- IceSegment mSeg; //!< IceSegment
- float mRadius2; //!< LSS radius squared
- // Internal methods
- void _Collide(const AABBCollisionNode* node);
- void _Collide(const AABBNoLeafNode* node);
- void _Collide(const AABBQuantizedNode* node);
- void _Collide(const AABBQuantizedNoLeafNode* node);
- void _Collide(const AABBTreeNode* node);
- void _CollideNoPrimitiveTest(const AABBCollisionNode* node);
- void _CollideNoPrimitiveTest(const AABBNoLeafNode* node);
- void _CollideNoPrimitiveTest(const AABBQuantizedNode* node);
- void _CollideNoPrimitiveTest(const AABBQuantizedNoLeafNode* node);
- // Overlap tests
- inline_ BOOL LSSContainsBox(const IcePoint& bc, const IcePoint& be);
- inline_ BOOL LSSAABBOverlap(const IcePoint& center, const IcePoint& extents);
- inline_ BOOL LSSTriOverlap(const IcePoint& vert0, const IcePoint& vert1, const IcePoint& vert2);
- // Init methods
- BOOL InitQuery(LSSCache& cache, const LSS& lss, const Matrix4x4* worldl=null, const Matrix4x4* worldm=null);
- };
-
- class OPCODE_API HybridLSSCollider : public LSSCollider
- {
- public:
- // Constructor / Destructor
- HybridLSSCollider();
- virtual ~HybridLSSCollider();
-
- bool Collide(LSSCache& cache, const LSS& lss, const HybridModel& model, const Matrix4x4* worldl=null, const Matrix4x4* worldm=null);
- protected:
- Container mTouchedBoxes;
- };
-
-#endif // __OPC_LSSCOLLIDER_H__
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/* + * OPCODE - Optimized Collision Detection + * Copyright (C) 2001 Pierre Terdiman + * Homepage: http://www.codercorner.com/Opcode.htm + */ +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * Contains code for an LSS collider. + * \file OPC_LSSCollider.h + * \author Pierre Terdiman + * \date December, 28, 2002 + */ +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Include Guard +#ifndef __OPC_LSSCOLLIDER_H__ +#define __OPC_LSSCOLLIDER_H__ + + struct OPCODE_API LSSCache : VolumeCache + { + LSSCache() + { + Previous.mP0 = IcePoint(0.0f, 0.0f, 0.0f); + Previous.mP1 = IcePoint(0.0f, 0.0f, 0.0f); + Previous.mRadius = 0.0f; + FatCoeff = 1.1f; + } + + // Cached faces signature + LSS Previous; //!< LSS used when performing the query resulting in cached faces + // User settings + float FatCoeff; //!< mRadius2 multiplier used to create a fat LSS + }; + + class OPCODE_API LSSCollider : public VolumeCollider + { + public: + // Constructor / Destructor + LSSCollider(); + virtual ~LSSCollider(); + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /** + * Generic collision query for generic OPCODE models. After the call, access the results: + * - with GetContactStatus() + * - with GetNbTouchedPrimitives() + * - with GetTouchedPrimitives() + * + * \param cache [in/out] an lss cache + * \param lss [in] collision lss in local space + * \param model [in] Opcode model to collide with + * \param worldl [in] lss world matrix, or null + * \param worldm [in] model's world matrix, or null + * \return true if success + * \warning SCALE NOT SUPPORTED. The matrices must contain rotation & translation parts only. + */ + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + bool Collide(LSSCache& cache, const LSS& lss, const Model& model, const Matrix4x4* worldl=null, const Matrix4x4* worldm=null); + // + bool Collide(LSSCache& cache, const LSS& lss, const AABBTree* tree); + protected: + // LSS in model space + IceSegment mSeg; //!< IceSegment + float mRadius2; //!< LSS radius squared + // Internal methods + void _Collide(const AABBCollisionNode* node); + void _Collide(const AABBNoLeafNode* node); + void _Collide(const AABBQuantizedNode* node); + void _Collide(const AABBQuantizedNoLeafNode* node); + void _Collide(const AABBTreeNode* node); + void _CollideNoPrimitiveTest(const AABBCollisionNode* node); + void _CollideNoPrimitiveTest(const AABBNoLeafNode* node); + void _CollideNoPrimitiveTest(const AABBQuantizedNode* node); + void _CollideNoPrimitiveTest(const AABBQuantizedNoLeafNode* node); + // Overlap tests + inline_ BOOL LSSContainsBox(const IcePoint& bc, const IcePoint& be); + inline_ BOOL LSSAABBOverlap(const IcePoint& center, const IcePoint& extents); + inline_ BOOL LSSTriOverlap(const IcePoint& vert0, const IcePoint& vert1, const IcePoint& vert2); + // Init methods + BOOL InitQuery(LSSCache& cache, const LSS& lss, const Matrix4x4* worldl=null, const Matrix4x4* worldm=null); + }; + + class OPCODE_API HybridLSSCollider : public LSSCollider + { + public: + // Constructor / Destructor + HybridLSSCollider(); + virtual ~HybridLSSCollider(); + + bool Collide(LSSCache& cache, const LSS& lss, const HybridModel& model, const Matrix4x4* worldl=null, const Matrix4x4* worldm=null); + protected: + Container mTouchedBoxes; + }; + +#endif // __OPC_LSSCOLLIDER_H__ |