PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: Line.h * 00003 * 00004 * Copyright (C) 2002-2011 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLMATH_LINE_H__ 00024 #define __PLMATH_LINE_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLMath/Vector3.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLMath { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Classes ] 00042 //[-------------------------------------------------------] 00043 /** 00044 * @brief 00045 * Line class 00046 */ 00047 class Line { 00048 00049 00050 //[-------------------------------------------------------] 00051 //[ Public data ] 00052 //[-------------------------------------------------------] 00053 public: 00054 Vector3 vStart; /**< Line start point */ 00055 Vector3 vEnd; /**< Line end point */ 00056 00057 00058 //[-------------------------------------------------------] 00059 //[ Public functions ] 00060 //[-------------------------------------------------------] 00061 public: 00062 /** 00063 * @brief 00064 * Default constructor setting all start- and end-position components to 0 00065 */ 00066 inline Line(); 00067 00068 /** 00069 * @brief 00070 * Copy constructor 00071 * 00072 * @param[in] cSource 00073 * Source to copy from 00074 */ 00075 inline Line(const Line &cSource); 00076 00077 /** 00078 * @brief 00079 * Copy constructor 00080 * 00081 * @param[in] vStartPoint 00082 * Start point 00083 * @param[in] vEndPoint 00084 * End point 00085 */ 00086 inline Line(const Vector3 &vStartPoint, const Vector3 &vEndPoint); 00087 00088 /** 00089 * @brief 00090 * Destructor 00091 */ 00092 inline ~Line(); 00093 00094 /** 00095 * @brief 00096 * Copy operator 00097 * 00098 * @param[in] cSource 00099 * Source to copy from 00100 * 00101 * @return 00102 * Reference to this instance 00103 */ 00104 inline Line &operator =(const Line &cSource); 00105 00106 /** 00107 * @brief 00108 * Sets the start and end position of the line 00109 * 00110 * @param[in] vStart 00111 * Line start position 00112 * @param[in] vEnd 00113 * Line end position 00114 */ 00115 inline void Set(const Vector3 &vStart, const Vector3 &vEnd); 00116 00117 //[-------------------------------------------------------] 00118 //[ Transformation ] 00119 //[-------------------------------------------------------] 00120 PLMATH_API Line operator *(const Matrix3x3 &mRot) const; 00121 PLMATH_API Line operator *(const Matrix3x4 &mTrans) const; 00122 PLMATH_API Line operator *(const Matrix4x4 &mTrans) const; 00123 PLMATH_API Line &operator *=(const Matrix3x3 &mRot); 00124 PLMATH_API Line &operator *=(const Matrix3x4 &mTrans); 00125 PLMATH_API Line &operator *=(const Matrix4x4 &mTrans); 00126 00127 00128 }; 00129 00130 00131 //[-------------------------------------------------------] 00132 //[ Namespace ] 00133 //[-------------------------------------------------------] 00134 } // PLMath 00135 00136 00137 //[-------------------------------------------------------] 00138 //[ Implementation ] 00139 //[-------------------------------------------------------] 00140 #include "PLMath/Line.inl" 00141 00142 00143 #endif // __PLMATH_LINE_H__
|