Class | CWrp::File8WVR |
In: |
../lib/roller/CWRP.rb
|
Parent: | Object |
A file contining island information. It can be read from an OFP (4WVR) or ArmA (8WVR) formatted WRP file. It can be exported to WRP (8WVR only), XYZ or object template files.
FOREST_BLOCK_OBJECT_WIDTH | = | 50.0 | Width of a forest block object in metres. | |
ARMA_MAGIC | = | "8WVR" | ||
OFP_MAGIC | = | "4WVR" | ||
OFP_CELL_SIZE | = | 50.0 | 50m texture and terrain cell sizes are assumed in OFP. | |
OFP_NUM_TEXTURES | = | 512 | Total number of textures in every OFP map. | |
OFP_TO_ARMA_HEIGHT_FACTOR | = | 0.045 | OFP file heights are integers and much larger than they should be so scale them down appropriately. | |
FOREST_CELL_WIDTH | = | 32 | Size of cells when calculating satellite mask forested areas. | |
LEGAL_GRID_SIZES | = | [16, 32, 64, 128, 256, 512, 1024, 2048, 4096] | ArmA only supports certain grid sizes, from 16x16 to 4096x4096. | |
OBJECTS_PER_PROGRESS | = | 100 | Number of objects to wait before applying a progress increment. |
Loads 4WVR or 8WVR format WRP file.
stream: | input stream |
show_progress: | True to use a gui to show progress. |
Applies bumpiness factor across the whole height-map.
bumpiness: | Maximum deviation of each new point from standard. |
TODO: Use a better algorithm for generating noise.
filename: | File to export |
cell_width: | Width of mask pixels in metres. |
config: | YAML config to base mask on. |
Gives the height, in metres, at a given x/y position. If between grid points, an interpolated value will be given.
x: | x position in m |
y: | y position in m |
Replace OFP forest block objects with individual trees and bushes.
replacements: | Hash of name-to-replace => replacement data |
returns: [Number of forest replaced, number of new objects created]
Globally replace objects with new object p3ds and model-based offsets.
replacements is a hash where the key is the name of names to replace and the value is an array of names to replace it with (will pick a random one if the array has more than one element).
replacements: | Hash of texture-to-replace => array of replacement textures |
Decreases the terrain cell size, thus increasing the number of grid points.
cell_size: | The new size of terrain cells. This must be an positive integer divisor of the current cell size. |
List of those texture indexes that are actually never referenced. Returns an array of indexes that are never referenced (not counting index 0 which is never used)
Writes an object template file using the format, "p3d-filename";x;y;z;angle; "ace_island_objects\m\bush\ace_dd_bush01";4830;9682;0;161.015;
stream: | output stream |
Find an appropriate random position within N, E, W, S sectors.
______ |\ N /| | \ / | |W \/ E| | /\ | | / \ | |/_S__\|
sectors: | Array of sectors that are acceptable for the position. |