LUADOC - Farming Simulator 22

DebugDensityMap

Functions

drawDebugAreaRectangleFilled

Description
Definition
drawDebugAreaRectangleFilled()
Code
121function DebugDensityMap:drawDebugAreaRectangleFilled(x, z, x1, z1, x2, z2, r, g, b, a)
122 local x3, z3 = x1, z2
123
124 local y = getTerrainHeightAtWorldPos(g_currentMission.terrainRootNode, x, 0, z) + self.yOffset
125 local y1 = getTerrainHeightAtWorldPos(g_currentMission.terrainRootNode, x1, 0, z1) + self.yOffset
126 local y2 = getTerrainHeightAtWorldPos(g_currentMission.terrainRootNode, x2, 0, z2) + self.yOffset
127 local y3 = getTerrainHeightAtWorldPos(g_currentMission.terrainRootNode, x3, 0, z3) + self.yOffset
128
129 drawDebugTriangle(x, y, z, x2, y2, z2, x1, y1, z1, r, g, b, a, false)
130 drawDebugTriangle(x1, y1, z1, x2, y2, z2, x3, y3, z3, r, g, b, a, false)
131end

new

Description
Definition
new()
Code
16function DebugDensityMap.new(densityMap, firstChannel, numChannels, radius, yOffset, colors, customMt)
17 local self = setmetatable({}, customMt or DebugDensityMap_mt)
18
19 local size = getDensityMapSize(densityMap)
20 self.resolution = g_currentMission.terrainSize / size
21 self.firsChannel = firstChannel
22 self.numChannels = numChannels
23
24 self.colors = colors
25
26 self.radius = radius
27 self.yOffset = yOffset or 0.1
28
29 self.modifier = DensityMapModifier.new(densityMap, firstChannel, numChannels, g_currentMission.terrainNode)
30 self.filter = DensityMapFilter.new(self.modifier)
31
32 return self
33end