Script v1_7_1_0
- AI
- Animals
- Collections
- Contracts
- Debug
- Debug2DArea
- DebugBitVectorMap
- DebugCube
- DebugDensityMap
- DebugFlag
- DebugGizmo
- DebugInfoTable
- DebugManager
- DebugPath
- DebugPoint
- DebugText
- DebugUtil
- NoteManager
- Economy
- Elements
- EnvironmentalScore
- Errors
- Events
- GUI
- Handtools
- Hud
- I3d
- Input
- Jobs
- Maps
- Materials
- Misc
- Objects
- Parameters
- Placeables
- Placement
- Player
- Shop
- Sounds
- Specialization
- Specializations
- StateMachine
- Statistics
- Tasks
- Triggers
- Utils
- Vehicles
Engine v1_7_1_0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- general
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- NoteNode
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- VoiceChat
- XML
Foundation Reference
DebugPath
FunctionsaddPoint
DescriptionDefinitionaddPoint()Code
63 | function DebugPath:addPoint(x, y, z) |
64 | local addPoint = true |
65 | if self.autoAddOffset ~= nil then |
66 | local p = self.points[#self.points] |
67 | if p ~= nil then |
68 | local distance = MathUtil.vector3Length(p[1]-x, p[2]-y, p[3]-z) |
69 | if distance < self.autoAddOffset then |
70 | addPoint = false |
71 | end |
72 | end |
73 | end |
74 | |
75 | if addPoint then |
76 | table.insert(self.points, {x, y, z}) |
77 | end |
78 | |
79 | return self |
80 | end |
clear
DescriptionDefinitionclear()Code
90 | function DebugPath:clear() |
91 | self.points = {} |
92 | end |
delete
DescriptionDefinitiondelete()Code
31 | function DebugPath:delete() |
32 | end |
draw
DescriptionDefinitiondraw()Code
41 | function DebugPath:draw(forcedY) |
42 | if self.isVisible then |
43 | local r, g, b = unpack(self.color) |
44 | |
45 | for k, p in ipairs(self.points) do |
46 | local np = self.points[k+1] |
47 | if np ~= nil then |
48 | local px, py, pz = p[1], p[2], p[3] |
49 | local npx, npy, npz = np[1], np[2], np[3] |
50 | if self.alignToGround then |
51 | py = getTerrainHeightAtWorldPos(g_currentMission.terrainRootNode, px, 0, pz) + 0.025 |
52 | npy = getTerrainHeightAtWorldPos(g_currentMission.terrainRootNode, npx, 0, npz) + 0.025 |
53 | end |
54 | |
55 | drawDebugLine(px, forcedY or py, pz, r, g, b, npx, forcedY or npy, npz, r, g, b, self.solid) |
56 | end |
57 | end |
58 | end |
59 | end |
new
DescriptionDefinitionnew()Code
16 | function DebugPath.new(color, alignToGround, autoAddOffset, solid, customMt) |
17 | local self = setmetatable({}, customMt or DebugPath_mt) |
18 | |
19 | self.color = color or {1, 1, 1} |
20 | self.points = {} |
21 | self.isVisible = true |
22 | self.alignToGround = Utils.getNoNil(alignToGround, false) |
23 | self.autoAddOffset = autoAddOffset |
24 | self.solid = Utils.getNoNil(solid, true) |
25 | |
26 | return self |
27 | end |
setColor
DescriptionDefinitionsetColor()Code
96 | function DebugPath:setColor(r, g, b) |
97 | self.color[1] = r or self.color[1] |
98 | self.color[2] = g or self.color[2] |
99 | self.color[3] = b or self.color[3] |
100 | |
101 | return self |
102 | end |
setVisible
DescriptionDefinitionsetVisible()Code
84 | function DebugPath:setVisible(isVisible) |
85 | self.isVisible = isVisible |
86 | end |
update
DescriptionDefinitionupdate()Code
36 | function DebugPath:update(dt) |
37 | end |