Description
Draws a laserbeam and a lightpoint at the impact location of the laser.
This command has to be executed every frame - see Arma 3: Mission Event Handlers#Draw3D.
Lasers drawn with this command are subject to the same limitations as weapon attachment lasers. These limitations are defined in the CfgIRLaserSettings config class.
Syntax
drawLaser [position, direction, beamColor, dotColor, dotSize, beamThickness, beamMaxLength, isIR]
Parameters:
position: PositionASL - the laser's origin positiondirection: Array of Vector3D - the laser's direction vectorbeamColor: Color (RGB) - laser beam color. The values can go way above the usual 0..1 range as they also act as emissivity brightnessdotColor: Color (RGB) or Empty Array - impact dot color. Set to[]to use the same value as beamColor.dotSize: Number - impact dot size; if set to 0 the impact dot will not renderbeamThickness: Number - laser beam's thickness scale; if set to 0, the beam will not renderbeamMaxLength: Number - (Optional, default -1) laser beam's maximum length.-1means maximum length (defined inCfgIRLaserSettings),0means no length at all and the command is ignoredisIR: Boolean - (Optional, default true) whether the laser and impact dot are only visible with Night Vision / Thermal Imaging
Returns: Nothing
Examples
Example 1
Give the player a laser eye:
addMissionEventHandler ["Draw3D", {
drawLaser [
eyePos player vectorAdd [0, 0, 0.1],
getCameraViewDirection player,
[1000, 0, 0], // Bright red
[],
5,
20,
-1,
false
];
}];