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

Function DrawUPVLight

TombEngine/Objects/TR3/Vehicles/upv.cpp:223–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221 }
222
223 static void DrawUPVLight(ItemInfo* upvItem)
224 {
225 auto* upv = GetUPVInfo(upvItem);
226
227 auto origin = GetJointPosition(upvItem, 0, Vector3i(0, -CLICK(0.5f), CLICK(1))).ToVector3();
228 auto target = GetJointPosition(upvItem, 0, Vector3i(0, -CLICK(0.5f), BLOCK(1))).ToVector3();
229
230 target = target - origin;
231 target.Normalize();
232
233 float lightIntensity = 0.5f + Random::GenerateFloat(0.0f, 0.1f);
234 SpawnDynamicSpotLight(origin, target, Vector4(lightIntensity, lightIntensity, lightIntensity, 1.0f), BLOCK(4), BLOCK(2), BLOCK(10), true, UPV_LIGHT_HASH);
235 }
236
237 static void FireUPVHarpoon(ItemInfo* UPVItem, ItemInfo* laraItem)
238 {

Callers 1

UPVControlFunction · 0.85

Calls 8

GetUPVInfoFunction · 0.85
GetJointPositionFunction · 0.85
GenerateFloatFunction · 0.85
SpawnDynamicSpotLightFunction · 0.85
Vector3iClass · 0.50
Vector4Function · 0.50
ToVector3Method · 0.45
NormalizeMethod · 0.45

Tested by

no test coverage detected