occlusionVolume.h
Engine/source/T3D/occlusionVolume.h
Classes:
class
A volume in space that blocks visibility.
Detailed Description
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#ifndef _OCCLUSIONVOLUME_H_ 25#define _OCCLUSIONVOLUME_H_ 26 27#ifndef _SCENEPOLYHEDRALSPACE_H_ 28#include "scene/scenePolyhedralSpace.h" 29#endif 30 31#ifndef _MSILHOUETTEEXTRACTOR_H_ 32#include "math/mSilhouetteExtractor.h" 33#endif 34 35 36 37/// A volume in space that blocks visibility. 38class OcclusionVolume : public ScenePolyhedralSpace 39{ 40 public: 41 42 typedef ScenePolyhedralSpace Parent; 43 44 protected: 45 46 typedef SilhouetteExtractorPerspective< PolyhedronType> SilhouetteExtractorType; 47 48 /// Whether the volume's transform has changed and we need to recompute 49 /// transform-based data. 50 bool mTransformDirty; 51 52 /// World-space points of the volume's polyhedron. 53 Vector< Point3F> mWSPoints; 54 55 /// Silhouette extractor when using perspective projections. 56 SilhouetteExtractorType mSilhouetteExtractor; 57 58 // SceneSpace. 59 virtual void _renderObject( ObjectRenderInst* ri, SceneRenderState* state, BaseMatInstance* overrideMat ); 60 61 public: 62 63 OcclusionVolume(); 64 65 // SimObject. 66 DECLARE_CONOBJECT( OcclusionVolume ); 67 DECLARE_DESCRIPTION( "A visibility blocking volume." ); 68 DECLARE_CATEGORY( "3D Scene" ); 69 70 virtual bool onAdd(); 71 72 static void consoleInit(); 73 74 // SceneObject. 75 virtual void buildSilhouette( const SceneCameraState& cameraState, Vector< Point3F>& outPoints ); 76 virtual void setTransform( const MatrixF& mat ); 77}; 78 79#endif // !_OCCLUSIONVOLUME_H_ 80