Page MenuHomeFeedback Tracker

drawLaser command not showing the beam along vertical directions
New, NormalPublic

Description

Not working:

onEachFrame {
	drawLaser [
		player modelToWorldWorld [0, 1, 1],
		[0, 0,-1],
		[10000, 0, 0], // Bright red
		[],
		5,
		5,
		-1,
		false
	];
}

adding a minor horizontal component to the dir "fixes" it:

onEachFrame {
	drawLaser [
		player modelToWorldWorld [0, 1, 100],
		[0, 1e-6,-1e3],
		[10000, 0, 0], // Bright red
		[],
		5,
		5,
		-1,
		false
	];
}

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Scripting

Event Timeline

Leopard20 updated the task description. (Show Details)Feb 19 2022, 6:01 PM
Leopard20 updated the task description. (Show Details)Feb 20 2022, 10:10 AM
dedmen added a subscriber: dedmen.Feb 22 2022, 11:05 AM

Laser always has a standard up vector of.. up.
And direction going precisely up/down together with normal up vector just doesn't work.

Leopard20 added a comment.EditedFeb 22 2022, 1:58 PM

And direction going precisely up/down together with normal up vector just doesn't work.

What if you simply do something like:

if (dir.x == 0 && dir.y == 0) {
   up = {1,0,0};
}

? Does changing the up manually not fix it?