PixelLightAPI  .
Sphere.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: Sphere.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_SPHERE_H__
00024 #define __PLMATH_SPHERE_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 *    Sphere class
00046 */
00047 class Sphere {
00048 
00049 
00050     //[-------------------------------------------------------]
00051     //[ Public functions                                      ]
00052     //[-------------------------------------------------------]
00053     public:
00054         /**
00055         *  @brief
00056         *    Default constructor setting all position components and the radius to 0
00057         */
00058         PLMATH_API Sphere();
00059 
00060         /**
00061         *  @brief
00062         *    Copy constructor
00063         *
00064         *  @param[in] cSource
00065         *    Source to copy from
00066         */
00067         PLMATH_API Sphere(const Sphere &cSource);
00068 
00069         /**
00070         *  @brief
00071         *    Destructor
00072         */
00073         PLMATH_API ~Sphere();
00074 
00075         /**
00076         *  @brief
00077         *    Copy operator
00078         *
00079         *  @param[in] cSource
00080         *    Source to copy from
00081         *
00082         *  @return
00083         *    Reference to this instance
00084         */
00085         PLMATH_API Sphere &operator =(const Sphere &cSource);
00086 
00087         /**
00088         *  @brief
00089         *    Returns the radius of the sphere
00090         *
00091         *  @return
00092         *    Sphere radius
00093         */
00094         PLMATH_API float GetRadius() const;
00095 
00096         /**
00097         *  @brief
00098         *    Sets the radius of the sphere
00099         *
00100         *  @param[in] fRadius
00101         *    Sphere radius
00102         */
00103         PLMATH_API void SetRadius(float fRadius = 0.0f);
00104 
00105         /**
00106         *  @brief
00107         *    Returns the current position
00108         *
00109         *  @return
00110         *    Current position
00111         */
00112         PLMATH_API const Vector3 &GetPos() const;
00113 
00114         /**
00115         *  @brief
00116         *    Set the current position
00117         *
00118         *  @param[in] fX
00119         *    X component of the new position
00120         *  @param[in] fY
00121         *    Y component of the new position
00122         *  @param[in] fZ
00123         *    Z component of the new position
00124         */
00125         PLMATH_API void SetPos(float fX = 0.0f, float fY = 0.0f, float fZ = 0.0f);
00126 
00127         /**
00128         *  @brief
00129         *    Set the current position
00130         *
00131         *  @param[in] vPos
00132         *    New position
00133         */
00134         PLMATH_API void SetPos(const Vector3 &vPos);
00135 
00136 
00137     //[-------------------------------------------------------]
00138     //[ Private data                                          ]
00139     //[-------------------------------------------------------]
00140     private:
00141         float   m_fRadius;  /**< Sphere radius */
00142         Vector3 m_vPos;     /**< Sphere position */
00143 
00144 
00145 };
00146 
00147 
00148 //[-------------------------------------------------------]
00149 //[ Namespace                                             ]
00150 //[-------------------------------------------------------]
00151 } // PLMath
00152 
00153 
00154 #endif // __PLMATH_SPHERE_H__


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:03
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported