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

Function GetTargetPoint

TombEngine/Game/Lara/lara_fire.cpp:388–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386}
387
388GameVector GetTargetPoint(ItemInfo& targetEntity)
389{
390 const auto& bounds = GetClosestKeyframe(targetEntity).BoundingBox;
391
392 auto center = Vector3i(
393 (bounds.X1 + bounds.X2) / 2,
394 bounds.Y1 + (bounds.GetHeight() / 3),
395 (bounds.Z1 + bounds.Z2) / 2);
396
397 float sinY = phd_sin(targetEntity.Pose.Orientation.y);
398 float cosY = phd_cos(targetEntity.Pose.Orientation.y);
399
400 return GameVector(
401 targetEntity.Pose.Position.x + ((center.x * cosY) + (center.z * sinY)),
402 targetEntity.Pose.Position.y + center.y,
403 targetEntity.Pose.Position.z + ((center.z * cosY) - (center.x * sinY)),
404 targetEntity.RoomNumber);
405}
406
407HolsterSlot GetWeaponHolsterSlot(LaraWeaponType weaponType)
408{

Callers 2

FindNewTargetFunction · 0.85
LaraTargetInfoFunction · 0.85

Calls 5

phd_sinFunction · 0.85
phd_cosFunction · 0.85
GetHeightMethod · 0.80
Vector3iClass · 0.70
GameVectorClass · 0.50

Tested by

no test coverage detected