Difference between revisions of "drawLaser"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (fixed some formatting)
m (Some wiki formatting)
Line 2: Line 2:
  
 
|game1= arma3
 
|game1= arma3
 +
 +
|version1= 2.08
  
 
|branch= dev
 
|branch= dev
 
|version1= 2.08
 
  
 
|eff= local
 
|eff= local
  
|descr= Draws a laserbeam and a lightpoint at the impact location of the laser. <br>
+
|descr= Draws a laserbeam and a lightpoint at the impact location of the laser.<br>
Command has to be executed each frame. Use [[addMissionEventHandler]] "Draw3D" which is executed each frame.<br>
+
The command has to be executed each frame - see {{HashLink|Arma 3: Mission Event Handlers#Draw3D}}.<br>
Lasers drawn with this command are subject to the same limitations as weapon attachment lasers as set in the '''CfgIRLaserSettings''' config class.
+
Lasers drawn with this command are subject to the same limitations as weapon attachment lasers as set in the <tt>CfgIRLaserSettings</tt> config class.
  
 
|gr1= Interaction
 
|gr1= Interaction
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: [[Array]] format [[PositionASL]] - laser origin position
  
|p2= direction: [[Array]] - direction vector along which the laser will shine
+
|p2= direction: [[Array]] format [[Vector3D]] - laser's direction vector
  
|p3= color: [[Array]] - [[Color|color (RGB)]] of the laser beam and impact dot
+
|p3= color: [[Array]] format [[Color|Color (RGB)]] - laser beam and impact dot colour. Values can go way above the usual 0..1 range as they also act as emissivity brightness
  
|p4= color: [[Number]] - thickness of the laser beam. If set to 0 the beam will not render
+
|p4= thickness: [[Number]] - laser beam thickness scale; 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]] - impact dot size; if set to 0 the impact dot will not render
  
|p6= isIR: [[Number]] - (optional, default: [[true]]) - whether the laser and impact dot are only visible in night vision/thermal imaging
+
|p6= isIR: [[Boolean]] - (Optional, default [[true]]) whether the laser and impact dot are visible only in Night Vision/Thermal Imaging
  
 
|r1= [[Nothing]]
 
|r1= [[Nothing]]
  
|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>
+
|x1= <code>[[addMissionEventHandler]] ["Draw3D", {
 +
[[drawLaser]] [
 +
[[eyePos]] [[player]] [[vectorAdd]] [0,0,0.1],
 +
[[getCameraViewDirection]] [[player]],
 +
[1000,0,0], {{cc|bright red}}
 +
20,
 +
5,
 +
[[false]]
 +
];
 +
}]; {{cc|give player a laser eye}}</code>
  
|seealso= [[drawIcon3D]] [[drawLine3D]]
+
|seealso= [[drawIcon3D]] [[drawLine3D]] {{HashLink|Arma 3: Mission Event Handlers#Draw3D}}
 
}}
 
}}

Revision as of 18:04, 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.
The command has to be executed each frame - see Arma 3: Mission Event Handlers - Draw3D.
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: Array format PositionASL - laser origin position
direction: Array format Vector3D - laser's direction vector
color: Array format Color (RGB) - laser beam and impact dot colour. Values can go way above the usual 0..1 range as they also act as emissivity brightness
thickness: Number - laser beam thickness scale; if set to 0, the beam will not render
dotSize: Number - impact dot size; if set to 0 the impact dot will not render
isIR: Boolean - (Optional, default true) whether the laser and impact dot are visible only in Night Vision/Thermal Imaging
Return Value:
Nothing

Examples

Example 1:
addMissionEventHandler ["Draw3D", { drawLaser [ eyePos player vectorAdd [0,0,0.1], getCameraViewDirection player, [1000,0,0], // bright red 20, 5, false ]; }]; // give player a laser eye

Additional Information

See also:
drawIcon3D drawLine3D Arma 3: Mission Event Handlers - Draw3D

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