summaryrefslogtreecommitdiffhomepage
path: root/Opcode/Ice/IceSegment.h
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-01-30 17:44:05 +0100
committerAki <please@ignore.pl>2022-01-30 17:44:05 +0100
commitc01469dddabe404506ef3a64542e8423f9e11f2c (patch)
tree740f6e0e0811227a6e40aac51ba48057f1166b41 /Opcode/Ice/IceSegment.h
parent51657e10769faa2617d546a06c42e4c62a19bb50 (diff)
downloadstarshatter-c01469dddabe404506ef3a64542e8423f9e11f2c.zip
starshatter-c01469dddabe404506ef3a64542e8423f9e11f2c.tar.gz
starshatter-c01469dddabe404506ef3a64542e8423f9e11f2c.tar.bz2
Converted Opcode and Ice into unix newlines format
Diffstat (limited to 'Opcode/Ice/IceSegment.h')
-rw-r--r--Opcode/Ice/IceSegment.h110
1 files changed, 55 insertions, 55 deletions
diff --git a/Opcode/Ice/IceSegment.h b/Opcode/Ice/IceSegment.h
index d2b7f07..72ddceb 100644
--- a/Opcode/Ice/IceSegment.h
+++ b/Opcode/Ice/IceSegment.h
@@ -1,55 +1,55 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/**
- * Contains code for segments.
- * \file IceSegment.h
- * \author Pierre Terdiman
- * \date April, 4, 2000
- */
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// Include Guard
-#ifndef __ICESEGMENT_H__
-#define __ICESEGMENT_H__
-
- class ICEMATHS_API IceSegment
- {
- public:
- //! Constructor
- inline_ IceSegment() {}
- //! Constructor
- inline_ IceSegment(const IcePoint& p0, const IcePoint& p1) : mP0(p0), mP1(p1) {}
- //! Copy constructor
- inline_ IceSegment(const IceSegment& seg) : mP0(seg.mP0), mP1(seg.mP1) {}
- //! Destructor
- inline_ ~IceSegment() {}
-
- inline_ const IcePoint& GetOrigin() const { return mP0; }
- inline_ IcePoint ComputeDirection() const { return mP1 - mP0; }
- inline_ void ComputeDirection(IcePoint& dir) const { dir = mP1 - mP0; }
- inline_ float ComputeLength() const { return mP1.Distance(mP0); }
- inline_ float ComputeSquareLength() const { return mP1.SquareDistance(mP0); }
-
- inline_ void SetOriginDirection(const IcePoint& origin, const IcePoint& direction)
- {
- mP0 = mP1 = origin;
- mP1 += direction;
- }
-
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- /**
- * Computes a IcePoint on the segment
- * \param pt [out] IcePoint on segment
- * \param t [in] IcePoint's parameter [t=0 => pt = mP0, t=1 => pt = mP1]
- */
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- inline_ void ComputePoint(IcePoint& pt, float t) const { pt = mP0 + t * (mP1 - mP0); }
-
- float SquareDistance(const IcePoint& IcePoint, float* t=null) const;
- inline_ float Distance(const IcePoint& IcePoint, float* t=null) const { return sqrtf(SquareDistance(IcePoint, t)); }
-
- IcePoint mP0; //!< Start of segment
- IcePoint mP1; //!< End of segment
- };
-
-#endif // __ICESEGMENT_H__
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+/**
+ * Contains code for segments.
+ * \file IceSegment.h
+ * \author Pierre Terdiman
+ * \date April, 4, 2000
+ */
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Include Guard
+#ifndef __ICESEGMENT_H__
+#define __ICESEGMENT_H__
+
+ class ICEMATHS_API IceSegment
+ {
+ public:
+ //! Constructor
+ inline_ IceSegment() {}
+ //! Constructor
+ inline_ IceSegment(const IcePoint& p0, const IcePoint& p1) : mP0(p0), mP1(p1) {}
+ //! Copy constructor
+ inline_ IceSegment(const IceSegment& seg) : mP0(seg.mP0), mP1(seg.mP1) {}
+ //! Destructor
+ inline_ ~IceSegment() {}
+
+ inline_ const IcePoint& GetOrigin() const { return mP0; }
+ inline_ IcePoint ComputeDirection() const { return mP1 - mP0; }
+ inline_ void ComputeDirection(IcePoint& dir) const { dir = mP1 - mP0; }
+ inline_ float ComputeLength() const { return mP1.Distance(mP0); }
+ inline_ float ComputeSquareLength() const { return mP1.SquareDistance(mP0); }
+
+ inline_ void SetOriginDirection(const IcePoint& origin, const IcePoint& direction)
+ {
+ mP0 = mP1 = origin;
+ mP1 += direction;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ /**
+ * Computes a IcePoint on the segment
+ * \param pt [out] IcePoint on segment
+ * \param t [in] IcePoint's parameter [t=0 => pt = mP0, t=1 => pt = mP1]
+ */
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ inline_ void ComputePoint(IcePoint& pt, float t) const { pt = mP0 + t * (mP1 - mP0); }
+
+ float SquareDistance(const IcePoint& IcePoint, float* t=null) const;
+ inline_ float Distance(const IcePoint& IcePoint, float* t=null) const { return sqrtf(SquareDistance(IcePoint, t)); }
+
+ IcePoint mP0; //!< Start of segment
+ IcePoint mP1; //!< End of segment
+ };
+
+#endif // __ICESEGMENT_H__