diff options
author | dan miller | 2007-10-19 05:22:23 +0000 |
---|---|---|
committer | dan miller | 2007-10-19 05:22:23 +0000 |
commit | 1ec410ecd725f5a3ccb2d2fc16f48730d9d9fe43 (patch) | |
tree | 51bcae7a1b8381a6bf6fd8025a7de1e30fe0045d /libraries/ode-0.9/OPCODE/Ice/IceSegment.h | |
parent | one more for the gipper (diff) | |
download | opensim-SC_OLD-1ec410ecd725f5a3ccb2d2fc16f48730d9d9fe43.zip opensim-SC_OLD-1ec410ecd725f5a3ccb2d2fc16f48730d9d9fe43.tar.gz opensim-SC_OLD-1ec410ecd725f5a3ccb2d2fc16f48730d9d9fe43.tar.bz2 opensim-SC_OLD-1ec410ecd725f5a3ccb2d2fc16f48730d9d9fe43.tar.xz |
trying to fix my screwup, please hold on
Diffstat (limited to 'libraries/ode-0.9/OPCODE/Ice/IceSegment.h')
-rw-r--r-- | libraries/ode-0.9/OPCODE/Ice/IceSegment.h | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/libraries/ode-0.9/OPCODE/Ice/IceSegment.h b/libraries/ode-0.9/OPCODE/Ice/IceSegment.h deleted file mode 100644 index 8d66322..0000000 --- a/libraries/ode-0.9/OPCODE/Ice/IceSegment.h +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
2 | /** | ||
3 | * Contains code for segments. | ||
4 | * \file IceSegment.h | ||
5 | * \author Pierre Terdiman | ||
6 | * \date April, 4, 2000 | ||
7 | */ | ||
8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
9 | |||
10 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
11 | // Include Guard | ||
12 | #ifndef __ICESEGMENT_H__ | ||
13 | #define __ICESEGMENT_H__ | ||
14 | |||
15 | class ICEMATHS_API Segment | ||
16 | { | ||
17 | public: | ||
18 | //! Constructor | ||
19 | inline_ Segment() {} | ||
20 | //! Constructor | ||
21 | inline_ Segment(const Point& p0, const Point& p1) : mP0(p0), mP1(p1) {} | ||
22 | //! Copy constructor | ||
23 | inline_ Segment(const Segment& seg) : mP0(seg.mP0), mP1(seg.mP1) {} | ||
24 | //! Destructor | ||
25 | inline_ ~Segment() {} | ||
26 | |||
27 | inline_ const Point& GetOrigin() const { return mP0; } | ||
28 | inline_ Point ComputeDirection() const { return mP1 - mP0; } | ||
29 | inline_ void ComputeDirection(Point& dir) const { dir = mP1 - mP0; } | ||
30 | inline_ float ComputeLength() const { return mP1.Distance(mP0); } | ||
31 | inline_ float ComputeSquareLength() const { return mP1.SquareDistance(mP0); } | ||
32 | |||
33 | inline_ void SetOriginDirection(const Point& origin, const Point& direction) | ||
34 | { | ||
35 | mP0 = mP1 = origin; | ||
36 | mP1 += direction; | ||
37 | } | ||
38 | |||
39 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
40 | /** | ||
41 | * Computes a point on the segment | ||
42 | * \param pt [out] point on segment | ||
43 | * \param t [in] point's parameter [t=0 => pt = mP0, t=1 => pt = mP1] | ||
44 | */ | ||
45 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
46 | inline_ void ComputePoint(Point& pt, float t) const { pt = mP0 + t * (mP1 - mP0); } | ||
47 | |||
48 | float SquareDistance(const Point& point, float* t=null) const; | ||
49 | inline_ float Distance(const Point& point, float* t=null) const { return sqrtf(SquareDistance(point, t)); } | ||
50 | |||
51 | Point mP0; //!< Start of segment | ||
52 | Point mP1; //!< End of segment | ||
53 | }; | ||
54 | |||
55 | #endif // __ICESEGMENT_H__ | ||