|
|
@ -35,6 +35,7 @@ var private bool traced; |
|
|
|
|
|
|
|
|
|
|
|
// Iterator filters |
|
|
|
// Iterator filters |
|
|
|
var private bool onlyPawns; |
|
|
|
var private bool onlyPawns; |
|
|
|
|
|
|
|
var private bool onlyVisible; |
|
|
|
|
|
|
|
|
|
|
|
protected function Finalizer() |
|
|
|
protected function Finalizer() |
|
|
|
{ |
|
|
|
{ |
|
|
@ -57,10 +58,21 @@ public final function Initialize(Vector start, Vector end) |
|
|
|
initialized = true; |
|
|
|
initialized = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function Vector GetTracingStart() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return startPosition; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function Vector GetTracingEnd() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return endPosition; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Does actual tracing, but only once per iterator's lifecycle. |
|
|
|
// Does actual tracing, but only once per iterator's lifecycle. |
|
|
|
// Assumes `initialized` is `true`. |
|
|
|
// Assumes `initialized` is `true`. |
|
|
|
private final function TryTracing() |
|
|
|
private final function TryTracing() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
local bool isVisible; |
|
|
|
local Pawn nextPawn; |
|
|
|
local Pawn nextPawn; |
|
|
|
local Actor nextActor; |
|
|
|
local Actor nextActor; |
|
|
|
local class<Actor> targetClass; |
|
|
|
local class<Actor> targetClass; |
|
|
@ -87,6 +99,14 @@ private final function TryTracing() |
|
|
|
endPosition, |
|
|
|
endPosition, |
|
|
|
startPosition) |
|
|
|
startPosition) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (onlyVisible) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
isVisible = (!nextActor.bHidden || nextActor.bWorldGeometry); |
|
|
|
|
|
|
|
isVisible = isVisible && (nextActor.drawType != DT_None); |
|
|
|
|
|
|
|
if (!isVisible) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
hitLocations[hitLocations.length] = nextHitLocation; |
|
|
|
hitLocations[hitLocations.length] = nextHitLocation; |
|
|
|
hitNormals[hitNormals.length] = nextHitNormal; |
|
|
|
hitNormals[hitNormals.length] = nextHitNormal; |
|
|
|
nextPawn = Pawn(nextActor); |
|
|
|
nextPawn = Pawn(nextActor); |
|
|
@ -173,6 +193,7 @@ public function EPawn GetPawn() |
|
|
|
|
|
|
|
|
|
|
|
public function bool HasFinished() |
|
|
|
public function bool HasFinished() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
TryTracing(); |
|
|
|
return (currentIndex >= tracedActors.length); |
|
|
|
return (currentIndex >= tracedActors.length); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -190,6 +211,14 @@ public function TracingIterator LeaveOnlyPawns() |
|
|
|
return self; |
|
|
|
return self; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function TracingIterator LeaveOnlyVisible() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (initialized && !traced) { |
|
|
|
|
|
|
|
onlyVisible = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return self; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
defaultproperties |
|
|
|
defaultproperties |
|
|
|
{ |
|
|
|
{ |
|
|
|
} |
|
|
|
} |