|
Arma Reforger Script API
|
A Forest Generator uses the following data: More...
Protected Member Functions | |
| bool | OnLine (SCR_ForestGeneratorLine line, SCR_ForestGeneratorPoint point) |
| int | Direction (SCR_ForestGeneratorPoint a, SCR_ForestGeneratorPoint b, SCR_ForestGeneratorPoint c) |
| bool | IsIntersect (SCR_ForestGeneratorLine line1, SCR_ForestGeneratorLine line2) |
| bool | IsIntersect (SCR_ForestGeneratorLine line, SCR_ForestGeneratorRectangle rectangle) |
| bool | PreprocessTreeArray (notnull array< ref ForestGeneratorTree > trees, int groupIdx, SCR_ETreeType type, int debugGroupIdx) |
| void | PreprocessAllTrees () |
| array< ref SCR_ForestGeneratorPoint > | GetClockWisePoints (notnull IEntitySource shapeEntitySource) |
| Create a list of Forest Generator Points for each shape's vertices. | |
| void | FillOutlineLinesAndPoints (notnull array< ref SCR_ForestGeneratorPoint > points) |
| void | CalculateOutlineAnglesForPoints (notnull array< ref SCR_ForestGeneratorPoint > points) |
| override bool | _WB_OnKeyChanged (BaseContainer src, string key, BaseContainerList ownerContainers, IEntity parent) |
| override void | OnShapeChangedInternal (IEntitySource shapeEntitySrc, ShapeEntity shapeEntity, array< vector > mins, array< vector > maxes) |
| override void | OnShapeInitInternal (IEntitySource shapeEntitySrc, ShapeEntity shapeEntity) |
| override void | BeforeShapeTransformInternal (IEntitySource shapeEntitySrc, ShapeEntity shapeEntity, inout vector oldTransform[4]) |
| override void | OnShapeTransformInternal (IEntitySource shapeEntitySrc, ShapeEntity shapeEntity, array< vector > mins, array< vector > maxes) |
| override void | OnPointChangedInternal (IEntitySource shapeEntitySrc, ShapeEntity shapeEntity, PointChangedSituation situation, int pointIndex, vector position) |
| int | GetColorForTree (int index, SCR_ETreeType type) |
| void | MemoryCleanup () |
| Empty now-useless arrays. | |
| void | RegenerateForest (bool forceRegeneration=false) |
| int | DeletePreviousEntities (notnull array< float > currentPoints2D, SCR_ForestGeneratorOutlinePositionChecker outlineChecker, bool forceRegeneration=false) |
| Delete previous entities - either all of them for a full regeneration, or out of shape (hehe) ones for partial regeneration. | |
| int | GenerateEntities (notnull array< float > previousPoints2D, SCR_ForestGeneratorOutlinePositionChecker outlineChecker, bool forceRegeneration=false) |
| void | PopulateGrid (array< float > polygon2D, array< vector > polygon3D) |
| void | Rectangulate (notnull SCR_AABB bbox, notnull array< float > polygon2D) |
| bool | NeedsCheck (SCR_ForestGeneratorLine line, SCR_ForestGeneratorRectangle rectangle) |
| void | GenerateForestGeneratorTrees (array< float > polygon2D, SCR_AABB bbox) |
| int | FindRectanglesInCircle (vector center, float radius, out array< SCR_ForestGeneratorRectangle > rectangles) |
| bool | GetClusterPoint (notnull array< float > polygon2D, notnull SCR_AABB bbox, out vector clusterCenter, float additionalDistance, bool allowInForest, bool allowInOutline) |
| void | GenerateCircleCluster (notnull ForestGeneratorCircleCluster cluster, notnull array< float > polygon2D, notnull SCR_AABB bbox) |
| void | GenerateStripCluster (notnull ForestGeneratorStripCluster cluster, notnull array< float > polygon2D, notnull SCR_AABB bbox) |
| int | GetClusterObjectCount (notnull SmallForestGeneratorClusterObject clusterObject) |
| int | GetGaussianDistributionRandomIntInclusive (int min, float mid, int max) |
| SCR_Math.GetGaussianDistributionRandom but we use our own random generator and round the result. | |
| float | SafeRandomFloatInclusive (float min, float max) |
| Get a random value between min and max, if min > max they are reversed. | |
| vector | GeneratePointInCircle (float innerRadius, float outerRadius, vector circleCenter) |
| Density is more important at the centre (random 0-radius) | |
| vector | GeneratePointInCircle (float innerRadius, float outerRadius, SCR_ForestGeneratorPoint point) |
| Density is more important at the centre (random 0-radius) | |
| vector | GenerateRandomPointInRectangle (notnull SCR_ForestGeneratorRectangle rectangle) |
| bool | GetIsAnyTreeValid (notnull array< ref TreeGroupClass > treeGroups) |
| void | GenerateOutlineTrees (array< float > polygon, SCR_AABB bbox, ForestGeneratorOutline outline) |
| bool | IsPointInProperDistanceFromLine (vector point, SCR_ForestGeneratorLine line, float minDistance, float maxDistance) |
| bool | IsEntryValid (ForestGeneratorTree tree, vector pointLocal) |
| void | GenerateBottomTrees (array< float > polygon, SCR_AABB bbox, ForestGeneratorBottomLevel bottomLevel) |
| void | GenerateTopTrees (array< float > polygon, SCR_AABB bbox, ForestGeneratorTopLevel topLevel) |
| void | GenerateTreeInsideRectangle (notnull SCR_ForestGeneratorRectangle rectangle, notnull SCR_ForestGeneratorTreeLevel level, notnull array< float > polygon, vector worldMat[4]) |
| ForestGeneratorTree | SelectTreeToSpawn (vector point, array< ref ForestGeneratorTree > trees) |
| void | SetObjectScale (notnull SCR_ForestGeneratorTreeBase object) |
| bool | IsInOutline (notnull SCR_ForestGeneratorRectangle rectangle, vector pointLocal, float additionalDistance=0) |
| bool | IsBeforeOutlineBorder (notnull SCR_ForestGeneratorRectangle rectangle, vector pointLocal, float offset=0) |
| same as IsInOutline but reversed | |
| float | CalculateAreaForOutline (SCR_ForestGeneratorLine line, ForestGeneratorOutline outline) |
| float | CalculateAreaForOutline (SCR_ForestGeneratorPoint point, ForestGeneratorOutline outline) |
| override void | OnRegenerate () |
| override void | _WB_OnInit (inout vector mat[4], IEntitySource src) |
Protected Member Functions inherited from SCR_AreaGeneratorBaseEntity | |
| void | RefreshObstacles () |
| void | SetAvoidOptions () |
| bool | HasObstacle (vector worldPos, array< IEntity > exclusionList=null) |
| bool | HasObstaclesList () |
| void | ClearObstacles () |
| override void | OnIntersectingShapeChangedXZInternal (IEntitySource shapeEntitySrc, IEntitySource other, array< vector > mins, array< vector > maxes) |
| void | SCR_AreaGeneratorBaseEntity (IEntitySource src, IEntity parent) |
Protected Member Functions inherited from SCR_GeneratorBaseEntity | |
| void | ResetGeneratorPosition (ShapeEntity shapeEntity=null) |
| void | DeleteAllChildren () |
| Delete all children without distinction, using WorldEditorAPI. | |
| array< vector > | GetWorldAnchorPoints (notnull IEntitySource shapeEntitySrc) |
| array< vector > | GetWorldTesselatedShapePoints (notnull IEntitySource shapeEntitySrc) |
| Color | GetColor () |
| void | ColorShape () |
| Set shape's line colour to GetColor() value. | |
| IEntitySource | GetShapeSource () |
| Get the parent shape above this generator (has to be the direct parent) | |
| void | SCR_GeneratorBaseEntity (IEntitySource src, IEntity parent) |
Static Protected Attributes | |
| static const float | SCALE_CURVE_RANGE = 100 |
| distance from shape in metre | |
| static const float | SCALE_CURVE_MAX_VALUE = 1 |
| static const float | SCALE_CURVE_MIN_VALUE = 0 |
| static ref array< float > | s_aPreviousPoints2D |
| static ref SCR_TimeMeasurementHelper | s_Benchmark |
| static const int | MAX_CLUSTER_ATTEMPT = 10 |
| static ref SCR_DebugShapeManager | s_DebugShapeManager |
| static const int | REGENERATION_DELETION_COLOUR = Color.RED |
| static const int | REGENERATION_CREATION_COLOUR = Color.GREEN |
| static const vector | DEBUG_VERTICAL_LINE = "0 30 0" |
| static const float | RECTANGULATION_SIZE = 50 |
| static const float | HECTARE_CONVERSION_FACTOR = 0.0001 |
| static const float | MIN_POSSIBLE_SCALE_VALUE = 0.001 |
| static const string | POINTDATA_CLASSNAME = ((TypeName)ForestGeneratorPointData).ToString() |
| static const int | TREE_GROUPS_OFFSET_HACK = 10 |
| static const int | GRID_SIZE = 10 |
Static Protected Attributes inherited from SCR_AreaGeneratorBaseEntity | |
| static ref SCR_ObstacleDetector | s_ObstacleDetector |
| static const float | BBOX_CHECK_HEIGHT = 100.0 |
| static const float | AVOID_OBJECTS_CHECK_RADIUS = 0.1 |
Static Protected Attributes inherited from SCR_GeneratorBaseEntity | |
| static const int | BASE_GENERATOR_COLOUR = Color.WHITE |
Additional Inherited Members | |
Public Member Functions inherited from SCR_GeneratorBaseEntity | |
| override void | _WB_OnParentChange (IEntitySource src, IEntitySource prevParentSrc) |
| override bool | _WB_CanSelect (IEntitySource src) |
| map< int, ref ShapePointDataScriptBase > | GetFirstPointDataMap (TypeName wantedType=ShapePointDataScriptBase) |
| map< int, ref array< ref ShapePointDataScriptBase > > | GetPointDataMap (TypeName wantedType=ShapePointDataScriptBase) |
| override void | _WB_OnCreate (IEntitySource src) |
Static Protected Member Functions inherited from SCR_GeneratorBaseEntity | |
| static array< vector > | GetPoints (notnull IEntitySource shapeEntitySrc) |
| static array< vector > | GetAnchorPoints (notnull IEntitySource shapeEntitySrc, float offset=0, bool isShapeClosed=false) |
| static array< vector > | GetTesselatedShapePoints (notnull IEntitySource shapeEntitySrc, float offset=0, bool isShapeClosed=false) |
A Forest Generator uses the following data:
|
protected |
|
protected |
Implements SCR_GeneratorBaseEntity.
|
protected |
|
protected |
| [in] | line | |
| [in] | outline |
|
protected |
| [in] | point | |
| [in] | outline |
|
protected |
| [in] | points |
|
protected |
Delete previous entities - either all of them for a full regeneration, or out of shape (hehe) ones for partial regeneration.
| [in] | currentPoints2D | |
| [in] | outlineChecker | |
| [in] | forceRegeneration |
|
protected |
| [in] | a | |
| [in] | b | |
| [in] | c |
|
protected |
| [in] | points |
|
protected |
| [in] | center | |
| [in] | radius | |
| [out] | rectangles |
|
protected |
| [in] | polygon | |
| [in] | bbox | |
| [in] | bottomLevel |
|
protected |
| [in] | cluster | |
| [in] | polygon2D | |
| [in] | bbox |
|
protected |
| [in] | previousPoints2D | |
| [in] | outlineChecker | |
| [in] | forceRegeneration |
|
protected |
| [in] | polygon2D | |
| [in] | bbox |
|
protected |
| [in] | polygon | |
| [in] | bbox | |
| [in] | outline |
|
protected |
Density is more important at the centre (random 0-radius)
| [in] | innerRadius | |
| [in] | outerRadius | |
| [in] | point |
|
protected |
Density is more important at the centre (random 0-radius)
| [in] | innerRadius | |
| [in] | outerRadius | |
| [in] | circleCenter |
|
protected |
| [in] | rectangle |
|
protected |
| [in] | cluster | |
| [in] | polygon2D | |
| [in] | bbox |
|
protected |
| [in] | polygon | |
| [in] | bbox | |
| [in] | topLevel |
|
protected |
| [in] | rectangle | |
| [in] | level | |
| [in] | polygon | |
| [in] | worldMat |
|
protected |
Create a list of Forest Generator Points for each shape's vertices.
| [in] | shapeEntitySource | an IEntitySource from a ShapeEntity (spline or polyline) |
|
protected |
| [in] | clusterObject |
|
protected |
| [in] | polygon2D | |
| [in] | bbox | |
| [out] | clusterCenter | |
| [in] | additionalDistance | |
| [in] | allowInForest | |
| [in] | allowInOutline |
|
protected |
| [in] | index | |
| [in] | type |
|
protected |
SCR_Math.GetGaussianDistributionRandom but we use our own random generator and round the result.
| [in] | min | (included) |
| [in] | mid | Gaussian curve's middle point |
| [in] | max | (included) |
|
protected |
| [in] | treeGroups |
|
protected |
same as IsInOutline but reversed
| [in] | rectangle | |
| [in] | pointLocal | |
| [in] | offset | positive to allow getting closer to shape inside outline, negative to get away from the outline border |
|
protected |
| [in] | tree | |
| [in] | pointLocal |
|
protected |
| [in] | rectangle | |
| [in] | pointLocal | |
| [in] | additionalDistance |
|
protected |
| [in] | line | |
| [in] | rectangle |
|
protected |
| [in] | line1 | |
| [in] | line2 |
|
protected |
| [in] | point | |
| [in] | line | |
| [in] | minDistance | |
| [in] | maxDistance |
|
protected |
Empty now-useless arrays.
|
protected |
| [in] | line | |
| [in] | rectangle |
|
protected |
| [in] | line | |
| [in] | point |
|
protected |
|
protected |
Implements SCR_AreaGeneratorBaseEntity.
|
protected |
Implements SCR_GeneratorBaseEntity.
|
protected |
Implements SCR_GeneratorBaseEntity.
|
protected |
|
protected |
| [in] | polygon2D | |
| [in] | polygon3D |
|
protected |
|
protected |
| [in] | trees | |
| [in] | groupIdx | |
| [in] | type | |
| [in] | debugGroupIdx |
|
protected |
| [in] | bbox | |
| [in] | polygon2D |
|
protected |
| [in] | forceRegeneration |
|
protected |
Get a random value between min and max, if min > max they are reversed.
| [in] | min | |
| [in] | max |
|
protected |
| [in] | point | |
| [in] | trees |
|
protected |
| [in] | object |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
not saved to layer (see _WB_OnKeyChanged), used as a button
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
distance from shape in metre
|
staticprotected |