MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / LOS

Function LOS

TombEngine/Game/control/los.cpp:41–64  ·  view source on GitHub ↗

Deprecated.

Source from the content-addressed store, hash-verified

39
40// Deprecated.
41bool LOS(const GameVector* origin, GameVector* target)
42{
43 // FAILSAFE.
44 if (origin->ToVector3i() == target->ToVector3i())
45 {
46 LosRoomNumbers.clear();
47 LosRoomNumbers.push_back(origin->RoomNumber);
48 return true;
49 }
50
51 auto dir = target->ToVector3() - origin->ToVector3();
52 dir.Normalize();
53 float dist = Vector3::Distance(origin->ToVector3(), target->ToVector3());
54
55 auto roomLosColl = GetRoomLosCollision(origin->ToVector3(), origin->RoomNumber, dir, dist);
56 if (roomLosColl.IsIntersected)
57 *target = GameVector(roomLosColl.Position, roomLosColl.RoomNumber);
58
59 // HACK: Transplant LOS room numbers to legacy global.
60 LosRoomNumbers.clear();
61 LosRoomNumbers.insert(LosRoomNumbers.end(), roomLosColl.RoomNumbers.begin(), roomLosColl.RoomNumbers.end());
62
63 return !roomLosColl.IsIntersected;
64}
65
66// Deprecated.
67bool LOSAndReturnTarget(GameVector* origin, GameVector* target, int push)

Callers 15

ScubaControlFunction · 0.85
ControlTwinAutoGunFunction · 0.85
CobraControlFunction · 0.85
UPVEffectsFunction · 0.85
ControlElectricBallFunction · 0.85
CollideLaserBeamFunction · 0.85
ControlGuardianFunction · 0.85
GuardControlFunction · 0.85
ControlGunShipFunction · 0.85
LarsonControlFunction · 0.85
ControlAutoGunFunction · 0.85
SubmarineControlFunction · 0.85

Calls 10

GetRoomLosCollisionFunction · 0.85
GameVectorClass · 0.50
ToVector3iMethod · 0.45
clearMethod · 0.45
push_backMethod · 0.45
ToVector3Method · 0.45
NormalizeMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by 5

TestLaraWallFunction · 0.68
TestLaraFacingCornerFunction · 0.68
LaraPositionOnLOSFunction · 0.68
TestGroundMovementSetupFunction · 0.68
TestMonkeySwingSetupFunction · 0.68