drawLaser: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "[[Scalar" to "[[Number")
m (fixed some formatting)
Line 19: Line 19:
|s1= [[drawLaser]] [sourcePos, direction, color, thickness, dotSize, isIR]
|s1= [[drawLaser]] [sourcePos, direction, color, thickness, dotSize, isIR]


|p1= sourcePos: [[PositionASL]] - World position of the Laser Source
|p1= sourcePos: [[PositionASL]] - world position of the Laser Source


|p2= direction: [[Array]] - Direction vector along which the Laser will shine
|p2= direction: [[Array]] - direction vector along which the laser will shine


|p3= color: [[Array]] - RGB color of the laserbeam and impact dot
|p3= color: [[Array]] - [[Color|color (RGB)]] of the laser beam and impact dot


|p4= color: [[Number]] - Thickness of the laser beam. If set to 0 the beam will not render.
|p4= color: [[Number]] - thickness of the laser beam. If set to 0 the beam will not render


|p5= dotSize: [[Number]] - Size of the impact dot. If set to 0 the impact dot will not render.
|p5= dotSize: [[Number]] - size of the impact dot. If set to 0 the impact dot will not render


|p6= isIR (Optional, default: [[true]]): [[Number]] - Whether the Laser and impact dot are only visible in Nightvision/Thermal Imaging
|p6= isIR: [[Number]] - (optional, default: [[true]]) - whether the laser and impact dot are only visible in night vision/thermal imaging


|r1= [[Nothing]]
|r1= [[Nothing]]


|x1= <code> [[onEachFrame]] {[[drawLaser]] [[[eyePos]] [[player]] [[vectorAdd]] [0,0,0.1], [[getCameraViewDirection]] [[player]], [1000,0,0], 20, 5, [[false]]]}; {{cc|Gives player a laser eye}}</code>
|x1= <code> [[onEachFrame]] {[[drawLaser]] <nowiki>[</nowiki>[[eyePos]] [[player]] [[vectorAdd]] [0, 0, 0.1], [[getCameraViewDirection]] [[player]], [1000, 0, 0], 20, 5, [[false]]]}; {{cc|Gives player a laser eye}}</code>


|seealso= [[drawIcon3D]] [[drawLine3D]]
|seealso= [[drawIcon3D]] [[drawLine3D]]
}}
}}

Revision as of 17:44, 3 September 2021

Hover & click on the images for description
Only available in Development branch(es) until its release with Arma 3 patch v2.08.

Description

Description:
Draws a laserbeam and a lightpoint at the impact location of the laser.
Command has to be executed each frame. Use addMissionEventHandler "Draw3D" which is executed each frame.
Lasers drawn with this command are subject to the same limitations as weapon attachment lasers as set in the CfgIRLaserSettings config class.
Groups:
InteractionLights

Syntax

Syntax:
drawLaser [sourcePos, direction, color, thickness, dotSize, isIR]
Parameters:
sourcePos: PositionASL - world position of the Laser Source
direction: Array - direction vector along which the laser will shine
color: Array - color (RGB) of the laser beam and impact dot
color: Number - thickness of the laser beam. If set to 0 the beam will not render
dotSize: Number - size of the impact dot. If set to 0 the impact dot will not render
isIR: Number - (optional, default: true) - whether the laser and impact dot are only visible in night vision/thermal imaging
Return Value:
Nothing

Examples

Example 1:
onEachFrame {drawLaser [eyePos player vectorAdd [0, 0, 0.1], getCameraViewDirection player, [1000, 0, 0], 20, 5, false]}; // Gives player a laser eye

Additional Information

See also:
drawIcon3D drawLine3D

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note