Page MenuHomeFeedback Tracker

[Bug] LineIntersectsSurfaces doesn't seem to work correctly with animated selections
New, NormalPublic

Description

The LineIntersectsSurfaces command doesn't return some intersections for "door" objects when they're open:

Here, I'm using a simple test code to return the intersections with the "GEOM" lod (see the Steps to Reproduce)

However, the object clearly has a surface there in the Geometry LOD (it also blocks the player's movement, even if crawling):

Note that even though I've shown a single line here, it doesn't return any intersection at all for the left part of the door.

If you close the door, the command works correctly and the "gaps" disappear.

I'm not sure what's wrong here. But I think the command is broken (or maybe a bad LOD?)

Details

Severity
Minor
Resolution
Open
Reproducibility
Sometimes
Operating System
Windows 7
Category
Scripting
Steps To Reproduce
  1. This is where the object in the screenshot is (on Livonia):

player setPos [1598.99,7553.65,0.00143909]

  1. Use this test code (It also shows the surface normal to see where the intersection is happening):
onEachFrame {
	_P1 = player modelToWorldWorld (player selectionPosition "rightHandMiddle1"); //from hand (next to weapon trigger)
	_p2 = (_P1 vectorAdd ((player weaponDirection "") apply {_x*1000})); //up to 1000 meters
	_int = lineIntersectsSurfaces [_P1,_p2,player, objNull, true, 1, "GEOM", "FIRE"];
	if (count _int > 0) then {
		drawLine3D[ASLToAGL _P1, ASLToAGL(_int#0#0), [1,0,0,1]];
		drawLine3D[ASLToAGL(_int#0#0), ASLToAGL(_int#0#0 vectorAdd _int#0#1), [1,0,0,1]];
		drawIcon3D["\a3\ui_f\data\IGUI\Cfg\CrewAimIndicator\gunnerAuto_ca.paa", [1,0,0,0.65], ASLToAGL (_int#0#0), 0.5, 0.5, 0, ""];
		if (getModelInfo (_int#0#3) select 2) then {
			([_int#0#3, "GEOM"] intersect [ASLToAGL _p1, ASLToAGL _p2]) apply {drawIcon3D["\a3\ui_f\data\IGUI\Cfg\CrewAimIndicator\gunnerAuto_ca.paa", [1,0,0,0.65], ASLToAGL (_int#0#0), 0.5, 0.5, 0, (_x#0)];1};
		};
		
	} else {
		drawLine3D[ASLToAGL _P1, ASLToAGL _p2, [1,0,0,1]];
	};
};

Event Timeline

Leopard20 changed Reproducibility from Always to Sometimes.Aug 20 2020, 4:08 PM
Leopard20 updated the task description. (Show Details)Aug 20 2020, 4:10 PM
Leopard20 renamed this task from [Bug] LineIntersectsSurfaces doesn't seem to work correctly to [Bug] LineIntersectsSurfaces doesn't seem to work correctly with animated selections.Aug 20 2020, 4:12 PM
Leopard20 updated the task description. (Show Details)
Leopard20 updated the task description. (Show Details)Aug 20 2020, 4:54 PM
h- added a subscriber: h-.Aug 20 2020, 5:30 PM
Leopard20 updated the task description. (Show Details)Aug 20 2020, 9:26 PM
Leopard20 edited Steps To Reproduce. (Show Details)
BIS_fnc_KK added a subscriber: BIS_fnc_KK.EditedSep 3 2020, 12:48 PM

i have both green sections intersect when door is open but not red section

Actually even red section depends on angle

So is this a bug in lineIntersectsSurfaces or the object? I noticed it in almost all doors on Livonia. I didn't test other maps but I guess it would be the same.

lineIntersectsSurfaces uses engine method if it is a bug then this is how it has been since the dawn of times. Why don't you test other doors on other maps to know for sure?

Leopard20 added a comment.EditedSep 4 2020, 10:12 AM

Okay, so I tested more doors from more maps, and I didn't notice any similar bugs.

It appears that the doors (or their animations) on Livonia are all broken for some reason.

Leopard20 changed Severity from Major to Minor.Sep 5 2020, 2:25 PM