PixelLightAPI  .
SQSphere.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SQSphere.h                                     *
00003  *
00004  *  Copyright (C) 2002-2012 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 __PLSCENE_SCENEQUERY_SPHERE_H__
00024 #define __PLSCENE_SCENEQUERY_SPHERE_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include <PLMath/Sphere.h>
00032 #include "PLScene/Scene/SceneQuery.h"
00033 
00034 
00035 //[-------------------------------------------------------]
00036 //[ Namespace                                             ]
00037 //[-------------------------------------------------------]
00038 namespace PLScene {
00039 
00040 
00041 //[-------------------------------------------------------]
00042 //[ Forward declarations                                  ]
00043 //[-------------------------------------------------------]
00044 class SceneHierarchyNode;
00045 
00046 
00047 //[-------------------------------------------------------]
00048 //[ Classes                                               ]
00049 //[-------------------------------------------------------]
00050 /**
00051 *  @brief
00052 *    Sphere intersection scene query class
00053 *
00054 *  @remarks
00055 *    This sphere test scene query will enumerate all scene nodes intersecting the
00056 *    given sphere. The intersection sphere will ALWAYS stay an sphere, even if it's transformed
00057 *    into a not uniform scaled child scene container! Therefore, if there are such scaled
00058 *    child scene containers, a new sphere in this container space is calculated automatically.
00059 *    As result, even scene nodes which are not inside the 'original' intersection volume may be
00060 *    within this transformed volume.
00061 */
00062 class SQSphere : public SceneQuery {
00063 
00064 
00065     //[-------------------------------------------------------]
00066     //[ RTTI interface                                        ]
00067     //[-------------------------------------------------------]
00068     pl_class(PLS_RTTI_EXPORT, SQSphere, "PLScene", PLScene::SceneQuery, "Sphere intersection scene query class")
00069         // Constructors
00070         pl_constructor_0(DefaultConstructor,    "Default constructor",  "")
00071     pl_class_end
00072 
00073 
00074     //[-------------------------------------------------------]
00075     //[ Public functions                                      ]
00076     //[-------------------------------------------------------]
00077     public:
00078         /**
00079         *  @brief
00080         *    Default constructor
00081         */
00082         PLS_API SQSphere();
00083 
00084         /**
00085         *  @brief
00086         *    Destructor
00087         */
00088         PLS_API virtual ~SQSphere();
00089 
00090         /**
00091         *  @brief
00092         *    Returns the used sphere
00093         *
00094         *  @return
00095         *    The used sphere
00096         */
00097         PLS_API PLMath::Sphere &GetSphere();
00098 
00099 
00100     //[-------------------------------------------------------]
00101     //[ Private functions                                     ]
00102     //[-------------------------------------------------------]
00103     private:
00104         /**
00105         *  @brief
00106         *    Recursive part of PerformQuery()
00107         *
00108         *  @param[in] cHierarchyNode
00109         *    Current scene hierarchy node we work on
00110         *
00111         *  @return
00112         *    'true' to continue the query, 'false' if stop it right now
00113         */
00114         bool PerformQueryRec(SceneHierarchyNode &cHierarchyNode);
00115 
00116 
00117     //[-------------------------------------------------------]
00118     //[ Private data                                          ]
00119     //[-------------------------------------------------------]
00120     private:
00121         PLMath::Sphere m_cSphere;   /**< Sphere used for the query */
00122 
00123 
00124     //[-------------------------------------------------------]
00125     //[ Public virtual SceneQuery functions                   ]
00126     //[-------------------------------------------------------]
00127     public:
00128         PLS_API virtual bool PerformQuery() override;
00129 
00130 
00131 };
00132 
00133 
00134 //[-------------------------------------------------------]
00135 //[ Namespace                                             ]
00136 //[-------------------------------------------------------]
00137 } // PLScene
00138 
00139 
00140 #endif // __PLSCENE_SCENEQUERY_SPHERE_H__


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:01
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported