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
DebugPoint
FunctionscreateWithNode
DescriptionDefinitioncreateWithNode()Code
49 | function DebugPoint:createWithNode(node, alignToGround, solid, hideWhenGUIOpen, clipDistance) |
50 | local x, y, z = getWorldTranslation(node) |
51 | |
52 | return self:createWithWorldPosAndDir(x, y, z, alignToGround, solid, hideWhenGUIOpen, clipDistance) |
53 | end |
createWithWorldPos
DescriptionDefinitioncreateWithWorldPos()Code
57 | function DebugPoint:createWithWorldPos(x, y, z, alignToGround, solid, hideWhenGUIOpen, clipDistance) |
58 | |
59 | if alignToGround and g_currentMission.terrainRootNode ~= nil then |
60 | y = getTerrainHeightAtWorldPos(g_currentMission.terrainRootNode, x, 0, z) + 0.1 |
61 | end |
62 | |
63 | self.x, self.y, self.z = x, y, z |
64 | self.solid = Utils.getNoNil(solid, self.solid) |
65 | |
66 | self.hideWhenGuiIsOpen = Utils.getNoNil(hideWhenGUIOpen, self.hideWhenGuiIsOpen) |
67 | self.clipDistance = Utils.getNoNil(clipDistance, self.clipDistance) |
68 | |
69 | return self |
70 | end |
draw
DescriptionDefinitiondraw()Code
37 | function DebugPoint:draw() |
38 | if self.hideWhenGuiIsOpen and g_gui:getIsGuiVisible() then |
39 | return |
40 | end |
41 | if not DebugUtil.isPositionInCameraRange(self.x, self.y, self.z, self.clipDistance) then |
42 | return |
43 | end |
44 | drawDebugPoint(self.x, self.y, self.z, self.color.r, self.color.g, self.color.b, self.color.a, self.solid) |
45 | end |
new
DescriptionDefinitionnew()Code
15 | function DebugPoint.new(customMt) |
16 | local self = setmetatable({}, customMt or DebugPoint_mt) |
17 | |
18 | self.x, self.y, self.z = 0, 0, 0 |
19 | self.color = {r=1, g=1, b=1, a=1} |
20 | self.solid = false |
21 | |
22 | self.alignToGround = false |
23 | self.hideWhenGuiIsOpen = false |
24 | self.clipDistance = 2000 |
25 | |
26 | return self |
27 | end |
setClipDistance
DescriptionDefinitionsetClipDistance()Code
85 | function DebugPoint:setClipDistance(clipDistance) |
86 | self.clipDistance = clipDistance |
87 | |
88 | return self |
89 | end |
setColor
DescriptionDefinitionsetColor()Code
74 | function DebugPoint:setColor(r, g, b, a) |
75 | self.color.r = r or self.color.r |
76 | self.color.g = g or self.color.g |
77 | self.color.b = b or self.color.b |
78 | self.color.a = a or self.color.a |
79 | |
80 | return self |
81 | end |