forestBrushElement.h
Engine/source/forest/editor/forestBrushElement.h
Classes:
class
class
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 _FOREST_EDITOR_BRUSHELEMENT_H_ 25#define _FOREST_EDITOR_BRUSHELEMENT_H_ 26 27//#ifndef _SIMOBJECT_H_ 28//#include "console/simObject.h" 29//#endif 30#ifndef _SIMSET_H_ 31#include "console/simSet.h" 32#endif 33 34 35//------------------------------------------------------------------------- 36// ForestBrushElement 37//------------------------------------------------------------------------- 38 39class ForestItemData; 40 41class ForestBrushElement : public SimObject 42{ 43 typedef SimObject Parent; 44 45public: 46 47 ForestBrushElement(); 48 49 DECLARE_CONOBJECT( ForestBrushElement ); 50 51 static void initPersistFields(); 52 53public: 54 55 /// The type of ForestItem this element holds placement parameters for. 56 ForestItemData *mData; 57 58 /// The probability that this element will be 59 /// created during an editor brush stroke. 60 F32 mProbability; 61 62 /// The max rotation in degrees that items will be placed. 63 F32 mRotationRange; 64 65 /// The minimum random size for each item. 66 F32 mScaleMin; 67 68 /// The maximum random size of each item. 69 F32 mScaleMax; 70 71 /// An exponent used to bias between the minimum 72 /// and maximum random sizes. 73 F32 mScaleExponent; 74 75 /// Min variation in the sink radius. 76 F32 mSinkMin; 77 78 /// Max variation in the sink radius. 79 F32 mSinkMax; 80 81 /// This is the radius used to calculate how much to 82 /// sink the trunk at its base and is used to sink 83 /// the tree into the ground when its on a slope. 84 F32 mSinkRadius; 85 86 /// The min surface slope in degrees this item will be placed on. 87 F32 mSlopeMin; 88 89 /// The max surface slope in degrees this item will be placed on. 90 F32 mSlopeMax; 91 92 /// The min world space elevation this item will be placed. 93 F32 mElevationMin; 94 95 /// The max world space elevation this item will be placed. 96 F32 mElevationMax; 97}; 98 99//------------------------------------------------------------------------- 100// ForestBrush 101//------------------------------------------------------------------------- 102 103class ForestBrush : public SimGroup 104{ 105 typedef SimGroup Parent; 106 107public: 108 109 ForestBrush(); 110 111 DECLARE_CONOBJECT( ForestBrush ); 112 113 virtual bool onAdd(); 114 115 virtual void addObject(SimObject*); 116 117 static SimGroup* getGroup(); 118 119 bool containsItemData( const ForestItemData *inData ); 120protected: 121 122 static SimObjectPtr<SimGroup> smGroup; 123}; 124 125 126#endif // _FOREST_EDITOR_BRUSHELEMENT_H_ 127