drawLaser: Difference between revisions
Jump to navigation
Jump to search
m (fixed some formatting) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 2: | Line 2: | ||
|game1= arma3 | |game1= arma3 | ||
|version1= 2.08 | |||
|branch= dev | |branch= dev | ||
|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> | ||
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 | 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]] - | |p1= sourcePos: [[Array]] format [[PositionASL]] - laser origin position | ||
|p2= direction: [[Array]] - direction vector | |p2= direction: [[Array]] format [[Vector3D]] - laser's direction vector | ||
|p3= color: [[Array]] | |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= | |p4= thickness: [[Number]] - laser beam thickness scale; if set to 0, the beam will not render | ||
|p5= dotSize: [[Number]] - | |p5= dotSize: [[Number]] - impact dot size; if set to 0 the impact dot will not render | ||
|p6= isIR: [[ | |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> [[ | |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 17:04, 3 September 2021
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
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