color
Definition
-- @/lua/common/utils.lua:60
-- r,g,b,a in [0..255]
function color(r, g, b, a)
return max(0, min(255, floor(r))) * 16777216 + max(0, min(255, floor(g))) * 65536 + max(0, min(255, floor(b))) * 256 + max(0, min(255, floor(a or 255)))
end
Callers
@/lua/vehicle/controller/playerController.lua
--table.insert(debugVectors, {cid = stabilizationNodes.topLeft, vector = vectorTopFrontLeft * yawLeftForce * 0.001, color = color(244, 93, 1, 255)})
--table.insert(debugVectors, {cid = stabilizationNodes.topRight, vector = vectorTopRearRight * yawLeftForce * 0.001, color = color(244, 93, 1, 255)})
--table.insert(debugVectors, {cid = stabilizationNodes.topLeft, vector = vectorTopFrontLeft * yawLeftForce * 0.001, color = color(244, 93, 1, 255)})
--table.insert(debugVectors, {cid = stabilizationNodes.topRight, vector = vectorTopRearRight * yawLeftForce * 0.001, color = color(244, 93, 1, 255)})
--table.insert(debugVectors, {cid = stabilizationNodes.topRight, vector = vectorTopFrontRight * yawRightForce * 0.001, color = color(175, 18, 90, 255)})
--table.insert(debugVectors, {cid = stabilizationNodes.topRight, vector = vectorTopRearRight * yawLeftForce * 0.001, color = color(244, 93, 1, 255)})
--table.insert(debugVectors, {cid = stabilizationNodes.topRight, vector = vectorTopFrontRight * yawRightForce * 0.001, color = color(175, 18, 90, 255)})
--table.insert(debugVectors, {cid = stabilizationNodes.topLeft, vector = vectorTopRearLeft * yawRightForce * 0.001, color = color(175, 18, 90, 255)})
--table.insert(debugVectors, {cid = stabilizationNodes.topRight, vector = vectorTopFrontRight * yawRightForce * 0.001, color = color(175, 18, 90, 255)})
--table.insert(debugVectors, {cid = stabilizationNodes.topLeft, vector = vectorTopRearLeft * yawRightForce * 0.001, color = color(175, 18, 90, 255)})
end
@/lua/common/utils/debugDraw.lua
local DEFAULTTEXTCOL = color(255,255,255,255)
local DEFAULTTEXTCOLBG = color(196,196,196,127)
local DEFAULTTEXTCOL = color(255,255,255,255)
local DEFAULTTEXTCOLBG = color(196,196,196,127)
@/lua/ge/extensions/editor/tech/roadArchitect/render.lua
local roadColor = color(12, 63, 211, 255) -- The colour of road visualisations.
local fullWhite = color(255, 255, 255, 255) -- The colour of SELECTED road visualisations.
local roadColor = color(12, 63, 211, 255) -- The colour of road visualisations.
local fullWhite = color(255, 255, 255, 255) -- The colour of SELECTED road visualisations.
local linkColor = color(0, 120, 207, 255) -- The colour of proposed link visualisation lines.
local fullWhite = color(255, 255, 255, 255) -- The colour of SELECTED road visualisations.
local linkColor = color(0, 120, 207, 255) -- The colour of proposed link visualisation lines.
local meshOutlineColor = color(255, 255, 255, 64) -- The colour of (non-selected) static mesh outlines.
local linkColor = color(0, 120, 207, 255) -- The colour of proposed link visualisation lines.
local meshOutlineColor = color(255, 255, 255, 64) -- The colour of (non-selected) static mesh outlines.
local selectedMeshOutlineColor = color(0, 0, 0, 255) -- The colour of (selected) static mesh outlines.
local meshOutlineColor = color(255, 255, 255, 64) -- The colour of (non-selected) static mesh outlines.
local selectedMeshOutlineColor = color(0, 0, 0, 255) -- The colour of (selected) static mesh outlines.
local overlayColor = color(0, 0, 0, 255) -- The colour of overlay polylines/nodes.
local selectedMeshOutlineColor = color(0, 0, 0, 255) -- The colour of (selected) static mesh outlines.
local overlayColor = color(0, 0, 0, 255) -- The colour of overlay polylines/nodes.
local overlayHighlightColor = color(240, 240, 240, 255) -- The colour of the selected overlay polyline/nodes.
local overlayColor = color(0, 0, 0, 255) -- The colour of overlay polylines/nodes.
local overlayHighlightColor = color(240, 240, 240, 255) -- The colour of the selected overlay polyline/nodes.
local tunnelColor = color(150, 150, 150, 255) -- The colour of auto tunnel visualisations.
local overlayHighlightColor = color(240, 240, 240, 255) -- The colour of the selected overlay polyline/nodes.
local tunnelColor = color(150, 150, 150, 255) -- The colour of auto tunnel visualisations.
local layerColor = color(255, 255, 255, 64) -- The colour of (non-selected) layer visualisations.
local tunnelColor = color(150, 150, 150, 255) -- The colour of auto tunnel visualisations.
local layerColor = color(255, 255, 255, 64) -- The colour of (non-selected) layer visualisations.
local selectedLayerColor = color(255, 255, 255, 168) -- The colour of (selected) layer visualisations.
local layerColor = color(255, 255, 255, 64) -- The colour of (non-selected) layer visualisations.
local selectedLayerColor = color(255, 255, 255, 168) -- The colour of (selected) layer visualisations.
local selLayerRed = color(255, 50, 50, 255) -- The red colour of (selected) layer internal details.
local selectedLayerColor = color(255, 255, 255, 168) -- The colour of (selected) layer visualisations.
local selLayerRed = color(255, 50, 50, 255) -- The red colour of (selected) layer internal details.
local selLayerGreen = color(50, 255, 50, 255) -- The green colour of (selected) layer internal details.
local selLayerRed = color(255, 50, 50, 255) -- The red colour of (selected) layer internal details.
local selLayerGreen = color(50, 255, 50, 255) -- The green colour of (selected) layer internal details.
local selLayerBlue = color(50, 50, 255, 255) -- The blue colour of (selected) layer internal details.
local selLayerGreen = color(50, 255, 50, 255) -- The green colour of (selected) layer internal details.
local selLayerBlue = color(50, 50, 255, 255) -- The blue colour of (selected) layer internal details.
local refLineColor = color(249, 224, 62, 255) -- The colour of the road road reference line.
local selLayerBlue = color(50, 50, 255, 255) -- The blue colour of (selected) layer internal details.
local refLineColor = color(249, 224, 62, 255) -- The colour of the road road reference line.
local guidelineColor = color(66, 70, 81, 255) -- The colour of the road guidelines.
local refLineColor = color(249, 224, 62, 255) -- The colour of the road road reference line.
local guidelineColor = color(66, 70, 81, 255) -- The colour of the road guidelines.
local guidelineColor2 = color(21, 24, 32, 255) -- The colour of the selected road guidelines.
local guidelineColor = color(66, 70, 81, 255) -- The colour of the road guidelines.
local guidelineColor2 = color(21, 24, 32, 255) -- The colour of the selected road guidelines.
local nodeHighlightColor = color(2, 29, 118, 255) -- The colour of the highlight at each road reference node.
local guidelineColor2 = color(21, 24, 32, 255) -- The colour of the selected road guidelines.
local nodeHighlightColor = color(2, 29, 118, 255) -- The colour of the highlight at each road reference node.
local groupPolygonColorTr = color(127, 127, 127, 255) -- The colour of the closing line segment of the group polygon polyline.
local nodeHighlightColor = color(2, 29, 118, 255) -- The colour of the highlight at each road reference node.
local groupPolygonColorTr = color(127, 127, 127, 255) -- The colour of the closing line segment of the group polygon polyline.
local terraVisColour = ColorF(0.5, 0, 0, 0.01) -- The colour of the terraforming range visualisation spheres.
local terraVisColourSingle = ColorF(0.5, 0, 0, 0.1) -- The colour of the terraforming range visualisation spheres.
local textA = color(0, 0, 0, 255) -- The markup text foreground colour.
local textB = color(255, 255, 255, 255) -- The markup text background colour.
local textA = color(0, 0, 0, 255) -- The markup text foreground colour.
local textB = color(255, 255, 255, 255) -- The markup text background colour.
local laneDirColor = color(35, 147, 184, 255) -- The lane direction markup colour.
local textB = color(255, 255, 255, 255) -- The markup text background colour.
local laneDirColor = color(35, 147, 184, 255) -- The lane direction markup colour.
local laneColours = { -- The lane type colours, in the road surface visualisation.
local laneColours = { -- The lane type colours, in the road surface visualisation.
road_lane = color(96, 101, 112, 255),
sidewalk = color(167, 174, 191, 255),
road_lane = color(96, 101, 112, 255),
sidewalk = color(167, 174, 191, 255),
shoulder = color(40, 43, 51, 255),
sidewalk = color(167, 174, 191, 255),
shoulder = color(40, 43, 51, 255),
island = color(200, 200, 200, 255) }
shoulder = color(40, 43, 51, 255),
island = color(200, 200, 200, 255) }
@/lua/common/utils.lua
function tableToColor(v)
return v and color(v.r, v.g, v.b, v.a) or 0
end
if type(v) == 'table' then
return color(v.r, v.g, v.b, v.a)
elseif type(v) == 'string' and string.len(v) > 7 and v:sub(1,1) == '#' then
v = v:gsub("#","")
return color(tonumber("0x"..v:sub(1,2)), tonumber("0x"..v:sub(3,4)), tonumber("0x"..v:sub(5,6)), tonumber("0x"..v:sub(7,8)))
elseif v == nil then
elseif v == nil then
return color(0,0,0,0)
end
function ironbowColor(x, a)
return color(255*min(1, max(0, x*1.55/(0.11+x) - 0.4)), 255*min(1, max(0,x*1.47 - 0.35)), 255*min(1, max(0, x*6-5, 0.63544-9.4*(x-0.26)*(x-0.26))), a)
end
function jetColor(x, a)
return color(255*min(1, max(0, 4 * x - 2)), 255*min(1, max(0, 2 - abs(4 * x - 2))), 255*min(1, max(0, 2 - 4 * x)), a)
end
local c = 255*x
return color(c, c, c, a)
end
@/lua/ge/extensions/career/modules/tether.lua
local function drawAxisBox(corner, x, y, z, clr)
clr = clr or color(128,64,64,32)
-- draw all faces in a loop
@/inspector/Views/ColorPicker.js
get color()
{
set color(color)
{
@/gameplay/missionTypes/scatterPickup/customNodes/scatterAnimatorNode.lua
if icon.remaining > 0 then
ui_apps_minimap_utils.simpleCircle(icon.pos, color(255,155,0,255),nil,6 + math.min(icon.remaining*0.1,6))
end
if icon.remaining > 0 then
ui_apps_minimap_utils.drawEdgePointer(icon.pos, color(255,155,0,255),nil,6 + math.min(icon.remaining*0.1,6), 150)
end
@/lua/ge/extensions/ui/apps/minimap/topomap.lua
-- level goes from 0 to 100
local clr = color(128 + level*1.25, 128 + level*1.25, 128 + level*1.25, 255)
local thickness = 1 + (level%10 == 0 and 0.5 or 0)
@/lua/ge/extensions/flowgraph/nodes/mission/knockAwayCheck.lua
local clr = color(255,0.333 * 255,0,255)
function C:onDrawOnMinimap(td)
@/lua/ge/extensions/flowgraph/nodes/events/customizedTriggerBox.lua
if self.trigger.type == 'Box' then
self:drawAxisBox(self.trigger.pos - (self.trigger.x + self.trigger.y + self.trigger.z), self.trigger.x*2, self.trigger.y*2, self.trigger.z*2, color(255, 128, 128, 64))
elseif self.trigger.type == 'Sphere' then
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceMarkers.lua
local modeColors = {
default = color(1*255, 0.07*255, 0*255, 255),
next = color(0.0*255, 0.0*255, 0.0*255, 255),
default = color(1*255, 0.07*255, 0*255, 255),
next = color(0.0*255, 0.0*255, 0.0*255, 255),
start = color(0.4*255, 1*255, 0.2*255, 255),
next = color(0.0*255, 0.0*255, 0.0*255, 255),
start = color(0.4*255, 1*255, 0.2*255, 255),
lap = color(0.4*255, 1*255, 0.2*255, 255),
start = color(0.4*255, 1*255, 0.2*255, 255),
lap = color(0.4*255, 1*255, 0.2*255, 255),
recovery = color(1*255, 0.85*255, 0*255, 255),
lap = color(0.4*255, 1*255, 0.2*255, 255),
recovery = color(1*255, 0.85*255, 0*255, 255),
final = color(0.1*255, 0.3*255, 1*255, 255),
recovery = color(1*255, 0.85*255, 0*255, 255),
final = color(0.1*255, 0.3*255, 1*255, 255),
branch = color(1*255, 0.6*255, 0*255, 255),
final = color(0.1*255, 0.3*255, 1*255, 255),
branch = color(1*255, 0.6*255, 0*255, 255),
hidden = color(64,64,64,192),
branch = color(1*255, 0.6*255, 0*255, 255),
hidden = color(64,64,64,192),
}
self.minimapMarkers[e[1].id].mode = e[2]
self.minimapMarkers[e[1].id].color = modeColors[e[2]] or color(255,255,255,255)
end
self.minimapMarkers[e[1].id].mode = 'next'
self.minimapMarkers[e[1].id].color = modeColors['next'] or color(255,255,255,255)
end
self.minimapMarkers[self.pinIn.raceData.value.path.config.graph[id].targetNode].mode = 'final'
self.minimapMarkers[self.pinIn.raceData.value.path.config.graph[id].targetNode].color = modeColors['final'] or color(255,255,255,255)
end
self.minimapMarkers[k].mode = 'default'
self.minimapMarkers[k].color = modeColors['default'] or color(255,255,255,255)
end
if m.left and m.right then
ui_apps_minimap_utils.simpleLineWithEdgePointer(m.left, m.right, clr, color(255,255,255,192))
else
else
ui_apps_minimap_utils.simpleCircleWithEdgePointer(m.pos, clr, color(255,255,255,192))
end
@/lua/ge/extensions/editor/buildingEditor.lua
if c == nil then
c = color(0, 0, 0, 255)
end
for o,n in pairs(anode) do
local clr = color(255,255,255,255)
if #U.index(Net.sregion, o) > 0 then
-- selected
clr = color(255,255,0,255)
end
if #U.index(apairskip, U.stamp({l[j-1], l[j]})) == 0 then
c = color(math.floor(255*j/#l),math.floor(255*(#l-j)/#l),0,255)
w = 2
else
c = color(0,255,255,255)
w = 1
end
Render.path(path, color(255,255,0,50), 3)
-- M.pathUp(buf, #l, color(255,255,0,50), 5)
Render.path(path, color(255,255,0,50), 3)
-- M.pathUp(buf, #l, color(255,255,0,50), 5)
end
@/lua/ge/extensions/gameplay/markers/parkingMarker.lua
if self.overlap then
--self:drawAxisBox(corner - vehX - vehY - vehZ, vehX*2, vehY*2, vehZ*2, color(64,64,128,64))
--self:drawAxisBox(self.pos - self.xVec - self.yVec - self.zVec, self.xVec*2, self.yVec*2, self.zVec*2, color(self.overlap and 0 or 255, self.overlap and 255 or 0, 0,64))
--self:drawAxisBox(corner - vehX - vehY - vehZ, vehX*2, vehY*2, vehZ*2, color(64,64,128,64))
--self:drawAxisBox(self.pos - self.xVec - self.yVec - self.zVec, self.xVec*2, self.yVec*2, self.zVec*2, color(self.overlap and 0 or 255, self.overlap and 255 or 0, 0,64))
distance = 0
-- minimap
local fillColor = color(72,125,249,255)
function C:drawOnMinimap(td)
local a, b, c = vec3(), vec3(), vec3()
local fillOrange = color(255,165,0,255)
local strikeColor = color(255,255,255,255)
local fillOrange = color(255,165,0,255)
local strikeColor = color(255,255,255,255)
local bgColor = color(255,255,255,255) -- white background
local strikeColor = color(255,255,255,255)
local bgColor = color(255,255,255,255) -- white background
function C:drawOnMinimap(td)
function C:drawAxisBox(corner, x, y, z, clr)
clr = clr or color(128,64,64,32)
-- draw all faces in a loop
@/lua/vehicle/extensions/scenario/shiftBooster.lua
end
obj.debugDrawProxy:drawSphere(boostTime, obj:getPosition() + vec3(0, 0, 2), color(math.sin(boostTime) * 255, math.cos(boostTime * 2) * 255, 0, 255))
end
@/lua/ge/extensions/gameplay/markers/driftLineMarker.lua
-- minimap
local fillColor = color(72,125,249,255)
function C:drawOnMinimap(td)
@/lua/vehicle/partCondition.lua
for _, flexbody in pairs(v.data.flexbodies) do
--TODO: check maybe a tag that tells us if the flexbody can change color (and how?), paint vs glas vs plastic etc
if flexbody.partPath then
@/lua/ge/extensions/editor/tech/sensorConfiguration/utilities.lua
-- Module constants.
local sensorColor = color(0, 0, 0, 255) -- The line colour of the sensor box visualisations.
local sensorTriColor = color(127, 127, 127, 255) -- The face colour of the sensor box visualisations.
local sensorColor = color(0, 0, 0, 255) -- The line colour of the sensor box visualisations.
local sensorTriColor = color(127, 127, 127, 255) -- The face colour of the sensor box visualisations.
local sphereColor = color(0, 0, 255, 255) -- The colour of the mouse spheres, when placing sensors.
local sensorTriColor = color(127, 127, 127, 255) -- The face colour of the sensor box visualisations.
local sphereColor = color(0, 0, 255, 255) -- The colour of the mouse spheres, when placing sensors.
local dirLineColor = color(0, 255, 0, 255) -- The colour of the 'dir' axes, when drawing sensor poses.
local sphereColor = color(0, 0, 255, 255) -- The colour of the mouse spheres, when placing sensors.
local dirLineColor = color(0, 255, 0, 255) -- The colour of the 'dir' axes, when drawing sensor poses.
local upLineColor = color(0, 0, 255, 255) -- The colour of the 'up' axes, when drawing sensor poses.
local dirLineColor = color(0, 255, 0, 255) -- The colour of the 'dir' axes, when drawing sensor poses.
local upLineColor = color(0, 0, 255, 255) -- The colour of the 'up' axes, when drawing sensor poses.
local rightLineColor = color(255, 0, 0, 255) -- The colour of the 'right' axes, when drawing sensor poses.
local upLineColor = color(0, 0, 255, 255) -- The colour of the 'up' axes, when drawing sensor poses.
local rightLineColor = color(255, 0, 0, 255) -- The colour of the 'right' axes, when drawing sensor poses.
local textA = color(25, 25, 25, 255) -- The markup text foreground colour.
local rightLineColor = color(255, 0, 0, 255) -- The colour of the 'right' axes, when drawing sensor poses.
local textA = color(25, 25, 25, 255) -- The markup text foreground colour.
local textB = color(255, 255, 255, 192) -- The markup text background colour.
local textA = color(25, 25, 25, 255) -- The markup text foreground colour.
local textB = color(255, 255, 255, 192) -- The markup text background colour.
local beamColour = ColorF(0.5, 0.5, 0.5, 0.1) -- The colour of the sensor beam (ultrasonic, RADAR).
@/lua/ge/extensions/editor/toolUtilities/style.lua
-- Colours.
colourMousePos = color(130, 40, 130, 128), -- The colour of the mouse position sphere (cursor).
colourMousePosInactive = color(255, 0, 0, 110), -- Inactive/disabled state cursor colour (red, transparent).
colourMousePos = color(130, 40, 130, 128), -- The colour of the mouse position sphere (cursor).
colourMousePosInactive = color(255, 0, 0, 110), -- Inactive/disabled state cursor colour (red, transparent).
colourNode = color(30, 15, 200, 255), -- The colour of the spline node spheres.
colourMousePosInactive = color(255, 0, 0, 110), -- Inactive/disabled state cursor colour (red, transparent).
colourNode = color(30, 15, 200, 255), -- The colour of the spline node spheres.
colourRibHandle = color(230, 77, 77, 255), -- The colour of the rib handle spheres.
colourNode = color(30, 15, 200, 255), -- The colour of the spline node spheres.
colourRibHandle = color(230, 77, 77, 255), -- The colour of the rib handle spheres.
colourBarHandle = color(25, 178, 178, 255), -- The colour of the bar handle spheres.
colourRibHandle = color(230, 77, 77, 255), -- The colour of the rib handle spheres.
colourBarHandle = color(25, 178, 178, 255), -- The colour of the bar handle spheres.
colourHighlight = color(90, 90, 110, 150), -- Darker highlight to read over glowing nodes.
colourBarHandle = color(25, 178, 178, 255), -- The colour of the bar handle spheres.
colourHighlight = color(90, 90, 110, 150), -- Darker highlight to read over glowing nodes.
colourHighlightSelected = color(50, 55, 60, 190), -- Selected-node highlight (darker).
colourHighlight = color(90, 90, 110, 150), -- Darker highlight to read over glowing nodes.
colourHighlightSelected = color(50, 55, 60, 190), -- Selected-node highlight (darker).
colourSpline = color(0, 30, 70, 255), -- The colour of the spline line segments when selected.
colourSplineDull = color(70, 75, 80, 120),
colourSpline = color(0, 30, 70, 255), -- The colour of the spline line segments when selected.
colourSplineDull = color(70, 75, 80, 120),
colourSplineLinked = color(207, 29, 29, 100), -- The colour of the linked spline line segments.
colourSplineDull = color(70, 75, 80, 120),
colourSplineLinked = color(207, 29, 29, 100), -- The colour of the linked spline line segments.
colourSplineLinkedDull = color(100, 50, 50, 64), -- The colour of the linked spline line segments when not selected.
colourSplineLinked = color(207, 29, 29, 100), -- The colour of the linked spline line segments.
colourSplineLinkedDull = color(100, 50, 50, 64), -- The colour of the linked spline line segments when not selected.
colourNodeDull = color(110, 150, 200, 185), -- The colour of the spline node spheres when not selected. (bluer, same transparency)
colourSplineLinkedDull = color(100, 50, 50, 64), -- The colour of the linked spline line segments when not selected.
colourNodeDull = color(110, 150, 200, 185), -- The colour of the spline node spheres when not selected. (bluer, same transparency)
colourLayerWire = color(255, 255, 255, 180), -- The colour of the wire frame 1 (eg for layers).
colourNodeDull = color(110, 150, 200, 185), -- The colour of the spline node spheres when not selected. (bluer, same transparency)
colourLayerWire = color(255, 255, 255, 180), -- The colour of the wire frame 1 (eg for layers).
colourLayerWire2 = color(0, 0, 0, 255), -- The colour of the wire frame 2 (for Master Splines).
colourLayerWire = color(255, 255, 255, 180), -- The colour of the wire frame 1 (eg for layers).
colourLayerWire2 = color(0, 0, 0, 255), -- The colour of the wire frame 2 (for Master Splines).
colourLayerWire3 = color(40, 40, 40, 180), -- The colour of the wire frame 3 (for Master Splines).
colourLayerWire2 = color(0, 0, 0, 255), -- The colour of the wire frame 2 (for Master Splines).
colourLayerWire3 = color(40, 40, 40, 180), -- The colour of the wire frame 3 (for Master Splines).
colourPreviewWire = color(255, 180, 180, 255), -- The colour of the preview wire frame lines.
colourLayerWire3 = color(40, 40, 40, 180), -- The colour of the wire frame 3 (for Master Splines).
colourPreviewWire = color(255, 180, 180, 255), -- The colour of the preview wire frame lines.
colourRibLine = color(80, 130, 200, 255), -- The colour of the rib lines (the line segment between the two rib handles).
colourPreviewWire = color(255, 180, 180, 255), -- The colour of the preview wire frame lines.
colourRibLine = color(80, 130, 200, 255), -- The colour of the rib lines (the line segment between the two rib handles).
colourBarLine = color(200, 130, 80, 255), -- The colour of the bar lines (the line segment between the bar and the ground).
colourRibLine = color(80, 130, 200, 255), -- The colour of the rib lines (the line segment between the two rib handles).
colourBarLine = color(200, 130, 80, 255), -- The colour of the bar lines (the line segment between the bar and the ground).
colourGround = color(0, 30, 70, 255), -- The colour of the ground line when selected (for 3D splines).
colourBarLine = color(200, 130, 80, 255), -- The colour of the bar lines (the line segment between the bar and the ground).
colourGround = color(0, 30, 70, 255), -- The colour of the ground line when selected (for 3D splines).
colourGroundDull = color(100, 100, 110, 64), -- The colour of the ground line when not selected (for 3D splines).
colourGround = color(0, 30, 70, 255), -- The colour of the ground line when selected (for 3D splines).
colourGroundDull = color(100, 100, 110, 64), -- The colour of the ground line when not selected (for 3D splines).
colourDrop = color(150, 150, 160, 180), -- The colour of the drop line when selected (for 3D splines).
colourGroundDull = color(100, 100, 110, 64), -- The colour of the ground line when not selected (for 3D splines).
colourDrop = color(150, 150, 160, 180), -- The colour of the drop line when selected (for 3D splines).
colourDropThicker = color(235, 235, 255, 220), -- The colour of thicker drop lines when selected (for 3D splines).
colourDrop = color(150, 150, 160, 180), -- The colour of the drop line when selected (for 3D splines).
colourDropThicker = color(235, 235, 255, 220), -- The colour of thicker drop lines when selected (for 3D splines).
colourDropDull = color(100, 100, 110, 64), -- The colour of the drop line when not selected (for 3D splines).
colourDropThicker = color(235, 235, 255, 220), -- The colour of thicker drop lines when selected (for 3D splines).
colourDropDull = color(100, 100, 110, 64), -- The colour of the drop line when not selected (for 3D splines).
colourNormal = color(180, 180, 180, 100), -- The colour of the normal lines.
colourDropDull = color(100, 100, 110, 64), -- The colour of the drop line when not selected (for 3D splines).
colourNormal = color(180, 180, 180, 100), -- The colour of the normal lines.
colourRefNormal = color(130, 130, 130, 100), -- The colour of the reference normal lines.
colourNormal = color(180, 180, 180, 100), -- The colour of the normal lines.
colourRefNormal = color(130, 130, 130, 100), -- The colour of the reference normal lines.
colourArcSeg = color(255, 255, 0, 100), -- The colour of the arc segments.
colourRefNormal = color(130, 130, 130, 100), -- The colour of the reference normal lines.
colourArcSeg = color(255, 255, 0, 100), -- The colour of the arc segments.
colourLoop = color(230, 77, 77, 255), -- The colour of the candidate loop line, to indicate to user that ends can form a loop.
colourArcSeg = color(255, 255, 0, 100), -- The colour of the arc segments.
colourLoop = color(230, 77, 77, 255), -- The colour of the candidate loop line, to indicate to user that ends can form a loop.
colourNotSelectedSurf = color(150, 150, 150, 150), -- The colour of surfaces which are not selected.
colourNavGraphRibbon = color(80, 130, 200, 80), -- The colour of navgraph ribbon surfaces (more transparent, nicer blue).
colourNotSelectedSurf = color(150, 150, 150, 150), -- The colour of surfaces which are not selected.
colourNavGraphRibbon = color(80, 130, 200, 80), -- The colour of navgraph ribbon surfaces (more transparent, nicer blue).
colourNotSelectedSurf2 = color(100, 100, 100, 70), -- The colour of surfaces which are not selected.
colourNavGraphRibbon = color(80, 130, 200, 80), -- The colour of navgraph ribbon surfaces (more transparent, nicer blue).
colourNotSelectedSurf2 = color(100, 100, 100, 70), -- The colour of surfaces which are not selected.
colourPreviewSurf = color(200, 60, 60, 64), -- The colour of preview surfaces.
colourNotSelectedSurf2 = color(100, 100, 100, 70), -- The colour of surfaces which are not selected.
colourPreviewSurf = color(200, 60, 60, 64), -- The colour of preview surfaces.
colourActiveSurf = color(200, 200, 220, 255), -- The colour of an 'active' surface.
colourPreviewSurf = color(200, 60, 60, 64), -- The colour of preview surfaces.
colourActiveSurf = color(200, 200, 220, 255), -- The colour of an 'active' surface.
-- Subtle glow accents (for selected elements) – low computation, drawn as a single extra pass.
colourSplineGlow = color(80, 130, 200, 96), -- Outer glow for selected spline lines.
colourNodeGlow = color(80, 130, 200, 96), -- Outer glow for selected nodes.
colourSplineGlow = color(80, 130, 200, 96), -- Outer glow for selected spline lines.
colourNodeGlow = color(80, 130, 200, 96), -- Outer glow for selected nodes.
colourRibGlow = color(120, 160, 210, 90),
colourNodeGlow = color(80, 130, 200, 96), -- Outer glow for selected nodes.
colourRibGlow = color(120, 160, 210, 90),
colourBarGlow = color(120, 160, 210, 90),
colourRibGlow = color(120, 160, 210, 90),
colourBarGlow = color(120, 160, 210, 90),
colourWireGlow = color(200, 200, 220, 110),
colourBarGlow = color(120, 160, 210, 90),
colourWireGlow = color(200, 200, 220, 110),
colourGraphClearNode = color(140, 230, 150, 160), -- Colours for the nav graph visualisation.
colourNavGraphNode = color(100, 120, 100, 200),
colourGraphClearNode = color(140, 230, 150, 160), -- Colours for the nav graph visualisation.
colourNavGraphNode = color(100, 120, 100, 200),
colourPathNode = color(80, 250, 123, 255),
colourNavGraphNode = color(100, 120, 100, 200),
colourPathNode = color(80, 250, 123, 255),
colourPathNodeBig = color(80, 250, 123, 255),
colourPathNode = color(80, 250, 123, 255),
colourPathNodeBig = color(80, 250, 123, 255),
colourNav = color(50, 50, 50, 255),
colourPathNodeBig = color(80, 250, 123, 255),
colourNav = color(50, 50, 50, 255),
colourPath = color(152, 255, 152, 255),
colourNav = color(50, 50, 50, 255),
colourPath = color(152, 255, 152, 255),
textForeground = color(0, 0, 0, 255), -- The text foreground colour.
textBackground = color(255, 255, 255, 255), -- The text background colour.
textForeground = color(0, 0, 0, 255), -- The text foreground colour.
textBackground = color(255, 255, 255, 255), -- The text background colour.
-- Measurement overlays.
colourMeasurementGuide = color(66, 70, 81, 255),
colourMeasurementGuideSel = color(21, 24, 32, 255),
colourMeasurementGuide = color(66, 70, 81, 255),
colourMeasurementGuideSel = color(21, 24, 32, 255),
colourMeasurementObstacle = color(255, 0, 0, 180),
colourMeasurementGuideSel = color(21, 24, 32, 255),
colourMeasurementObstacle = color(255, 0, 0, 180),
colourExtensionLine = color(0, 0, 0, 255),
colourMeasurementObstacle = color(255, 0, 0, 180),
colourExtensionLine = color(0, 0, 0, 255),
colourExtensionLineSel = color(0, 0, 0, 255),
colourExtensionLine = color(0, 0, 0, 255),
colourExtensionLineSel = color(0, 0, 0, 255),
measurementGuideThickness = 3,
@/lua/ge/extensions/editor/gen/decal.lua
-- out.aplot = {{e=ap2}}
-- Render.path(out['red'], color(255,200,200,155), 4)
-- check curvature
for i,d in pairs(out.aplot) do
Render.path(d.e, color(255,255,0,155), 4)
end
for i,d in pairs(out.aplot) do
Render.path(d.e, color(255,255,0,155), 4)
end
if out.inplot then
-- Render.path(out.inplot, color(255,255,0,155), 4)
end
-- U.dump(e, '?? for_eg:'..#out.aseg)
-- Render.path(e, color(255,255,0,155), 1)
-- debugDrawer:drawLine(e[1], e[2], ColorF(1,1,0,1), 4)
if cjunc and ajunc[cjunc] and ajunc[cjunc].r then
R.circle(ajunc[cjunc].p+vec3(0,0,1), ajunc[cjunc].r, color(255,255,0,255), 4)
end
sphere(out.pdrag.p, 0.2, ColorF(1,1,1,0.4))
-- Render.path(out.pdrag.dir, color(255,255,250,155), 8)
-- debugDrawer:drawLine(vec3(0,0,0), vec3(10,0,0), c, w)
for _,d in pairs(out.acirc) do
R.circle(d.p, d.r, color(255,255,0,255), 4)
end
for _,t in pairs(out.atri) do
debugDrawer:drawTriSolid(t[1],t[2],t[3],color(255,255,220,200))
end
@/lua/vehicle/powertrain/turbocharger.lua
-- Audio Debug
-- print (string.format(" BOV Volume(pressure) = %0.2f (= relativePressure %.2f * turboSizeCoef %.2f) :::: color(bovSoundVolumeCoef) = %0.2f ", relativePressure * turboSizeCoef, relativePressure, turboSizeCoef, bovSoundVolumeCoef).." :::: "..turbo.bovSoundFileName)
bovSound = bovSound or obj:createSFXSource2(turbo.bovSoundFileName or "event:>Vehicle>Forced_Induction>Turbo_01>turbo_bov", "AudioDefaultLoop3D", "Bov", assignedEngine.engineNodeID, 0)
-- Audio Debug
-- print (string.format("FLUT Volume(pressure) = %0.2f (= relativePressure %.2f * turboSizeCoef %.2f) :::: color(flutterSoundVolumeCoef) = %0.2f", relativePressure * turboSizeCoef, relativePressure, turboSizeCoef, flutterSoundVolumeCoef).." :::: "..turbo.flutterSoundFileName)
flutterSound = flutterSound or obj:createSFXSource2(turbo.flutterSoundFileName or "event:>Vehicle>Forced_Induction>Turbo_02>turbo_bov", "AudioDefaultLoop3D", "Flutter", assignedEngine.engineNodeID, 0)
@/lua/ge/extensions/editor/gen/network.lua
for o,n in pairs(anode) do
local clr = color(255,255,255,255)
if #U.index(Net.sregion, o) > 0 then
-- selected
clr = color(255,255,0,255)
end
if #U.index(apairskip, U.stamp({l[j-1], l[j]})) == 0 then
c = color(math.floor(255*j/#l),math.floor(255*(#l-j)/#l),0,255)
w = 2
else
c = color(0,255,255,255)
w = 1
@/lua/vehicle/material.lua
local emissiveScaleValue = linearScale(localVal, 0, emissiveMax, 0, 255)
obj:setMaterialEmissiveFactor(va.msc, color(emissiveScaleValue, emissiveScaleValue, emissiveScaleValue))
end
@/lua/vehicle/recovery.lua
local rewindPositionDelay = 0.7
local debugColor = color(255, 102, 0, 255)
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veNodeTriSelfCollisionDetector.lua
local greenColor255 = color(0,255,0,255)
@/lua/vehicle/extensions/skeleton.lua
for _, beam in pairs(v.data.beams) do
obj.debugDrawProxy:drawBeam3d(beam.cid, 0.01, color(44, 71, 112, 230))
end
for _, node in pairs(v.data.nodes) do
obj.debugDrawProxy:drawNodeSphere(node.cid, 0.03, color(170, 57, 57, 230))
end
obj.debugDrawProxy:drawColTris(0, color(0, 0, 0, 150), color(0, 100, 0, 50), color(100, 0, 0, 50), 1, color(0, 0, 255, 255))
end
obj.debugDrawProxy:drawColTris(0, color(0, 0, 0, 150), color(0, 100, 0, 50), color(100, 0, 0, 50), 1, color(0, 0, 255, 255))
end
obj.debugDrawProxy:drawColTris(0, color(0, 0, 0, 150), color(0, 100, 0, 50), color(100, 0, 0, 50), 1, color(0, 0, 255, 255))
end
obj.debugDrawProxy:drawColTris(0, color(0, 0, 0, 150), color(0, 100, 0, 50), color(100, 0, 0, 50), 1, color(0, 0, 255, 255))
end
@/lua/ge/extensions/editor/gen/render.lua
if c == nil then
c = color(0, 0, 0, 255)
end
end
local c = color(math.floor(c[1]*255),math.floor(c[2]*255),math.floor(c[3]*255))
pathUp(buf, n/6, c, w, z)
@/lua/vehicle/props.lua
local flareScale = linearScale(val, prop.scaleLightFlareScaleMinInput, prop.scaleLightFlareScaleMaxInput, 0, prop.flareScale)
local lightColor = color(linearScale(val, 1, 0, prop.lightColor.r, prop.lightColor.r - prop.scaleLightColorOffsetRed), linearScale(val, 1, 0, prop.lightColor.g, prop.lightColor.g - prop.scaleLightColorOffsetGreen), linearScale(val, 1, 0, prop.lightColor.b, prop.lightColor.b - prop.scaleLightColorOffsetBlue), prop.lightColor.a)
obj:setPropLight(prop.pid, lightBrightness, flareScale, lightColor)
@/lua/ge/extensions/gameplay/markers/gasStationMarker.lua
function C:drawAxisBox(corner, x, y, z, clr)
clr = clr or color(128,64,64,32)
-- draw all faces in a loop
@/lua/ge/extensions/gameplay/sites/zone.lua
ui_apps_minimap_utils.worldToMapXYZ(t2, self.vertices[v.next].pos)
td:line(t1.x, t1.y, t2.x, t2.y, 1, 1, 0, 0, color(255, 255, 255, 250), color(255, 255, 255, 250), color(255, 255, 255, 250), color(255, 255, 255, 250))
end
ui_apps_minimap_utils.worldToMapXYZ(t2, self.vertices[v.next].pos)
td:line(t1.x, t1.y, t2.x, t2.y, 1, 1, 0, 0, color(255, 255, 255, 250), color(255, 255, 255, 250), color(255, 255, 255, 250), color(255, 255, 255, 250))
end
ui_apps_minimap_utils.worldToMapXYZ(t2, self.vertices[v.next].pos)
td:line(t1.x, t1.y, t2.x, t2.y, 1, 1, 0, 0, color(255, 255, 255, 250), color(255, 255, 255, 250), color(255, 255, 255, 250), color(255, 255, 255, 250))
end
ui_apps_minimap_utils.worldToMapXYZ(t2, self.vertices[v.next].pos)
td:line(t1.x, t1.y, t2.x, t2.y, 1, 1, 0, 0, color(255, 255, 255, 250), color(255, 255, 255, 250), color(255, 255, 255, 250), color(255, 255, 255, 250))
end
end
local col = color(clrI.r,clrI.g,clrI.b,clrI.a)
@/ui/ui-vue/src/utils/colorUtils.js
* @param {string} [params.color] - Main branch color
* @param {string} [params.accentColor] - Accent color (falls back to main color if not provided)
* @returns {Object} Style object with --branch-color and --branch-accent-color CSS variables
@/lua/ge/extensions/ui/apps/minimap/utils.lua
-- Color definitions
local clrFocus = color(255,115,10,255)
local clrFocusMuted = color(255*0.8,165*0.8,80,255)
local clrFocus = color(255,115,10,255)
local clrFocusMuted = color(255*0.8,165*0.8,80,255)
local clrGrayMuted = color(100,100,100,255)
local clrFocusMuted = color(255*0.8,165*0.8,80,255)
local clrGrayMuted = color(100,100,100,255)
local clrRoadBgTransparentBlack = color(50, 50, 50, 255)
local clrGrayMuted = color(100,100,100,255)
local clrRoadBgTransparentBlack = color(50, 50, 50, 255)
local clrNavBgBlack = color(70,70,70,255)
local clrRoadBgTransparentBlack = color(50, 50, 50, 255)
local clrNavBgBlack = color(70,70,70,255)
local clrGridWhite = color(160,160,160,255)
local clrNavBgBlack = color(70,70,70,255)
local clrGridWhite = color(160,160,160,255)
local clrNavBg = color(255,255,255,255)
local clrGridWhite = color(160,160,160,255)
local clrNavBg = color(255,255,255,255)
local clrNavFg = color(0,0.4*255,1*255,255)
local clrNavBg = color(255,255,255,255)
local clrNavFg = color(0,0.4*255,1*255,255)
local strikeWidth = 3.0
local fillColor = color(254,102,1,255)
local strikeColor = color(255,255,255,255)
local fillColor = color(254,102,1,255)
local strikeColor = color(255,255,255,255)
local circlePos = vec3()
name = "Default",
color = color(220,220,220,255),
colorLow = color(150,150,120,255),
color = color(220,220,220,255),
colorLow = color(150,150,120,255),
colorLowest = color(150,120,100,255),
colorLow = color(150,150,120,255),
colorLowest = color(150,120,100,255),
clrFocus = clrFocus,
name = "Monochrome",
color = color(200,200,200,255),
colorLow = color(170,170,170,255),
color = color(200,200,200,255),
colorLow = color(170,170,170,255),
colorLowest = color(140,140,140,255),
colorLow = color(170,170,170,255),
colorLowest = color(140,140,140,255),
clrFocus = color(240,240,240,255),
colorLowest = color(140,140,140,255),
clrFocus = color(240,240,240,255),
clrFocusMuted = color(200,200,200,255),
clrFocus = color(240,240,240,255),
clrFocusMuted = color(200,200,200,255),
gridWhite = clrGridWhite,
gridWhite = clrGridWhite,
navFg = color(255,255,255,255),
navBg = color(32,32,64,255),
navFg = color(255,255,255,255),
navBg = color(32,32,64,255),
grayMuted = clrGrayMuted,
name = "Green",
color = color(220,220,220,255),
colorLow = color(120,200,120,255),
color = color(220,220,220,255),
colorLow = color(120,200,120,255),
colorLowest = color(90,150,60,255),
colorLow = color(120,200,120,255),
colorLowest = color(90,150,60,255),
clrFocus = clrFocus,
name = "Blue",
color = color(220,220,220,255),
colorLow = color(120,120,200,255),
color = color(220,220,220,255),
colorLow = color(120,120,200,255),
colorLowest = color(90,60,150,255),
colorLow = color(120,120,200,255),
colorLowest = color(90,60,150,255),
clrFocus = clrFocus,
name = "Orange",
color = color(220,220,220,255),
colorLow = color(200,180,160,255),
color = color(220,220,220,255),
colorLow = color(200,180,160,255),
colorLowest = color(180,150,100,255),
colorLow = color(200,180,160,255),
colorLowest = color(180,150,100,255),
clrFocus = clrFocus,
name = "Grayscale",
color = color(220,220,220,255),
colorLow = color(150,150,150,255),
color = color(220,220,220,255),
colorLow = color(150,150,150,255),
colorLowest = color(100,100,100,255),
colorLow = color(150,150,150,255),
colorLowest = color(100,100,100,255),
clrFocus = clrFocus,
@/gameplay/missionTypes/collection/customNodes/collectionMarkersNode.lua
clr = clr - clr%(0.05)
clrByNum[clr] = clrByNum[clr] or color(unpack(rainbowColor(36,(0.05+(0.75*clr))*12)))
end
clr = clr - clr%(0.05)
clrByNum[clr] = clrByNum[clr] or color(unpack(rainbowColor(36,(0.05+(0.75*clr))*12)))
end
@/lua/ge/extensions/editor/toolUtilities/render.lua
local r, g, b = util.getHueBasedColour255(t)
local col = color(r, g, b, 255)
drawTriCulled(bL, bR, tL, col)
@/lua/ge/extensions/editor/visualization.lua
local function _colf(r, g, b, a)
return color(
math.floor((r or 0) * 255 + 0.5),
@/lua/vehicle/extensions/tech/advancedIMU.lua
if data.isVisualised == true then
obj.debugDrawProxy:drawSphere(0.05, data.currentPos, color(0, 255, 0, 255))
end
@/lua/ge/extensions/editor/gen/mesh.lua
M.out.agraph[1] = {list=apath,c={1,1,1,0.6},w=3}
-- Render.graph(apath, color(240,255,240,155))
-- make frame
@/lua/ge/extensions/ui/apps/minimap/route.lua
local clrNavBg = color(255,255,255,255)
local clrNavFg = color(0,0.4*255,1*255,255)
local clrNavBg = color(255,255,255,255)
local clrNavFg = color(0,0.4*255,1*255,255)
local t = (1 - distance / blendDistance) * 0.66
return color(
t*255,
@/lua/ge/extensions/flowgraph/nodes/gameplay/decalCircle.lua
{ dir = 'in', type = 'color', name = 'filledColor', hidden = true, hardcoded = true, default = deepcopy(defaultFGColor), description = 'Primary color.' },
{ dir = 'in', type = 'color', name = 'fillingColor1', hidden = true, hardcoded = true, default = deepcopy(defaultFGColor1), description = 'First filling color (progress).' },
{ dir = 'in', type = 'color', name = 'fillingColor2', hidden = true, hardcoded = true, default = deepcopy(defaultFGColor2), description = 'Second filling color (cooldown).' },
{ dir = 'in', type = 'color', name = 'fillingColor1', hidden = true, hardcoded = true, default = deepcopy(defaultFGColor1), description = 'First filling color (progress).' },
{ dir = 'in', type = 'color', name = 'fillingColor2', hidden = true, hardcoded = true, default = deepcopy(defaultFGColor2), description = 'Second filling color (cooldown).' },
{ dir = 'in', type = 'color', name = 'backgroundColor', hidden = true, hardcoded = true, default = deepcopy(defaultBGColor), description = 'Secondary color (opposite of filling).' }
{ dir = 'in', type = 'color', name = 'fillingColor2', hidden = true, hardcoded = true, default = deepcopy(defaultFGColor2), description = 'Second filling color (cooldown).' },
{ dir = 'in', type = 'color', name = 'backgroundColor', hidden = true, hardcoded = true, default = deepcopy(defaultBGColor), description = 'Secondary color (opposite of filling).' }
}
@/lua/ge/extensions/tech/techCore.lua
else
debugDrawer:drawTriSolid(triangle.a, triangle.b, triangle.c, color(triangle.color.r,triangle.color.g,triangle.color.b,triangle.color.a))
end
@/lua/ge/extensions/flowgraph/nodes/scene/rectMarker.lua
c,
color(clr[1]*255,clr[2]*255,clr[3]*255,64))
end
@/lua/vehicle/extensions/tech/tyreBarrier.lua
local data = IMUcontroller.getSensorData()
obj.debugDrawProxy:drawSphere(0.05, data.currentPos, color(0, 255, 0, 255))
obj.debugDrawProxy:drawLine(data.currentPos, data.currentPos + data.currentDir, color(0, 255, 0, 255)) -- direction.
obj.debugDrawProxy:drawSphere(0.05, data.currentPos, color(0, 255, 0, 255))
obj.debugDrawProxy:drawLine(data.currentPos, data.currentPos + data.currentDir, color(0, 255, 0, 255)) -- direction.
end
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veCrashTester.lua
pos + tempStartDir * vec3(0,3,0),
color(255,0,0,128)
)
pos + startDir * vec3(0,3,0),
color(255,0,0,255)
)
@/lua/vehicle/extensions/advancedwheeldebug.lua
-- obj.debugDrawProxy:drawLine(centerPos, centerPos + vectorRight, color(255,0,0,255))
-- obj.debugDrawProxy:drawLine(centerPos, centerPos + vectorForward, color(0,255,0,255))
-- obj.debugDrawProxy:drawLine(centerPos, centerPos + vectorRight, color(255,0,0,255))
-- obj.debugDrawProxy:drawLine(centerPos, centerPos + vectorForward, color(0,255,0,255))
-- obj.debugDrawProxy:drawLine(centerPos, centerPos + vectorUp, color(0,0,255,255))
-- obj.debugDrawProxy:drawLine(centerPos, centerPos + vectorForward, color(0,255,0,255))
-- obj.debugDrawProxy:drawLine(centerPos, centerPos + vectorUp, color(0,0,255,255))
@/gameplay/missionTypes/delivery/customNodes/VehicleInTargetAreaNode.lua
end
--self:drawAxisBox(updateData.bbCenter - updateData.bbHalfAxis0 - updateData.bbHalfAxis1 - updateData.bbHalfAxis2, updateData.bbHalfAxis0*2, updateData.bbHalfAxis1*2, updateData.bbHalfAxis2*2, dist <= sqrDist and color(0,255,0,128) or color(255,0,0,128))
end
end
--self:drawAxisBox(updateData.bbCenter - updateData.bbHalfAxis0 - updateData.bbHalfAxis1 - updateData.bbHalfAxis2, updateData.bbHalfAxis0*2, updateData.bbHalfAxis1*2, updateData.bbHalfAxis2*2, dist <= sqrDist and color(0,255,0,128) or color(255,0,0,128))
end
function C:drawAxisBox(corner, x, y, z, clr)
clr = clr or color(128,64,64,32)
-- draw all faces in a loop
@/lua/ge/extensions/editor/camPathEditor.lua
local function toColorI(colorF)
return color(colorF.r * 255, colorF.g * 255, colorF.b * 255, colorF.a * 255)
end
@/lua/ge/extensions/editor/gen/exp_meshexplorer.lua
campos + 10*dir + vx*v3.x + vy*v3.y,
color(128,0,64,1)
)
campos + 10*dir + vx*v3.x + vy*v3.y,
color(128,0,64,1)
)
@/lua/ge/extensions/gameplay/rally/loop/rallyLoopManager.lua
local clrI = ColorI(clr[1] * 255, clr[2] * 255, clr[3] * 255, 255)
-- local clrPacked = color(clr[1] * 255, clr[2] * 255, clr[3] * 255, 255)
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veVehicleSpawner.lua
pos + tempStartDir * vec3(0,3,0),
color(255,0,0,128)
)
pos + startDir * vec3(0,3,0),
color(255,0,0,255)
)
@/lua/ge/extensions/scenario/raceMarkers/crawlMarker.lua
end
ui_apps_minimap_utils.simpleCircle(self.pos, color(self.currentColor.r*255, self.currentColor.g*255, self.currentColor.b*255, 255))
end
@/lua/ge/extensions/editor/util/editorElementHelper.lua
local blackColorI = ColorI(0,0,0,192)
local blackColor = color(0,0,0,192)
local function label(e)
local scl = (x+y+z)/2
C:drawAxisBox((-scl+e.transform.pos),x,y,z,color(e.drawColor[1]*255, e.drawColor[2]*255, e.drawColor[3]*255, e.drawColor[4]*255))
elseif e.drawMode == 'fullBox' then
local scl = (x+y+z)
C:drawAxisBox((-scl+e.transform.pos),x*2,y*2,z*2,color(e.drawColor[1]*255, e.drawColor[2]*255, e.drawColor[3]*255, e.drawColor[4]*255))
end
local x, y, z = xn*2, yn*4.2, zn*1.8
local clr = color(e.drawColor[1]*255, e.drawColor[2]*255, e.drawColor[3]*255, e.drawColor[4]*255)
debugDrawer:drawTriSolid(
@/lua/vehicle/extensions/tech/GPS.lua
if data.isVisualised == true then
obj.debugDrawProxy:drawSphere(0.05, data.pos, color(0, 255, 0, 255))
end
@/lua/vehicle/extensions/scenario/annotate.lua
local p1 = obj:getPosition() + vec3(0, 0, 2)
obj.debugDrawProxy:drawText(p1, color(0,0,0,255), data.text)
obj.debugDrawProxy:drawLine(obj:getPosition(), p1, color(0, 0, 0, 255))
obj.debugDrawProxy:drawText(p1, color(0,0,0,255), data.text)
obj.debugDrawProxy:drawLine(obj:getPosition(), p1, color(0, 0, 0, 255))
end
@/lua/ge/extensions/gameplay/rally/loop/stagedCountdownUtils.lua
local x, y, z = rot * vec3(scale/2,0,0), rot * vec3(0,scale/2,0), rot * vec3(0,0,scale/2)
local col = color(128, 0, 255, 128) -- purple
if normals then
@/lua/ge/extensions/gameplay/markers/missionMarker.lua
local a, b, c = vec3(), vec3(), vec3()
local fillColor = color(72,125,249,255)
local strikeColor = color(255,255,255,255)
local fillColor = color(72,125,249,255)
local strikeColor = color(255,255,255,255)
function C:drawOnMinimap(td, dpi)
@/lua/ge/extensions/editor/driftDataEditor.lua
local scl = (x+y+z)/2
M.drawAxisBox(((-scl*2)+elem.pos),x*2,y*2,z*2,color(0,0,255,0.2*255))
--local scl = (x+y+z)
--local scl = (x+y+z)
--M.drawAxisBox((-scl+elem.pos),x*2,y*2,z*2,color(0,0,255,0.2*255))
end
debugDrawer:drawTextAdvanced(vec3(lineData.pos), String(lineName), whiteColorF, true, false, blackColorI)
M.drawAxisBox(((-scl*2)+vec3(lineData.pos)),x*2,y*2,z*2,color(0,0,255,0.2*255))
local driftBoxTr = transformsUtils[lineName.."driftBox"]
debugDrawer:drawTextAdvanced(vec3(currDriftSpots[selectedDriftSpotId].spatialInfo.bigMapTp.pos), String("Big map TP"), whiteColorF, true, false, blackColorI)
M.drawAxisBox(((-scl*2)+vec3(currDriftSpots[selectedDriftSpotId].spatialInfo.bigMapTp.pos)),x*2,y*2,z*2,color(0,0,255,0.2*255))
local bigMapTpTr = transformsUtils["bigMapTp"]
@/lua/vehicle/controller/bypassDampers.lua
-- for _, damper in ipairs(dampers) do
-- obj.debugDrawProxy:drawNodeText(v.data.beams[damper.beamCid].id1, color(255, 0, 0, 255), damperZones[damper.currentZoneId].zoneStart or "N/A", 0)
-- end
@/lua/ge/extensions/flowgraph/nodes/scene/raceLineParking.lua
vec3(pos - x ),
color(clr[1]*255,clr[2]*255,clr[3]*255,shapeAlpha*255))
debugDrawer:drawTriSolid(
vec3(pos + x + z),
color(clr[1]*255,clr[2]*255,clr[3]*255,shapeAlpha*255))
-- other side
vec3(pos + x ),
color(clr[1]*255,clr[2]*255,clr[3]*255,shapeAlpha*255))
debugDrawer:drawTriSolid(
vec3(pos - x + z),
color(clr[1]*255,clr[2]*255,clr[3]*255,shapeAlpha*255))
vec3(pos - x ),
color(clr[1]*255,clr[2]*255,clr[3]*255,shapeAlpha*255))
debugDrawer:drawTriSolid(
vec3(pos - x - y),
color(clr[1]*255,clr[2]*255,clr[3]*255,shapeAlpha*255))
vec3(pos + x ),
color(clr[1]*255,clr[2]*255,clr[3]*255,shapeAlpha*255))
debugDrawer:drawTriSolid(
vec3(pos + x - y),
color(clr[1]*255,clr[2]*255,clr[3]*255,shapeAlpha*255))
@/lua/ge/extensions/editor/toolUtilities/util.lua
local t = max(0, min(1, (value - minValue) / (maxValue - minValue))) -- Clamp and normalise.
return color(floor(t * 255 + 0.5), 0, floor((1.0 - t) * 255 + 0.5), 255)
end
@/lua/ge/extensions/ui/apps/minimap/minimap.lua
local w = 20
td:circle(width/2 + offsetX,height/2 + offsetY, 100/scale-w, w, 0, 0, color(255,255,255,0),color(255,255,255,250), 0, layers.GAMEPLAY_MARKERS)
if p then p:add("100mRadius") end
local w = 20
td:circle(width/2 + offsetX,height/2 + offsetY, 100/scale-w, w, 0, 0, color(255,255,255,0),color(255,255,255,250), 0, layers.GAMEPLAY_MARKERS)
if p then p:add("100mRadius") end
M.drawOcclusion = function(offsetX, offsetY)
local white, transparent, flag = color(255,255,255,255), color(255,255,255,0),TextureDrawPrimitive_primitiveFlag_blendMultiply
M.drawOcclusion = function(offsetX, offsetY)
local white, transparent, flag = color(255,255,255,255), color(255,255,255,0),TextureDrawPrimitive_primitiveFlag_blendMultiply
--transparent = color(255,0,0,128)
--flag = nil
local left, right, h = transform[5]+5, transform[7]-5, transform[8]-transform[6]
td:line(left, transform[6]+h/2, right, transform[6]+h/2, h/2-5, h/2-5, 5, 5, color(255,0,0,128), color(255,0,0,128), color(255,0,0,255), color(255,0,0,128), 0, layers.DEBUG)
end
local left, right, h = transform[5]+5, transform[7]-5, transform[8]-transform[6]
td:line(left, transform[6]+h/2, right, transform[6]+h/2, h/2-5, h/2-5, 5, 5, color(255,0,0,128), color(255,0,0,128), color(255,0,0,255), color(255,0,0,128), 0, layers.DEBUG)
end
local left, right, h = transform[5]+5, transform[7]-5, transform[8]-transform[6]
td:line(left, transform[6]+h/2, right, transform[6]+h/2, h/2-5, h/2-5, 5, 5, color(255,0,0,128), color(255,0,0,128), color(255,0,0,255), color(255,0,0,128), 0, layers.DEBUG)
end
local left, right, h = transform[5]+5, transform[7]-5, transform[8]-transform[6]
td:line(left, transform[6]+h/2, right, transform[6]+h/2, h/2-5, h/2-5, 5, 5, color(255,0,0,128), color(255,0,0,128), color(255,0,0,255), color(255,0,0,128), 0, layers.DEBUG)
end
if debugSettings.drawOcclusion then
td:circle(width/2 + offsetX,height/2 + offsetY, width/2, 20, color(255,0,0,128), color(255,0,0,128), color(255,0,0,255), color(255,0,0,128), 0, layers.DEBUG)
if debugSettings.drawOcclusion then
td:circle(width/2 + offsetX,height/2 + offsetY, width/2, 20, color(255,0,0,128), color(255,0,0,128), color(255,0,0,255), color(255,0,0,128), 0, layers.DEBUG)
if debugSettings.drawOcclusion then
td:circle(width/2 + offsetX,height/2 + offsetY, width/2, 20, color(255,0,0,128), color(255,0,0,128), color(255,0,0,255), color(255,0,0,128), 0, layers.DEBUG)
if debugSettings.drawOcclusion then
td:circle(width/2 + offsetX,height/2 + offsetY, width/2, 20, color(255,0,0,128), color(255,0,0,128), color(255,0,0,255), color(255,0,0,128), 0, layers.DEBUG)
--td:circle(width/2 + offsetX,height/2 + offsetY, width/2-10*dpi, 11*dpi, color(255,0,0,128), color(255,0,0,128), color(255,0,0,255), color(255,0,0,128), 0, layers.DEBUG)
--td:circle(width/2 + offsetX,height/2 + offsetY, width/2-10*dpi, 11*dpi, color(255,0,0,128), color(255,0,0,128), color(255,0,0,255), color(255,0,0,128), 0, layers.DEBUG)
--td:circle(width/2 + offsetX,height/2 + offsetY, width/2-10*dpi, 11*dpi, color(255,0,0,128), color(255,0,0,128), color(255,0,0,255), color(255,0,0,128), 0, layers.DEBUG)
--td:circle(width/2 + offsetX,height/2 + offsetY, width/2-10*dpi, 11*dpi, color(255,0,0,128), color(255,0,0,128), color(255,0,0,255), color(255,0,0,128), 0, layers.DEBUG)
td:circle(0,0, 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(texWidth ,0, 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(0,0, 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(texWidth ,0, 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(0,0, 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(texWidth ,0, 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(0,texHeight , 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(0,0, 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(texWidth ,0, 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(0,texHeight , 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(texWidth ,0, 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(0,texHeight , 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(texWidth ,texHeight , 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(texWidth ,0, 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(0,texHeight , 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(texWidth ,texHeight , 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(0,texHeight , 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(texWidth ,texHeight , 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(0,texHeight , 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(texWidth ,texHeight , 5,5, 0, 0, color(0,255,0,255), color(0,255,0,255), 0, layers.DEBUG)
td:circle(bufferLeft ,bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(width + bufferLeft ,bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(bufferLeft ,bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(width + bufferLeft ,bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(bufferLeft ,bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(width + bufferLeft ,bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(bufferLeft ,height + bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(bufferLeft ,bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(width + bufferLeft ,bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(bufferLeft ,height + bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(width + bufferLeft ,bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(bufferLeft ,height + bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(width + bufferLeft ,height + bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(width + bufferLeft ,bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(bufferLeft ,height + bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(width + bufferLeft ,height + bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(bufferLeft ,height + bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(width + bufferLeft ,height + bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(bufferLeft ,height + bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(width + bufferLeft ,height + bufferTop, 5,5, 0, 0, color(255,255,255,255), color(255,255,255,255), 0, layers.DEBUG)
td:circle(bufferLeft/2, texHeight/2, bufferLeft/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(texWidth/2,bufferTop/2, bufferTop/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(bufferLeft/2, texHeight/2, bufferLeft/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(texWidth/2,bufferTop/2, bufferTop/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(bufferLeft/2, texHeight/2, bufferLeft/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(texWidth/2,bufferTop/2, bufferTop/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(texWidth-bufferRight/2,texHeight/2, bufferRight/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(bufferLeft/2, texHeight/2, bufferLeft/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(texWidth/2,bufferTop/2, bufferTop/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(texWidth-bufferRight/2,texHeight/2, bufferRight/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(texWidth/2,bufferTop/2, bufferTop/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(texWidth-bufferRight/2,texHeight/2, bufferRight/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(texWidth/2,texHeight-bufferBottom/2, bufferBottom/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(texWidth/2,bufferTop/2, bufferTop/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(texWidth-bufferRight/2,texHeight/2, bufferRight/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(texWidth/2,texHeight-bufferBottom/2, bufferBottom/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(texWidth-bufferRight/2,texHeight/2, bufferRight/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(texWidth/2,texHeight-bufferBottom/2, bufferBottom/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(texWidth-bufferRight/2,texHeight/2, bufferRight/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
td:circle(texWidth/2,texHeight-bufferBottom/2, bufferBottom/2, 1, 0, 0, color(255,0,0,255), color(255,0,0,255), 0, layers.DEBUG)
@/lua/ge/extensions/editor/tech/roadArchitect/utilities.lua
local sphereColor = color(255, 0, 0, 127) -- The colour used for drawing red spheres.
local groupSphereColor = color(255, 0, 255, 127) -- The colour used for drawing group polygon spheres.
local sphereColor = color(255, 0, 0, 127) -- The colour used for drawing red spheres.
local groupSphereColor = color(255, 0, 255, 127) -- The colour used for drawing group polygon spheres.
local highlightColor = color(127, 127, 127, 127) -- The colour used for drawing transparent highlights.
local groupSphereColor = color(255, 0, 255, 127) -- The colour used for drawing group polygon spheres.
local highlightColor = color(127, 127, 127, 127) -- The colour used for drawing transparent highlights.
local highlightColorPurple = color(255, 0, 255, 255)
local highlightColor = color(127, 127, 127, 127) -- The colour used for drawing transparent highlights.
local highlightColorPurple = color(255, 0, 255, 255)
local redColor = color(255, 0, 0, 255) -- The colour used for highlight selected auto junction road end nodes.
local highlightColorPurple = color(255, 0, 255, 255)
local redColor = color(255, 0, 0, 255) -- The colour used for highlight selected auto junction road end nodes.
local textA = color(0, 0, 0, 255) -- The markup text foreground colour.
local textB = color(255, 255, 255, 255) -- The markup text background colour.
local textA = color(0, 0, 0, 255) -- The markup text foreground colour.
local textB = color(255, 255, 255, 255) -- The markup text background colour.
@/lua/vehicle/ai.lua
local debugDrawer = obj.debugDrawProxy
col = col or color(255, 0, 0, 255)
if plan1.rangeLaneCount > 1 and ego.dirVec:dot(vdirVec) > 0.7 and ego2v < square((1.2 * ego.length + 1.2*v.length)) and (xnormV > plan1.rangeLeft and xnormV < plan1.rangeRight) and (not (xnormV > (plan1.rangeLeft + lanew*plan1.rangeBestLane) and xnormV < (plan1.rangeLeft + lanew*(plan1.rangeBestLane+1)))) then
if draw then obj.debugDrawProxy:drawSphere(2, vPfront, color(0,0,0,160)) end
if ego2PlVec:dot(ego.rightVec) > 0 then
if vdirVec:dot(dirVec) < 0.95 then
if draw then obj.debugDrawProxy:drawSphere(2, vPfront, color(255, 0, 0, 160)) end
return true
if traffic.intersection and intersectionFound then
if draw then obj.debugDrawProxy:drawSphere(2, vPfront, color(255, 100, 0, 160)) end
return true
v.noproj = true
if draw then obj.debugDrawProxy:drawSphere(2, vPfront, color(0, 255, 0, 160)) end
return true
if xnormP > rangeLeft and xnormP < rangeRight then
if draw then obj.debugDrawProxy:drawSphere(2, vPfront, color(255, 255, 255, 160)) end
return true
if vPfront:squaredDistance(n1.posOrig) < 100 * 100 then
if draw then obj.debugDrawProxy:drawSphere(2, vPfront, color(0, 0, 255, 160)) end
return true
end
--obj.debugDrawProxy:drawSphere(2, mapData.positions[route.path[final]], color(0,255,0,50))
indexes.final = final
v.posMiddle = (v.posFront + v.posRear) * 0.5
--obj.debugDrawProxy:drawSphere(traffic.Rfs, ego.pos, color(0,0,0,50))
--obj.debugDrawProxy:drawSphere(traffic.Rfl, ego.pos, color(255,0,0,50))
--obj.debugDrawProxy:drawSphere(traffic.Rfs, ego.pos, color(0,0,0,50))
--obj.debugDrawProxy:drawSphere(traffic.Rfl, ego.pos, color(255,0,0,50))
end
--obj.debugDrawProxy:drawSphere(0.2, ego.pos + 0.5 * ego.dirVec * ego.length, color(255, 128, 0, 160))
--obj.debugDrawProxy:drawSphere(0.2, midPos, color(255, 128, 0, 160))
--obj.debugDrawProxy:drawSphere(0.2, ego.pos + 0.5 * ego.dirVec * ego.length, color(255, 128, 0, 160))
--obj.debugDrawProxy:drawSphere(0.2, midPos, color(255, 128, 0, 160))
elseif dist < 0.5 * (ego.width + v.width + 0.2) and TTC > -0.1 then
end
--obj.debugDrawProxy:drawSphere(0.2, ego.pos + 0.5 * ego.dirVec * ego.length, color(0, 0, 0, 160))
--obj.debugDrawProxy:drawSphere(0.2, midPos, color(0, 0, 0, 160))
--obj.debugDrawProxy:drawSphere(0.2, ego.pos + 0.5 * ego.dirVec * ego.length, color(0, 0, 0, 160))
--obj.debugDrawProxy:drawSphere(0.2, midPos, color(0, 0, 0, 160))
end
--if fl then
--local cornerColor = color(255, 128, 0, 160)
--obj.debugDrawProxy:drawSphere(0.2, fl, cornerColor)
--obj.debugDrawProxy:drawSphere(0.2, rr, cornerColor)
--local sideColor = color(clamp(sqrt(dispLeft) * 255, 0, 255), 0, clamp(sqrt(dispRight) * 255, 0, 255), 160)
--obj.debugDrawProxy:drawSphere(0.4, midPos + vec3(0,0,2), sideColor)
if minSqDist < square((ego.width + limWidth) * 0.51) then
-- obj.debugDrawProxy:drawSphere(0.25, v.posFront, color(0,0,255,255))
-- obj.debugDrawProxy:drawSphere(0.25, plPosFront, color(0,0,255,255))
-- obj.debugDrawProxy:drawSphere(0.25, v.posFront, color(0,0,255,255))
-- obj.debugDrawProxy:drawSphere(0.25, plPosFront, color(0,0,255,255))
if not vehicleIsStopped then
--print('lane change is going to happen')
--obj.debugDrawProxy:drawSphere(2, ego.pos, color(255,0,255,255))
if side < 0 then
end
--local sColor = tSi.action == 0 and color(0,255,0,160) or color(255,255,0,160)
--obj.debugDrawProxy:drawSphere(1, tSi.pos, sColor)
end
--local sColor = tSi.action == 0 and color(0,255,0,160) or color(255,255,0,160)
--obj.debugDrawProxy:drawSphere(1, tSi.pos, sColor)
--obj.debugDrawProxy:drawSphere(1, tSi.pos, sColor)
--obj.debugDrawProxy:drawText(tSi.pos + vec3(0, 0, 1), color(0,0,0,255), tostring(tSi.turn))
-- targetPos = catmullRomChordal(ego.pos-ego.dirVec, ego.pos, plC-plX, plC-plX+plX:normalized(), min(1, max(ego.speed * parameters.lookAheadKv, 4.5) / ego.pos:distance(plC - plX)))
-- obj.debugDrawProxy:drawSphere(0.25, targetPos, color(255, 0, 0, 255))
-- obj.debugDrawProxy:drawSphere(0.25, plC-plX, color(0, 0, 255, 255))
-- obj.debugDrawProxy:drawSphere(0.25, targetPos, color(255, 0, 0, 255))
-- obj.debugDrawProxy:drawSphere(0.25, plC-plX, color(0, 0, 255, 255))
-- obj.debugDrawProxy:drawSphere(0.15, ego.pos + brakeTargetSpeed * ego.upVec, color(255, 0, 0, 255))
-- obj.debugDrawProxy:drawSphere(0.25, plC-plX, color(0, 0, 255, 255))
-- obj.debugDrawProxy:drawSphere(0.15, ego.pos + brakeTargetSpeed * ego.upVec, color(255, 0, 0, 255))
-- obj.debugDrawProxy:drawSphere(0.15, ego.pos + throttleTargetSpeed * ego.upVec, color(0, 255, 0, 255))
-- obj.debugDrawProxy:drawSphere(0.15, ego.pos + brakeTargetSpeed * ego.upVec, color(255, 0, 0, 255))
-- obj.debugDrawProxy:drawSphere(0.15, ego.pos + throttleTargetSpeed * ego.upVec, color(0, 255, 0, 255))
-- obj.debugDrawProxy:drawSphere(0.15, ego.pos + ego.speed * ego.upVec, color(0, 0, 255, 255))
-- obj.debugDrawProxy:drawSphere(0.15, ego.pos + throttleTargetSpeed * ego.upVec, color(0, 255, 0, 255))
-- obj.debugDrawProxy:drawSphere(0.15, ego.pos + ego.speed * ego.upVec, color(0, 0, 255, 255))
end
if targetPos then
debugDrawer:drawSphere(0.25, targetPos, color(255,0,0,255))
local shadowPos = currentRoute.plan[egoSeg].pos + plan.egoXnormOnSeg * (plan[egoSeg+1].pos - plan[egoSeg].pos)
local blue = color(0,0,255,255)
debugDrawer:drawSphere(0.25, shadowPos, blue)
if player then
debugDrawer:drawSphere(0.3, player.pos, color(0,255,0,255))
end
local p = mapData.positions[currentRoute.path[#currentRoute.path]]
debugDrawer:drawSphere(4, p, color(255,0,0,100))
debugDrawer:drawText(p + vec3(0, 0, 4), color(0,0,0,255), 'Destination')
debugDrawer:drawSphere(4, p, color(255,0,0,100))
debugDrawer:drawText(p + vec3(0, 0, 4), color(0,0,0,255), 'Destination')
end
local tmpVec = vec3(0.7, ego.width, 0.7)
local black = color(0, 0, 0, 128)
for i = 1, count-1 do
tmpVec:setAdd(vec3(0, ego.width, 0))
local transparentRed = color(255, 0, 0, 120)
for i = currentRoute.plan[1].pathidx, #path - 1 do
local source = visDebug.candidatePaths[1][1] -- all paths have the same source node
debugDrawer:drawSphere(2, mapData.positions[source], color(0, 0, 0, 255))
for i = 1, #visDebug.candidatePaths do
if thisPathLastNode == winner then
debugDrawer:drawCylinder(mapData.positions[thisPathLastNode], mapData.positions[thisPathLastNode] + vec3(0, 0, 8), 2, color(0, 0, 0, 255))
end
local txt = thisPathLastNode.." -> "..strFormat("%0.4f", thisScore)
debugDrawer:drawText(mapData.positions[thisPathLastNode] + vec3(0, 0, 2), color(0, 0, 0, 255), txt)
end
local p = mapData.positions[currentRoute.path[#currentRoute.path]]
debugDrawer:drawSphere(4, p, color(255, 0, 0, 100))
debugDrawer:drawText(p + vec3(0, 0, 4), color(0, 0, 0, 255), 'Destination')
debugDrawer:drawSphere(4, p, color(255, 0, 0, 100))
debugDrawer:drawText(p + vec3(0, 0, 4), color(0, 0, 0, 255), 'Destination')
end
if altPlan and plan.buildN then
debugDrawer:drawSphere(0.1, altPlan.targetPos + vec3(0,0,0.5), color(0,255,255,255))
for j = 1, altPlan.planCount do
local speed = point.speed or 0
debugDrawer:drawSphere(0.1, point.pos + vec3(0,0,0.5), color(255,255,255,255))
debugDrawer:drawSphere(0.1, point.pos + vec3(0,0,speed*0.2), color(255,255,255,255))
debugDrawer:drawSphere(0.1, point.pos + vec3(0,0,0.5), color(255,255,255,255))
debugDrawer:drawSphere(0.1, point.pos + vec3(0,0,speed*0.2), color(255,255,255,255))
debugDrawer:drawText(point.pos + vec3(0,0,speed*0.2), color(0, 0, 0, 255), strFormat("%2.0f", speed*3.6).." kph")
debugDrawer:drawSphere(0.1, point.pos + vec3(0,0,speed*0.2), color(255,255,255,255))
debugDrawer:drawText(point.pos + vec3(0,0,speed*0.2), color(0, 0, 0, 255), strFormat("%2.0f", speed*3.6).." kph")
if j > 1 then
local prevSpeed = altPlan[j-1].speed or 0
debugDrawer:drawCylinder(altPlan[j-1].pos + vec3(0,0,0.5), point.pos + vec3(0,0,0.5), 0.05, color(255, 255, 255, 100))
debugDrawer:drawCylinder(altPlan[j-1].pos + vec3(0,0,prevSpeed*0.2), point.pos + vec3(0,0,speed*0.2), 0.05, color(255*clamp(k-2, 0, 1), 255*clamp(k-1,0,1), 255, 100))
debugDrawer:drawCylinder(altPlan[j-1].pos + vec3(0,0,0.5), point.pos + vec3(0,0,0.5), 0.05, color(255, 255, 255, 100))
debugDrawer:drawCylinder(altPlan[j-1].pos + vec3(0,0,prevSpeed*0.2), point.pos + vec3(0,0,speed*0.2), 0.05, color(255*clamp(k-2, 0, 1), 255*clamp(k-1,0,1), 255, 100))
end
local n = visDebug.trajecRec[1 + (last + i) % count]
debugDrawer:drawSquarePrism(visDebug.trajecRec[1 + (last + i - 1) % count][1], n[1], tmpVec1, tmpVec1, color(255 * sqrt(abs(n[4])), 255 * sqrt(n[5]), 0, 100))
end
local zOffSet = vec3(0, 0, 0.4)
local yellow, blue = color(255,255,0,200), color(0,0,255,200)
local tmpVec2 = vec3()
local zOffSet = vec3(0, 0, 0.4)
local yellow, blue = color(255,255,0,200), color(0,0,255,200)
local tmpVec2 = vec3()
if plan[1] then
local red = color(255,0,0,200) -- getContrastColor(objectId)
local black = color(0, 0, 0, 255)
local red = color(255,0,0,200) -- getContrastColor(objectId)
local black = color(0, 0, 0, 255)
local green = color(0, 255, 0, 200)
local black = color(0, 0, 0, 255)
local green = color(0, 255, 0, 200)
local prevSpeed = -1
local plPosOnPlan = linePointFromXnorm(n.pos, plan[i+1].pos, data[2])
debugDrawer:drawSphere(0.25, plPosOnPlan, color(0,255,0,100))
end
local roadHalfWidth = n.halfWidth
--debugDrawer:drawCylinder(n.posOrig, p1Orig, roadHalfWidth, color(255, 0, 0, 40))
if n.laneLimLeft and n.laneLimRight then -- You need to uncomment the appropriate code in planAhead force integrator loop for this to work
if n.laneLimLeft and n.laneLimRight then -- You need to uncomment the appropriate code in planAhead force integrator loop for this to work
debugDrawer:drawSquarePrism(n.pos - (n.lateralXnorm - n.laneLimLeft) * n.normal, n.pos + (n.laneLimRight - n.lateralXnorm) * n.normal, tmpVec, tmpVec, color(0,0,255,120))
end
local rangeRight = linearScale(n.rangeRight, 0, 1, -roadHalfWidth, roadHalfWidth)
debugDrawer:drawSquarePrism(n.posOrig + rangeLeft * n.normal, n.posOrig + rangeRight * n.normal, tmpVec1, tmpVec1, color(255,0,0,120))
end
if newPositionsDebug[1] then
local green = color(0,255,0,200)
local prevPoint = newPositionsDebug[1]
-- if internalState.road == 'tail' then
-- col1 = color(0,0,0,200)
-- col2 = color(0,0,0,200)
-- col1 = color(0,0,0,200)
-- col2 = color(0,0,0,200)
-- else
-- else
-- col1 = color(255,0,0,100)
-- col2 = color(0,0,255,100)
-- col1 = color(255,0,0,100)
-- col2 = color(0,0,255,100)
-- end
-- local scaledV = abs(1000 * v)
-- debugDrawer:drawCylinder(p, p + vec3(0, 0, scaledV), 0.06, color(abs(min(sign(v),0))*255,max(sign(v),0)*255,0,200))
-- debugDrawer:drawText(p + vec3(0, 0, scaledV), color(0,0,0,255), strFormat("%5.4e", v))
-- debugDrawer:drawCylinder(p, p + vec3(0, 0, scaledV), 0.06, color(abs(min(sign(v),0))*255,max(sign(v),0)*255,0,200))
-- debugDrawer:drawText(p + vec3(0, 0, scaledV), color(0,0,0,255), strFormat("%5.4e", v))
-- debugDrawer:drawCylinder(prevPoint, p + vec3(0, 0, scaledV), 0.06, col)
debugDrawer:drawCylinder(prevPoint, p1, 0.05, col)
debugDrawer:drawText(p1, color(0,0,0,255), strFormat("%2.0f", v*3.6) .. " kph")
prevPoint = p1
local n = visDebug.trajecRec[1+(last+i)%count]
debugDrawer:drawSquarePrism(visDebug.trajecRec[1+(last+i-1)%count][1], n[1], tmpVec, tmpVec, color(255 * sqrt(abs(n[3])), 255 * sqrt(n[2]), 0, 100))
end
local rayHitPos = tmpVec + shiftVec
debugDrawer:drawCylinder(tmpVec, rayHitPos, 0.02, color(255,255,255,255))
-- debugDrawer:drawSphere(0.3, ego.pos, color(255,255,0,255))
-- dump(obj)
-- dump(test)
-- debugDrawer:drawSphere(0.1, frontPos, color(255,255,0,255))
-- debugDrawer:drawSphere(0.3, test2, color(255,0,0,255))
-- debugDrawer:drawSphere(0.1, frontPos, color(255,255,0,255))
-- debugDrawer:drawSphere(0.3, test2, color(255,0,0,255))
-- debugDrawer:drawSphere(0.3, test3, color(255,0,0,255))
-- debugDrawer:drawSphere(0.3, test2, color(255,0,0,255))
-- debugDrawer:drawSphere(0.3, test3, color(255,0,0,255))
-- debugDrawer:drawSphere(0.3, test4, color(255,0,0,255))
-- debugDrawer:drawSphere(0.3, test3, color(255,0,0,255))
-- debugDrawer:drawSphere(0.3, test4, color(255,0,0,255))
-- debugDrawer:drawSphere(0.3, test, color(255,0,0,255))
-- debugDrawer:drawSphere(0.3, test4, color(255,0,0,255))
-- debugDrawer:drawSphere(0.3, test, color(255,0,0,255))
-- local test2 = obj:getFrontPositionRelative()
-- dump(test2)
-- debugDrawer:drawSphere(0.3, ego.wheelBase[2], color(255,255,0,255))
-- ray origins
-- ray origins
-- debugDrawer:drawSphere(0.1, ego.pos, color(0,0,0,255))
debugDrawer:drawSphere(0.1, twt.posTable[1], color(255,255,255,255))
-- debugDrawer:drawSphere(0.1, ego.pos, color(0,0,0,255))
debugDrawer:drawSphere(0.1, twt.posTable[1], color(255,255,255,255))
debugDrawer:drawSphere(0.1, twt.posTable[2], color(255,255,255,255))
debugDrawer:drawSphere(0.1, twt.posTable[1], color(255,255,255,255))
debugDrawer:drawSphere(0.1, twt.posTable[2], color(255,255,255,255))
debugDrawer:drawSphere(0.1, twt.posTable[3], color(255,255,255,255))
debugDrawer:drawSphere(0.1, twt.posTable[2], color(255,255,255,255))
debugDrawer:drawSphere(0.1, twt.posTable[3], color(255,255,255,255))
debugDrawer:drawSphere(0.1, twt.posTable[4], color(255,255,255,255))
debugDrawer:drawSphere(0.1, twt.posTable[3], color(255,255,255,255))
debugDrawer:drawSphere(0.1, twt.posTable[4], color(255,255,255,255))
local c, x, y, z = getObjectBoundingBox(objectId) -- center, front vec, left vec, up vec
local col = color(255, 0, 0, 255)
drawOBB(c, x, y, z, col)
--dump(v.pos)
obj.debugDrawProxy:drawSphere(0.2, v.pos, color(0, 0, 255, 255))
local vPos = vec3(obj:getObjectFrontPosition(k))
local vPos = vec3(obj:getObjectFrontPosition(k))
obj.debugDrawProxy:drawSphere(0.2, vPos, color(0, 0, 255, 255))
obj.debugDrawProxy:drawSphere(0.2, vPos + v.vel * dt, color(0, 255, 0, 255))
obj.debugDrawProxy:drawSphere(0.2, vPos, color(0, 0, 255, 255))
obj.debugDrawProxy:drawSphere(0.2, vPos + v.vel * dt, color(0, 255, 0, 255))
--dump(obj:getObjectDirectionVector(k))
end
obj.debugDrawProxy:drawSphere(0.15, obj:getFrontPosition(), color(255, 0, 0, 255))
end
local refNodePos = obj:getPosition()
debugDrawer:drawSphere(0.1, refNodePos, color(255,0,0,255))
for _, wheel in pairs(wheels.wheels) do
local wheelPosAbsolute = refNodePos + obj:getNodePosition(wheel.node1)
debugDrawer:drawSphere(0.1, wheelPosAbsolute, color(255,0,0,255))
local contactPointPos = wheelPosAbsolute - obj:getDirectionVectorUp() * wheelRadius
local contactPointPos = wheelPosAbsolute - obj:getDirectionVectorUp() * wheelRadius
debugDrawer:drawSphere(0.1, contactPointPos, color(255,0,0,255))
end
local vehFrontPos = obj:getFrontPosition()
debugDrawer:drawSphere(0.1, obj:getFrontPosition(), color(255, 255, 255, 255))
-- vehicle frontPos
-- vehicle frontPos
debugDrawer:drawSphere(0.1, vehFrontPos:z0(), color(0, 255, 255, 255))
-- calculated spawn pos (from script front pos)
debugDrawer:drawSphere(0.1, vec3(736.8858419,102.6078886,0.1169999319), color(0, 0, 255, 255))
-- script first pos (ground truth)
debugDrawer:drawSphere(0.1, vec3(734.9434413112983, 102.21897064457461, 1.0), color(255, 0, 255, 255))
-- Draw world reference Frame
debugDrawer:drawSphere(0.1, vec3(0, 0, 0), color(0, 255, 0, 255)) -- World 0
debugDrawer:drawCylinder(vec3(0, 0, 0), 5 * vec3(1, 0, 0), 0.05, color(0, 255, 0, 255)) -- x (green)
debugDrawer:drawSphere(0.1, vec3(0, 0, 0), color(0, 255, 0, 255)) -- World 0
debugDrawer:drawCylinder(vec3(0, 0, 0), 5 * vec3(1, 0, 0), 0.05, color(0, 255, 0, 255)) -- x (green)
debugDrawer:drawCylinder(vec3(0, 0, 0), 5 * vec3(0, 1, 0), 0.05, color(255, 0, 0, 255)) -- y (red)
debugDrawer:drawCylinder(vec3(0, 0, 0), 5 * vec3(1, 0, 0), 0.05, color(0, 255, 0, 255)) -- x (green)
debugDrawer:drawCylinder(vec3(0, 0, 0), 5 * vec3(0, 1, 0), 0.05, color(255, 0, 0, 255)) -- y (red)
debugDrawer:drawCylinder(vec3(0, 0, 0), 5 * vec3(0, 0, 1), 0.05, color(0, 0, 255, 255)) -- z (blue)
debugDrawer:drawCylinder(vec3(0, 0, 0), 5 * vec3(0, 1, 0), 0.05, color(255, 0, 0, 255)) -- y (red)
debugDrawer:drawCylinder(vec3(0, 0, 0), 5 * vec3(0, 0, 1), 0.05, color(0, 0, 255, 255)) -- z (blue)
end
@/lua/vehicle/extensions/tech/wheelForces.lua
local p2RefZ = p1 + upVector
obj.debugDrawProxy:drawCylinder(p1, p2RefX, 0.01, color(255, 0, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2RefY, 0.01, color(0, 0, 255, 255))
obj.debugDrawProxy:drawCylinder(p1, p2RefX, 0.01, color(255, 0, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2RefY, 0.01, color(0, 0, 255, 255))
obj.debugDrawProxy:drawCylinder(p1, p2RefZ, 0.01, color(0, 255, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2RefY, 0.01, color(0, 0, 255, 255))
obj.debugDrawProxy:drawCylinder(p1, p2RefZ, 0.01, color(0, 255, 0, 255))
end
local p2z = p1 + vectorSum:dot(upVector) * upVector
obj.debugDrawProxy:drawCylinder(p1, p2x, 0.05, color(0, 255, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2y, 0.05, color(255, 0, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2x, 0.05, color(0, 255, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2y, 0.05, color(255, 0, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2z, 0.05, color(0, 0, 255, 255))
obj.debugDrawProxy:drawCylinder(p1, p2y, 0.05, color(255, 0, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2z, 0.05, color(0, 0, 255, 255))
p2 = vehiclePos + obj:getNodePosition(v.data.beams[beam].id2)
obj.debugDrawProxy:drawCylinder(p1, p2, 0.01, color(255, 255, 0, 128))
end
p2 = vehiclePos + obj:getNodePosition(v.data.beams[beam].id2)
obj.debugDrawProxy:drawCylinder(p1, p2, 0.01, color(255, 255, 0, 128))
end
obj.debugDrawProxy:drawCylinder(p1, p2x, 0.05, color(0, 255, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2y, 0.05, color(255, 0, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2x, 0.05, color(0, 255, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2y, 0.05, color(255, 0, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2z, 0.05, color(0, 0, 255, 255))
obj.debugDrawProxy:drawCylinder(p1, p2y, 0.05, color(255, 0, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2z, 0.05, color(0, 0, 255, 255))
p2 = vehiclePos + obj:getNodePosition(v.data.beams[beamData.beamId].id2)
obj.debugDrawProxy:drawCylinder(p1, p2, 0.01, color(128, 255, 128, 128))
end
p2 = vehiclePos + obj:getNodePosition(v.data.beams[beamData.beamId].id2)
obj.debugDrawProxy:drawCylinder(p1, p2, 0.01, color(128, 255, 128, 128))
end
obj.debugDrawProxy:drawCylinder(p1, p2x, 0.05, color(0, 255, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2y, 0.05, color(255, 0, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2x, 0.05, color(0, 255, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2y, 0.05, color(255, 0, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2z, 0.05, color(0, 0, 255, 255))
obj.debugDrawProxy:drawCylinder(p1, p2y, 0.05, color(255, 0, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2z, 0.05, color(0, 0, 255, 255))
p2 = vehiclePos + obj:getNodePosition(v.data.beams[beamId].id2)
obj.debugDrawProxy:drawCylinder(p1, p2, 0.01, color(128, 255, 128, 128))
end
p2 = vehiclePos + obj:getNodePosition(v.data.beams[beamId].id2)
obj.debugDrawProxy:drawCylinder(p1, p2, 0.01, color(255, 255, 0, 128))
end
obj.debugDrawProxy:drawCylinder(p1, p2x, 0.05, color(0, 0, 255, 255))
obj.debugDrawProxy:drawCylinder(p1, p2y, 0.05, color(0, 255, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2x, 0.05, color(0, 0, 255, 255))
obj.debugDrawProxy:drawCylinder(p1, p2y, 0.05, color(0, 255, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2z, 0.05, color(255, 0, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2y, 0.05, color(0, 255, 0, 255))
obj.debugDrawProxy:drawCylinder(p1, p2z, 0.05, color(255, 0, 0, 255))
p1 = vehiclePos + obj:getNodePosition(treadNodeId)
obj.debugDrawProxy:drawSphere(0.02, p1, color(255, 0, 0, 255))
end
@/lua/ge/extensions/flowgraph/nodes/gameplay/decalLine.lua
{ dir = 'in', type = 'color', name = 'filledColor', hidden = true, hardcoded = true, default = deepcopy(defaultFGColor), description = 'Primary color.' },
{ dir = 'in', type = 'color', name = 'fillingColor1', hidden = true, hardcoded = true, default = deepcopy(defaultFGColor1), description = 'First filling color (progress).' },
{ dir = 'in', type = 'color', name = 'fillingColor2', hidden = true, hardcoded = true, default = deepcopy(defaultFGColor2), description = 'Second filling color (cooldown).' },
{ dir = 'in', type = 'color', name = 'fillingColor1', hidden = true, hardcoded = true, default = deepcopy(defaultFGColor1), description = 'First filling color (progress).' },
{ dir = 'in', type = 'color', name = 'fillingColor2', hidden = true, hardcoded = true, default = deepcopy(defaultFGColor2), description = 'Second filling color (cooldown).' },
{ dir = 'in', type = 'color', name = 'backgroundColor', hidden = true, hardcoded = true, default = deepcopy(defaultBGColor), description = 'Secondary color (opposite of filling).' }
{ dir = 'in', type = 'color', name = 'fillingColor2', hidden = true, hardcoded = true, default = deepcopy(defaultFGColor2), description = 'Second filling color (cooldown).' },
{ dir = 'in', type = 'color', name = 'backgroundColor', hidden = true, hardcoded = true, default = deepcopy(defaultBGColor), description = 'Secondary color (opposite of filling).' }
}
@/lua/ge/extensions/c2/panelPlugins/tileManager.lua
-- Direct packed integer color (0-255)
-- Active: Green (0, 255, 0, ~51), Inactive: Red (255, 0, 0, ~25)
-- Active: Green (0, 255, 0, ~51), Inactive: Red (255, 0, 0, ~25)
local colorInt = isActive and color(0, 255, 0, 51) or color(255, 0, 0, 25)
-- Active: Green (0, 255, 0, ~51), Inactive: Red (255, 0, 0, ~25)
local colorInt = isActive and color(0, 255, 0, 51) or color(255, 0, 0, 25)
@/lua/ge/extensions/gameplay/sites/parkingSpot.lua
if self.isMultiSpot and i == 0 then
clrI = color(0.91 * 255, 0.49 * 255, 0.24 * 255, shapeAlpha * 255)
else
else
clrI = color(clr[1] * 255, clr[2] * 255, clr[3] * 255, shapeAlpha * 255)
end
if self.isMultiSpot and i == 0 then
clrI = color(0.91 * 255, 0.49 * 255, 0.24 * 255, shapeAlpha * 128)
else
else
clrI = color(clr[1] * 255, clr[2] * 255, clr[3] * 255, shapeAlpha * 128)
end
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veLightsDebug.lua
local lightCol = ColorF(prop.lightColor.r / 255, prop.lightColor.g / 255, prop.lightColor.b / 255, 1)
local lightCol255 = color(prop.lightColor.r, prop.lightColor.g, prop.lightColor.b, 255)
@/lua/vehicle/scriptai.lua
if M.updateGFX == updateGFXfollow then
debugDrawer:drawSphere(0.2, vec3(targetPos), color(0, 0, 255, 255))
end
for _, s in ipairs(script) do
debugDrawer:drawSphere(0.2, vec3(s), color(255, 0, 0, 255))
end
@/lua/vehicle/controller/tech/roadsSensor.lua
disc[ctr] = catmullRomCentripetal(p0, p1, p2, p3, q, splineSmoothness)
--obj.debugDrawProxy:drawSphere(0.1, disc[ctr] + vec3(0, 0, 0.25), color(255, 255, 255, 255))
wds[ctr] = catmullRom(w0, w1, w2, w3, q, splineSmoothness)
--
obj.debugDrawProxy:drawSphere(0.1, pLeft + vec3(0, 0, 0.25), color(255, 0, 0, 255))
obj.debugDrawProxy:drawSphere(0.1, pInt + vec3(0, 0, 0.25), color(0, 255, 0, 255))
obj.debugDrawProxy:drawSphere(0.1, pLeft + vec3(0, 0, 0.25), color(255, 0, 0, 255))
obj.debugDrawProxy:drawSphere(0.1, pInt + vec3(0, 0, 0.25), color(0, 255, 0, 255))
obj.debugDrawProxy:drawSphere(0.1, pRight + vec3(0, 0, 0.25), color(0, 0, 255, 255))
obj.debugDrawProxy:drawSphere(0.1, pInt + vec3(0, 0, 0.25), color(0, 255, 0, 255))
obj.debugDrawProxy:drawSphere(0.1, pRight + vec3(0, 0, 0.25), color(0, 0, 255, 255))
obj.debugDrawProxy:drawSphere(0.2, p0 + vec3(0, 0, 0.25), color(255, 255, 255,255))
obj.debugDrawProxy:drawSphere(0.2, p1 + vec3(0, 0, 0.25), color(255, 155, 155,255))
obj.debugDrawProxy:drawSphere(0.2, p0 + vec3(0, 0, 0.25), color(255, 255, 255,255))
obj.debugDrawProxy:drawSphere(0.2, p1 + vec3(0, 0, 0.25), color(255, 155, 155,255))
obj.debugDrawProxy:drawSphere(0.2, p2 + vec3(0, 0, 0.25), color(155, 155, 255,255))
obj.debugDrawProxy:drawSphere(0.2, p1 + vec3(0, 0, 0.25), color(255, 155, 155,255))
obj.debugDrawProxy:drawSphere(0.2, p2 + vec3(0, 0, 0.25), color(155, 155, 255,255))
obj.debugDrawProxy:drawSphere(0.2, p3 + vec3(0, 0, 0.25), color(255, 255, 255,255))
obj.debugDrawProxy:drawSphere(0.2, p2 + vec3(0, 0, 0.25), color(155, 155, 255,255))
obj.debugDrawProxy:drawSphere(0.2, p3 + vec3(0, 0, 0.25), color(255, 255, 255,255))
--
@/lua/ge/extensions/gameplay/drag/debug.lua
local scl = (x+y+z)/2
editor_dragRaceEditor.drawAxisBox(((-scl*2)+vec3(laneData.transform.position)),x*2,y*2,z*2,color(255,255,255,0.2*255))
local pos = vec3(laneData.transform.position)
@/lua/vehicle/bdebugImpl.lua
local beamTypesColors = {
[NORMALTYPE] = color(0, 223, 0, 255),
[BEAM_HYDRO] = color(0, 100, 255, 255),
[NORMALTYPE] = color(0, 223, 0, 255),
[BEAM_HYDRO] = color(0, 100, 255, 255),
[BEAM_ANISOTROPIC] = color(255, 135, 63, 255),
[BEAM_HYDRO] = color(0, 100, 255, 255),
[BEAM_ANISOTROPIC] = color(255, 135, 63, 255),
[BEAM_BOUNDED] = color(255, 255, 0, 255),
[BEAM_ANISOTROPIC] = color(255, 135, 63, 255),
[BEAM_BOUNDED] = color(255, 255, 0, 255),
[BEAM_LBEAM] = color(92, 92, 92, 255),
[BEAM_BOUNDED] = color(255, 255, 0, 255),
[BEAM_LBEAM] = color(92, 92, 92, 255),
[BEAM_SUPPORT] = color(223, 0, 223, 255),
[BEAM_LBEAM] = color(92, 92, 92, 255),
[BEAM_SUPPORT] = color(223, 0, 223, 255),
[BEAM_PRESSURED] = color(0, 255, 255, 255),
[BEAM_SUPPORT] = color(223, 0, 223, 255),
[BEAM_PRESSURED] = color(0, 255, 255, 255),
[BEAM_BROKEN] = color(255, 0, 0, 255),
[BEAM_PRESSURED] = color(0, 255, 255, 255),
[BEAM_BROKEN] = color(255, 0, 0, 255),
}
local triTypesColors = {
color(0, 255, 0, 255),
color(255, 0, 255, 255),
color(0, 255, 0, 255),
color(255, 0, 255, 255),
color(0, 255, 255, 255),
color(255, 0, 255, 255),
color(0, 255, 255, 255),
color(255, 255, 0, 255),
color(0, 255, 255, 255),
color(255, 255, 0, 255),
color(255, 0, 0, 255),
color(255, 255, 0, 255),
color(255, 0, 0, 255),
}
local torbarTypesColors = {
{color(0,255,0,255), color(0,255,255,255)},
{color(255,0,255,255), color(0,0,255,255)},
local torbarTypesColors = {
{color(0,255,0,255), color(0,255,255,255)},
{color(255,0,255,255), color(0,0,255,255)},
{color(0,255,0,255), color(0,255,255,255)},
{color(255,0,255,255), color(0,0,255,255)},
{color(255,0,0,255), color(255,128,0,255)},
{color(0,255,0,255), color(0,255,255,255)},
{color(255,0,255,255), color(0,0,255,255)},
{color(255,0,0,255), color(255,128,0,255)},
{color(255,0,255,255), color(0,0,255,255)},
{color(255,0,0,255), color(255,128,0,255)},
}
{color(255,0,255,255), color(0,0,255,255)},
{color(255,0,0,255), color(255,128,0,255)},
}
for _, c in pairs(wheelContacts) do
obj.debugDrawProxy:drawSphere(0.02, (c.contactPoint / c.totalForce), color(255, 0, 0, 255))
end
obj:queueGameEngineLua(string.format('debugDrawer:drawLine(%s,%s,ColorF(1,0,0,1),false)', -dir * lineLen * 0.5 + midPos, dir * lineLen * 0.5 + midPos))
obj.debugDrawProxy:drawCylinder(-dir * lineLen * 0.5 + midPos, dir * lineLen * 0.5 + midPos, 0.01, color(255, 0, 0, 255))
end
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 60, 0), color(255, 165, 0, 255), "Mode: " .. modeName)
end
if modeID == 2 then
local outlineColor = color(0, 0, 0, alpha)
local r,g,b,a = colorGetRGBA(frontCol)
frontCol = color(r, g, b, alpha)
local r,g,b,a = colorGetRGBA(backCol)
backCol = color(r, g, b, alpha)
elseif modeID == 3 then
local outlineColor = color(0, 0, 0, alpha)
local r,g,b,a = colorGetRGBA(frontCol)
frontCol = color(r, g, b, alpha)
local r,g,b,a = colorGetRGBA(backCol)
backCol = color(r, g, b, alpha)
elseif modeID == 4 or modeID == 5 or modeID == 6 then
local outlineColor = color(0, 0, 0, alpha)
local r,g,b,a = colorGetRGBA(frontCol)
frontCol = color(r, g, b, alpha)
local r,g,b,a = colorGetRGBA(backCol)
backCol = color(r, g, b, alpha)
elseif modeID == 7 then
local outlineColor = color(0, 0, 0, alpha)
local r,g,b,a = colorGetRGBA(frontCol)
frontCol = color(r, g, b, alpha)
local r,g,b,a = colorGetRGBA(backCol)
backCol = color(r, g, b, alpha)
if modeID == 2 then
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(255, 0, 0, 255), color(55, 55, 255, 255), color(255, 255, 0, 255), color(0, 0, 0, 0), color(0, 0, 0, 0), M.state.vehicle.aerodynamicsScale)
if modeID == 2 then
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(255, 0, 0, 255), color(55, 55, 255, 255), color(255, 255, 0, 255), color(0, 0, 0, 0), color(0, 0, 0, 0), M.state.vehicle.aerodynamicsScale)
if modeID == 2 then
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(255, 0, 0, 255), color(55, 55, 255, 255), color(255, 255, 0, 255), color(0, 0, 0, 0), color(0, 0, 0, 0), M.state.vehicle.aerodynamicsScale)
if modeID == 2 then
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(255, 0, 0, 255), color(55, 55, 255, 255), color(255, 255, 0, 255), color(0, 0, 0, 0), color(0, 0, 0, 0), M.state.vehicle.aerodynamicsScale)
if modeID == 2 then
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(255, 0, 0, 255), color(55, 55, 255, 255), color(255, 255, 0, 255), color(0, 0, 0, 0), color(0, 0, 0, 0), M.state.vehicle.aerodynamicsScale)
elseif modeID == 3 then
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(255, 0, 0, 0), color(55, 55, 255, 0), color(255, 255, 0, 0), color(0, 0, 0, 255), color(0, 0, 0, 0), M.state.vehicle.aerodynamicsScale)
elseif modeID == 3 then
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(255, 0, 0, 0), color(55, 55, 255, 0), color(255, 255, 0, 0), color(0, 0, 0, 255), color(0, 0, 0, 0), M.state.vehicle.aerodynamicsScale)
elseif modeID == 3 then
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(255, 0, 0, 0), color(55, 55, 255, 0), color(255, 255, 0, 0), color(0, 0, 0, 255), color(0, 0, 0, 0), M.state.vehicle.aerodynamicsScale)
elseif modeID == 3 then
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(255, 0, 0, 0), color(55, 55, 255, 0), color(255, 255, 0, 0), color(0, 0, 0, 255), color(0, 0, 0, 0), M.state.vehicle.aerodynamicsScale)
elseif modeID == 3 then
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(255, 0, 0, 0), color(55, 55, 255, 0), color(255, 255, 0, 0), color(0, 0, 0, 255), color(0, 0, 0, 0), M.state.vehicle.aerodynamicsScale)
elseif modeID == 4 then
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(255, 0, 0, 255), color(55, 55, 255, 255), color(255, 255, 0, 255), color(0, 0, 0, 255), color(0, 0, 0, 0), M.state.vehicle.aerodynamicsScale)
end
elseif modeID == 4 then
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(255, 0, 0, 255), color(55, 55, 255, 255), color(255, 255, 0, 255), color(0, 0, 0, 255), color(0, 0, 0, 0), M.state.vehicle.aerodynamicsScale)
end
elseif modeID == 4 then
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(255, 0, 0, 255), color(55, 55, 255, 255), color(255, 255, 0, 255), color(0, 0, 0, 255), color(0, 0, 0, 0), M.state.vehicle.aerodynamicsScale)
end
elseif modeID == 4 then
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(255, 0, 0, 255), color(55, 55, 255, 255), color(255, 255, 0, 255), color(0, 0, 0, 255), color(0, 0, 0, 0), M.state.vehicle.aerodynamicsScale)
end
elseif modeID == 4 then
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(255, 0, 0, 255), color(55, 55, 255, 255), color(255, 255, 0, 255), color(0, 0, 0, 255), color(0, 0, 0, 0), M.state.vehicle.aerodynamicsScale)
end
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 255, 255), 0.1)
obj.debugDrawProxy:drawSphere(0.1, p, color(255, 0, 0, 255))
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 255, 255), 0.1)
obj.debugDrawProxy:drawSphere(0.1, p, color(255, 0, 0, 255))
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 255, 255), 0.1)
obj.debugDrawProxy:drawSphere(0.1, p, color(255, 0, 0, 255))
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 255, 255), 0.1)
obj.debugDrawProxy:drawSphere(0.1, p, color(255, 0, 0, 255))
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 255, 255), 0.1)
obj.debugDrawProxy:drawSphere(0.1, p, color(255, 0, 0, 255))
obj.debugDrawProxy:drawAerodynamicsCenterOfPressure(color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 0, 0), color(0, 0, 255, 255), 0.1)
obj.debugDrawProxy:drawSphere(0.1, p, color(255, 0, 0, 255))
obj.debugDrawProxy:drawText(p + vec3(0, 0, 0.3), color(255, 0, 0, 255), string.format("COG (%0.3f, %0.3f, %0.3f)", relCOGPos.x, relCOGPos.y, relCOGPos.z))
obj.debugDrawProxy:drawSphere(0.1, p, color(255, 0, 0, 255))
obj.debugDrawProxy:drawText(p + vec3(0, 0, 0.3), color(255, 0, 0, 255), string.format("COG (%0.3f, %0.3f, %0.3f)", relCOGPos.x, relCOGPos.y, relCOGPos.z))
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(0, 0, 0, 255), "COG distance above ground: " .. string.format("%0.3f m", obj:getDistanceFromTerrainPoint(p)))
end
if M.state.vehicle.nodeDebugTextModes[modeID] then
local nodeColor = color(255,128,0,255)
local distToAlpha = nodeTextMaxDist < nodeTextMaxDistCap and (-1 / nodeTextMaxDist * (dist - nodeMinDistFromCam) + 1) or nodeTextMaxDistCap
obj.debugDrawProxy:drawText(pos, color(r,g,b, a * distToAlpha), txt)
--obj.debugDrawProxy:drawNodeText(i, col, txt, nodeDisplayDistance)
if modeID == 2 then
local col = color(255, 0, 255, 255)
initRenderNodeTexts(partsSelected, showWheels)
elseif modeID == 3 then
local col = color(0, 128, 255, 255)
initRenderNodeTexts(partsSelected, showWheels)
elseif modeID == 4 then
local col = color(128, 0, 255, 255)
initRenderNodeTexts(partsSelected, showWheels)
end
renderNodeText(displayAtNode, color(255 * (groupAvgWeight / tblSize / textNodeWeightAvg), 0, 0, 255), text, nodeTextMaxDist, entries)
end
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 60, 0), color(0, 0, 0, 255), "Weight: " .. string.format("%.2f kg", totalWeight))
end
local matname = "unknown"
local col = color(255, 0, 0, 255) -- unknown material: red
if mat ~= nil then
if mat ~= nil then
col = color(mat.colorR, mat.colorG, mat.colorB, 255)
matname = mat.name
end
renderNodeText(displayAtNode, color(math.sqrt(ar / tblSize), math.sqrt(ag / tblSize), math.sqrt(ab / tblSize), math.sqrt(aa / tblSize)), text, nodeTextMaxDist, entries)
end
elseif modeID == 7 then
local col = color(255, 128, 0, 255)
initRenderNodeTexts(partsSelected, showWheels)
local c = min(255, (frc_length * invAvgNodeForce * 0.5) * 255)
local col = color(c, 0, 0, (c + 100))
local r,g,b,a = colorGetRGBA(col)
end
renderNodeText(displayAtNode, color(math.sqrt(ar / tblSize), math.sqrt(ag / tblSize), math.sqrt(ab / tblSize), math.sqrt(aa / tblSize)), text, nodeTextMaxDist, entries)
end
end
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 60, 0), color(0, 0, 0, 255), "Average force: " .. string.format("%0.1f N", textNodeForceAvg))
textNodeForceAvg = forcesSum / (currNodesCount + 1e-30)
elseif modeID == 9 then
local col = color(0, 255, 0, 255)
local initRefNodePos = v.data.nodes[v.data.refNodes[0].ref].pos
elseif modeID == 10 then
local col = color(0, 255, 192, 255)
initRenderNodeTexts(partsSelected, showWheels)
local r,g,b,a = colorGetRGBA(col)
col = color(r,g,b,a * alpha)
local radius = (node.highlight.radius or 0.025) * M.state.vehicle.nodeVisWidthScale
if node.fixed then
c = color(255, 0, 255, 200 * alpha)
elseif node.selfCollision then
elseif node.selfCollision then
c = color(255, 255, 0, 200 * alpha)
elseif node.collision == false then
elseif node.collision == false then
c = color(255, 0, 212, 200 * alpha)
else
else
c = color(0, 255, 255, 200 * alpha)
end
if node.fixed then
c = color(255, 0, 255, 200 * alpha)
elseif node.selfCollision then
elseif node.selfCollision then
c = color(255, 255, 0, 200 * alpha)
elseif node.collision == false then
elseif node.collision == false then
c = color(255, 0, 212, 200 * alpha)
else
else
c = color(0, 255, 255, 200 * alpha)
end
local r = min(1, displacement) * 255
obj.debugDrawProxy:drawNodeSphere(node.cid, nodeScale, color(r, 0, 0, a))
local c = min(255, speed * 10)
local col = color(c, 0, 0, (c + 60) * alpha)
local c = min(255, (frc_length * invAvgNodeForce) * 255)
local col = color(c, 0, 0, (c + 100) * alpha)
obj.debugDrawProxy:drawNodeSphere(node.cid, nodeScale, col)
local col
local colorWater = color(255, 0, 0, 200 * alpha)
local colorAir = color(0, 200, 0, 200 * alpha)
local colorWater = color(255, 0, 0, 200 * alpha)
local colorAir = color(0, 200, 0, 200 * alpha)
for i = 0, nodesCount - 1 do
local r,g,b,a = colorGetRGBA(col)
col = color(r,g,b,a * alpha)
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 60, 0), color(255, 165, 0, 255), "Mode: " .. modeName)
end
if partsSelected[beam.partPath or v.config.partsTree.partPath] then
obj.debugDrawProxy:drawBeam3d(beam.cid, beamScale, color(0, 223, 0, 255 * alpha))
local r,g,b,a = colorGetRGBA(col)
obj.debugDrawProxy:drawBeam3d(beam.cid, beamScale, color(r, g, b, a * alpha))
if beam.beamType == BEAM_SUPPORT and not obj:beamIsBroken(beam.cid) then
obj.debugDrawProxy:drawBeam3d(beam.cid, beamScale, color(r, g, b, a * alpha))
local b = max(0, min(1, stress)) * 255
obj.debugDrawProxy:drawBeam3d(beam.cid, beamScale, color(r, 0, b, a))
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 0, 0, 255), "Compression")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 0, 0, 255), "Compression")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
end
a = a * alpha
obj.debugDrawProxy:drawBeam3d(beam.cid, beamScale, color(r, 0, b, a))
local b = stress >= 0 and 255 or 0
obj.debugDrawProxy:drawBeam3d(beam.cid, beamScale, color(r, 0, b, alpha * 255))
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 0, 0, 255), "Compression")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 0, 0, 255), "Compression")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
end
a = a * alpha
obj.debugDrawProxy:drawBeam3d(beam.cid, beamScale, color(r, 0, b, a))
local b = displacement >= 0 and 255 or 0
obj.debugDrawProxy:drawBeam3d(beam.cid, beamScale, color(r, 0, b, alpha * 255))
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 0, 0, 255), "Compression")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 0, 0, 255), "Compression")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
end
local a = min((absDeform - rangeMin) / deformRange, 1) * 255 * alpha
obj.debugDrawProxy:drawBeam3d(beam.cid, beamScale, color(r, 0, b, a))
local b = deform >= 0 and 255 or 0
obj.debugDrawProxy:drawBeam3d(beam.cid, beamScale, color(r, 0, b, alpha * 255))
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 0, 0, 255), "Compression")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 0, 0, 255), "Compression")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
end
obj.debugDrawProxy:drawCylinder(restPos1, shortBoundTransStartPos1, newBeamScale, color(0,0,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(shortBoundTransStartPos1, shortBoundTransEndPos1, newBeamScale, color(0,128,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(restPos1, shortBoundTransStartPos1, newBeamScale, color(0,0,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(shortBoundTransStartPos1, shortBoundTransEndPos1, newBeamScale, color(0,128,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(shortBoundTransEndPos1, node1Pos, newBeamScale, color(0,255,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(shortBoundTransStartPos1, shortBoundTransEndPos1, newBeamScale, color(0,128,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(shortBoundTransEndPos1, node1Pos, newBeamScale, color(0,255,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(node1Pos, node2Pos, newBeamScale, color(0,255,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(node2Pos, shortBoundTransEndPos2, newBeamScale, color(0,255,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(shortBoundTransEndPos2, shortBoundTransStartPos2, newBeamScale, color(0,128,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(node2Pos, shortBoundTransEndPos2, newBeamScale, color(0,255,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(shortBoundTransEndPos2, shortBoundTransStartPos2, newBeamScale, color(0,128,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(shortBoundTransStartPos2, restPos2, newBeamScale, color(0,0,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(shortBoundTransEndPos2, shortBoundTransStartPos2, newBeamScale, color(0,128,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(shortBoundTransStartPos2, restPos2, newBeamScale, color(0,0,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(restPos1, shortBoundTransStartPos1, newBeamScale, color(0,0,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(shortBoundTransStartPos1, node1Pos, newBeamScale, color(0,128,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(restPos1, shortBoundTransStartPos1, newBeamScale, color(0,0,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(shortBoundTransStartPos1, node1Pos, newBeamScale, color(0,128,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(node1Pos, node2Pos, newBeamScale, color(0,255,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(node2Pos, shortBoundTransStartPos2, newBeamScale, color(0,128,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(shortBoundTransStartPos2, restPos2, newBeamScale, color(0,0,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(node2Pos, shortBoundTransStartPos2, newBeamScale, color(0,128,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(shortBoundTransStartPos2, restPos2, newBeamScale, color(0,0,255,255 * alpha))
elseif currLen < restLen then
obj.debugDrawProxy:drawCylinder(restPos1, node1Pos, newBeamScale, color(0,0,255,255 * alpha))
obj.debugDrawProxy:drawCylinder(node1Pos, node2Pos, newBeamScale, color(0,255,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(node2Pos, restPos2, newBeamScale, color(0,0,255,255 * alpha))
elseif currLen < longBoundTransStart then
obj.debugDrawProxy:drawCylinder(node1Pos, restPos1, newBeamScale, color(255,0,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(restPos1, restPos2, newBeamScale, color(0,255,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(restPos2, node2Pos, newBeamScale, color(255,0,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(node1Pos, longBoundTransStartPos1, newBeamScale, color(255,128,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(longBoundTransStartPos1, restPos1, newBeamScale, color(255,0,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(node1Pos, longBoundTransStartPos1, newBeamScale, color(255,128,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(longBoundTransStartPos1, restPos1, newBeamScale, color(255,0,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(restPos1, restPos2, newBeamScale, color(0,255,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(restPos2, longBoundTransStartPos2, newBeamScale, color(255,0,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(longBoundTransStartPos2, node2Pos, newBeamScale, color(255,128,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(restPos2, longBoundTransStartPos2, newBeamScale, color(255,0,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(longBoundTransStartPos2, node2Pos, newBeamScale, color(255,128,0,255 * alpha))
else
obj.debugDrawProxy:drawCylinder(node1Pos, longBoundTransEndPos1, newBeamScale, color(255,255,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(longBoundTransEndPos1, longBoundTransStartPos1, newBeamScale, color(255,128,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(node1Pos, longBoundTransEndPos1, newBeamScale, color(255,255,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(longBoundTransEndPos1, longBoundTransStartPos1, newBeamScale, color(255,128,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(longBoundTransStartPos1, restPos1, newBeamScale, color(255,0,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(longBoundTransEndPos1, longBoundTransStartPos1, newBeamScale, color(255,128,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(longBoundTransStartPos1, restPos1, newBeamScale, color(255,0,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(restPos1, restPos2, newBeamScale, color(0,255,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(restPos2, longBoundTransStartPos2, newBeamScale, color(255,0,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(longBoundTransStartPos2, longBoundTransEndPos2, newBeamScale, color(255,128,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(restPos2, longBoundTransStartPos2, newBeamScale, color(255,0,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(longBoundTransStartPos2, longBoundTransEndPos2, newBeamScale, color(255,128,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(longBoundTransEndPos2, node2Pos, newBeamScale, color(255,255,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(longBoundTransStartPos2, longBoundTransEndPos2, newBeamScale, color(255,128,0,255 * alpha))
obj.debugDrawProxy:drawCylinder(longBoundTransEndPos2, node2Pos, newBeamScale, color(255,255,0,255 * alpha))
end
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(0,255,255,255), "Short Bound")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0,128,255,255), "Short Bound Transition")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(0,255,255,255), "Short Bound")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0,128,255,255), "Short Bound Transition")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(0,0,255,255), "Contraction")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0,128,255,255), "Short Bound Transition")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(0,0,255,255), "Contraction")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(0,255,0,255), "Beam")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(0,0,255,255), "Contraction")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(0,255,0,255), "Beam")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 180, 0), color(255,0,0,255), "Expansion")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(0,255,0,255), "Beam")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 180, 0), color(255,0,0,255), "Expansion")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 200, 0), color(255,128,0,255), "Long Bound Transition")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 180, 0), color(255,0,0,255), "Expansion")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 200, 0), color(255,128,0,255), "Long Bound Transition")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 220, 0), color(255,255,0,255), "Long Bound")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 200, 0), color(255,128,0,255), "Long Bound Transition")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 220, 0), color(255,255,0,255), "Long Bound")
end
local dirPerp = node1to2Dir:perpendicularN()
local restLenCol = currLen >= restLen and color(255, 0, 0, alpha * 255 * 0.33) or color(0, 0, 255, alpha * 255 * 0.33)
local dirPerp = node1to2Dir:perpendicularN()
local restLenCol = currLen >= restLen and color(255, 0, 0, alpha * 255 * 0.33) or color(0, 0, 255, alpha * 255 * 0.33)
--cylinder representing long bound
obj.debugDrawProxy:drawCylinder(-node1to2Dir * longBoundHalfLen + middlePos + dirPerp * 0.005, node1to2Dir * longBoundHalfLen + middlePos + dirPerp * 0.005, beamScale * 1, color(255, 255, 0, alpha * 255 * 0.5))
-- beam representing full length
obj.debugDrawProxy:drawCylinder(node1Pos, node2Pos, beamScale * 0.5, color(0, 255, 0, alpha * 255))
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(0, 0, 255, 255), "Contraction")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(255, 0, 0, 255), "Expansion")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(0, 0, 255, 255), "Contraction")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(255, 0, 0, 255), "Expansion")
end
local a = min(255, energy * ampScaler * 255 * alpha)
obj.debugDrawProxy:drawBeam3d(beamID, beamScale, color(255, 0, 0, a))
beamsDrawn[bdi] = beamID
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(0, 0, 0, 255), string.format("%.2f Hz", freq))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 0, 255), string.format("Max Amplitude: %.2f m", ampMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(0, 0, 0, 255), string.format("%.2f Hz", freq))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 0, 255), string.format("Max Amplitude: %.2f m", ampMax))
end
local a = alpha * 255
obj.debugDrawProxy:drawBeam3d(beam.cid, beamScale, color(255, 0, 255, a))
obj.debugDrawProxy:drawBeam3d(beam.cid, beamScale, color(r, g, b, a))
or mode.rangeMaxEnabled and (mode.usesInclusiveRange and val <= rangeMax or not mode.usesInclusiveRange and val < rangeMax) then
obj.debugDrawProxy:drawBeam3d(beam.cid, beamScale, color(255, 0, 0, alpha * 255))
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(255, 0, 0, 255), string.format("Range Max: %.2f", rangeMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(255, 0, 0, 255), string.format("Range Max: %.2f", rangeMax))
if mode.showInfinity then
if mode.showInfinity then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 0, 255, 255), "Includes FLT_MAX")
end
local r,g,b,a = colorGetRGBA(color1)
color1 = color(r, g, b, alpha)
local r,g,b,a = colorGetRGBA(color2)
color2 = color(r, g, b, alpha)
obj.debugDrawProxy:drawNodeSphere(id1, nodeScale, color(255, 0, 0, alpha))
obj.debugDrawProxy:drawNodeSphere(id2, nodeScale, color(255, 125, 0, alpha))
obj.debugDrawProxy:drawNodeSphere(id1, nodeScale, color(255, 0, 0, alpha))
obj.debugDrawProxy:drawNodeSphere(id2, nodeScale, color(255, 125, 0, alpha))
obj.debugDrawProxy:drawNodeSphere(id3, nodeScale, color(255, 255, 0, alpha))
obj.debugDrawProxy:drawNodeSphere(id2, nodeScale, color(255, 125, 0, alpha))
obj.debugDrawProxy:drawNodeSphere(id3, nodeScale, color(255, 255, 0, alpha))
obj.debugDrawProxy:drawNodeSphere(id4, nodeScale, color(0, 255, 0, alpha))
obj.debugDrawProxy:drawNodeSphere(id3, nodeScale, color(255, 255, 0, alpha))
obj.debugDrawProxy:drawNodeSphere(id4, nodeScale, color(0, 255, 0, alpha))
--obj.debugDrawProxy:drawNodeTriangle(id1, id2, id3, 0, color(255, 0, 255, alpha * 0.5))
--obj.debugDrawProxy:drawNodeTriangle(id4, id2, id3, 0, color(0, 255, 255, alpha * 0.5))
-- axis
obj.debugDrawProxy:drawCylinder(node2Pos, node3Pos, beamScale * 4, color(255, 128, 0, alpha))
end
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 60, 0), color(255, 165, 0, 255), "Mode: " .. modeName)
end
local a = min((angle - rangeMin) * scaler, 1) * alpha
drawTorsionBar(torbar, nodeScale, beamScale, a, color(0,255,0,255), color(0,255,255,255))
end
local a = min((angle - rangeMin) * scaler, 1) * alpha
drawTorsionBar(torbar, nodeScale, beamScale, a, color(0,255,0,255), color(0,255,255,255))
end
or mode.rangeMaxEnabled and (mode.usesInclusiveRange and angle <= rangeMax or not mode.usesInclusiveRange and angle < rangeMax) then
drawTorsionBar(torbar, nodeScale, beamScale, alpha, color(255,0,0,255), color(255,128,0,255))
end
or mode.rangeMaxEnabled and (mode.usesInclusiveRange and angle <= rangeMax or not mode.usesInclusiveRange and angle < rangeMax) then
drawTorsionBar(torbar, nodeScale, beamScale, alpha, color(255,0,0,255), color(255,128,0,255))
end
local a = min((stress - rangeMin) * scaler, 1) * alpha
drawTorsionBar(torbar, nodeScale, beamScale, a, color(0,255,0,255), color(0,255,255,255))
end
local a = min((stress - rangeMin) * scaler, 1) * alpha
drawTorsionBar(torbar, nodeScale, beamScale, a, color(0,255,0,255), color(0,255,255,255))
end
or mode.rangeMaxEnabled and (mode.usesInclusiveRange and stress <= rangeMax or not mode.usesInclusiveRange and stress < rangeMax) then
drawTorsionBar(torbar, nodeScale, beamScale, alpha, color(255,0,0,255), color(255,128,0,255))
end
or mode.rangeMaxEnabled and (mode.usesInclusiveRange and stress <= rangeMax or not mode.usesInclusiveRange and stress < rangeMax) then
drawTorsionBar(torbar, nodeScale, beamScale, alpha, color(255,0,0,255), color(255,128,0,255))
end
local a = min((absDeform - rangeMin) / deformRange, 1) * alpha
drawTorsionBar(torbar, nodeScale, beamScale, a, color(r, 0, b, a))
end
local b = deform >= 0 and 255 or 0
drawTorsionBar(torbar, nodeScale, beamScale, alpha, color(r, 0, b, alpha))
end
end
drawTorsionBar(torbar, nodeScale * sizeMult, beamScale * sizeMult, alpha, color(255, 0, 255, alpha))
end
drawTorsionBar(torbar, nodeScale * sizeMult, beamScale * sizeMult, alpha, color(r, g, b, alpha))
--end
or mode.rangeMaxEnabled and (mode.usesInclusiveRange and val <= rangeMax or not mode.usesInclusiveRange and val < rangeMax) then
drawTorsionBar(torbar, nodeScale, beamScale, alpha, color(255, 0, 0, alpha))
end
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(255, 0, 0, 255), string.format("Range Max: %.2f", rangeMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(255, 0, 0, 255), string.format("Range Max: %.2f", rangeMax))
if mode.showInfinity then
if mode.showInfinity then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 0, 255, 255), "Includes FLT_MAX")
end
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 60, 0), color(255, 165, 0, 255), "Mode: " .. modeName)
end
@/lua/ge/extensions/editor/gen/world.lua
for _,pth in pairs(out.fyell) do
-- Render.path(pth, color(255,255,150,155), 4)
-- Render.path(pth, color(255,0,0,255), 2)
for i=1,#pth-1 do
end
-- Render.path(out.ahole, color(255,255,0,255), 4)
end
debugDrawer:drawSphere(rayCast.pos + vec3(0,0,0.25), r*4, ColorF(0.3,1,0.2,.6), false)
Render.path({rayCast.pos, rayCast.pos + vec3(0,0,0.2)}, color(0,255,255,255), 3)
end
-- float x1, float y1, float z1,
-- float x2, float y2, float z2, color(255, 255, 255, 255), bool useZ);
-- debugDrawer:drawLine(d.e[1], d.e[2], ColorF(1,1,1,1))
-- Render.path(out.aedge.e, color(255, 255, 255, 255), 2)
end
if axis then
Render.circle(axis + vec3(0,0,0.01), 0.6, color(255,255,255,255), 2)
-- Render.circle(axis + vec3(0,0,0.01), 0.41, color(255,255,255,255))
Render.circle(axis + vec3(0,0,0.01), 0.6, color(255,255,255,255), 2)
-- Render.circle(axis + vec3(0,0,0.01), 0.41, color(255,255,255,255))
Render.path({axis, axis + vec3(0,0,0.5)}, color(255,255,255,200), 2)
-- Render.circle(axis + vec3(0,0,0.01), 0.41, color(255,255,255,255))
Render.path({axis, axis + vec3(0,0,0.5)}, color(255,255,255,200), 2)
-- debugDrawer:drawLine(axis, axis + vec3(0,0,0.5), ColorF(1,1,1,0.6))
@/lua/ge/extensions/gameplay/race/startPosition.lua
local x, y, z = rot * vec3(1,0,0), rot * vec3(0,1,0), rot * vec3(0,0,1)
local col = color(clr[1]*255,clr[2]*255,clr[3]*255,shapeAlpha*255)
@/lua/ge/extensions/editor/roadEditor.lua
if duplicatedRoadIndex and index < edgeCount - 1 then
local duplicatedColor = color(roadRiverGui.highlightColors.duplicated.r * 255,
roadRiverGui.highlightColors.duplicated.g * 255,
@/lua/ge/extensions/editor/dragRaceEditor/strips.lua
-- Draw selected boundary as box with different color
-- Convert ColorF (0-1) to color (0-255): magenta with 0.3 alpha (less opaque)
M.drawAxisBox(corner, x * 2, y * 2, z * 2, color(255, 0, 255, 0.3 * 255)) -- Magenta for selected
-- Convert ColorF (0-1) to color (0-255): magenta with 0.3 alpha (less opaque)
M.drawAxisBox(corner, x * 2, y * 2, z * 2, color(255, 0, 255, 0.3 * 255)) -- Magenta for selected
debugDrawer:drawTextAdvanced(pos, String("Boundary"), ColorF(1, 1, 1, 1), true, false, ColorI(0, 0, 0, 255))
-- Draw normal boundary as box
-- Convert ColorF (0-1) to color (0-255): blue with 0.2 alpha (less opaque)
M.drawAxisBox(corner, x * 2, y * 2, z * 2, color(0, 0, 255, 0.2 * 255)) -- Blue for normal
-- Convert ColorF (0-1) to color (0-255): blue with 0.2 alpha (less opaque)
M.drawAxisBox(corner, x * 2, y * 2, z * 2, color(0, 0, 255, 0.2 * 255)) -- Blue for normal
end
@/lua/ge/extensions/gameplay/missions/missionTypes/editorHelper.lua
local blackColorI = ColorI(0,0,0,192)
local blackColor = color(0,0,0,192)
local function label(e)
local scl = (x+y+z)/2
C:drawAxisBox((-scl+e.transform.pos),x,y,z,color(e.drawColor[1]*255, e.drawColor[2]*255, e.drawColor[3]*255, e.drawColor[4]*255))
elseif e.drawMode == 'fullBox' then
local scl = (x+y+z)
C:drawAxisBox((-scl+e.transform.pos),x*2,y*2,z*2,color(e.drawColor[1]*255, e.drawColor[2]*255, e.drawColor[3]*255, e.drawColor[4]*255))
end
local x, y, z = xn*2, yn*4.2, zn*1.8
local clr = color(e.drawColor[1]*255, e.drawColor[2]*255, e.drawColor[3]*255, e.drawColor[4]*255)
debugDrawer:drawTriSolid(
@/lua/ge/extensions/ui/apps/minimap/vehicles.lua
local clrPoliceRed = color(255,0,0,255)
local clrPoliceBlue = color(0,0,255,255)
local clrPoliceRed = color(255,0,0,255)
local clrPoliceBlue = color(0,0,255,255)
local vehIteratorCtx = {}
if policeCars[otherVId] then
vehColor = color(math.sin(os.clock()*5 + otherVId*0.01 )*128+128, 0, math.sin(os.clock()*5+math.pi+otherVId*0.01)*128+128, 255)
vehLayer = layers.VEHICLES_POLICE
@/lua/ge/extensions/flowgraph/nodes/types/transform.lua
local scl = (x+y+z)/2
self:drawAxisBox((-scl+self.position),x,y,z,color(self.markerColor.red*255, self.markerColor.green*255, self.markerColor.blue*255, self.markerColor.alpha*255))
elseif self.displayMode == 'fullBox' then
local scl = (x+y+z)
self:drawAxisBox((-scl+self.position),x*2,y*2,z*2,color(self.markerColor.red*255, self.markerColor.green*255, self.markerColor.blue*255, self.markerColor.alpha*255))
elseif self.displayMode == 'aproxVehicle' then
x, y, z = rot * vec3(self.scale.x,0,0), rot * vec3(0,self.scale.y,0), rot * vec3(0,0,self.scale.z)
self:drawAxisBox(((-x-1*y-0.3*z)+self.position),x*2,y*4.2,z*1.8,color(self.markerColor.red*255, self.markerColor.green*255, self.markerColor.blue*255, self.markerColor.alpha*255))
debugDrawer:drawTriSolid(
vec3(self.position-y/2 ),
color(self.markerColor.red*128, self.markerColor.green*128, self.markerColor.blue*128, self.markerColor.alpha*255))
debugDrawer:drawTriSolid(
vec3(self.position-y/2 ),
color(self.markerColor.red*128, self.markerColor.green*128, self.markerColor.blue*128, self.markerColor.alpha*255))
end
@/lua/ge/extensions/editor/gen/test.lua
local startPoint = vec3(core_camera.getPosition())
lo('?? pretest:'..tostring(inworld)..':'..tostring(direction)..':'..tostring(startPoint)) --..':'..tostring(color(0,255,255,255).x))
local x, y, z = -3351.02, 3728.87
@/lua/vehicle/extensions/aeroDebug.lua
--obj.debugDrawProxy:drawSphere(0.05, copVec, color(0,0,255,255))
--obj.debugDrawProxy:drawSphere(0.05, cog, color(255,0,255,255))
--obj.debugDrawProxy:drawSphere(0.05, copVec, color(0,0,255,255))
--obj.debugDrawProxy:drawSphere(0.05, cog, color(255,0,255,255))
aeroData.totalAeroForceVehicle = vec3(aeroData.totalAeroForce:dot(M.directionVectorLeft), aeroData.totalAeroForce:dot(M.directionVector), aeroData.totalAeroForce:dot(M.directionVectorUp))
--obj.debugDrawProxy:drawSphere(0.02, rearAxlePos, color(255,0,0,255))
--obj.debugDrawProxy:drawSphere(0.02, frontAxlePos, color(255,0,0,255))
--obj.debugDrawProxy:drawSphere(0.02, rearAxlePos, color(255,0,0,255))
--obj.debugDrawProxy:drawSphere(0.02, frontAxlePos, color(255,0,0,255))
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/vePropTransformer.lua
local lightCol = ColorF(prop.lightColor.r / 255, prop.lightColor.g / 255, prop.lightColor.b / 255, 1)
local lightCol255 = color(prop.lightColor.r, prop.lightColor.g, prop.lightColor.b, 255)