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

Function TranslatePoint

TombEngine/Math/Geometry.cpp:13–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11namespace TEN::Math::Geometry
12{
13 Vector2 TranslatePoint(const Vector2& point, short orient, const Vector2& relOffset)
14 {
15 float sinOrient = sin(TO_RAD(orient));
16 float cosOrient = cos(TO_RAD(orient));
17
18 auto offset = Vector2(
19 (cosOrient * relOffset.x) - (sinOrient * relOffset.y),
20 (sinOrient * relOffset.x) + (cosOrient * relOffset.y));
21
22 return (point + offset);
23 }
24
25 Vector2 TranslatePoint(const Vector2& point, short orient, float dist)
26 {

Callers 15

RenderBlobShadowsMethod · 0.85
AddDebugConeMethod · 0.85
AddDebugCylinderMethod · 0.85
ControlElectricCleanerFunction · 0.85
SpawnPunaLightningFunction · 0.85
HandleEdgeSlipStateFunction · 0.85
UpdateMethod · 0.85
TriggerAlertLightFunction · 0.85
ControlSquishyBlockFunction · 0.85
ControlSpikyWallFunction · 0.85
CollideSpikyWallFunction · 0.85
LookCameraFunction · 0.85

Calls 9

TO_RADFunction · 0.85
Vector3iClass · 0.70
AxisAngleClass · 0.70
Vector2Function · 0.50
Vector3Function · 0.50
NormalizeMethod · 0.45
ToVector3Method · 0.45
ToRotationMatrixMethod · 0.45
ToDirectionMethod · 0.45

Tested by 3

TestValidLedgeFunction · 0.68
TestLaraWallFunction · 0.68
TestLaraPoleCollisionFunction · 0.68