diff options
| author | Dragorn421 <Dragorn421@users.noreply.github.com> | 2022-10-24 21:58:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-24 15:58:33 -0400 |
| commit | ce2e5e71c8b71d45ec3ad1cafe34b00d9a50b8a6 (patch) | |
| tree | fd058c19cad82001b10690880f9409f6b3ac071f /src/code | |
| parent | e4c1a4b5123fbceb84e275c6eb80419c2c05c15d (diff) | |
Documentation pass on `DoorShutter` (#1352)
* Documentation pass on `DoorShutter`
* lockTimer -> unlockTimer
* Add `DOORSHUTTER_STYLE_FROM_SCENE`
* `DoorShutter_SetupType` -> `DoorShutter_WaitForObject`
* perpendicularly -> perpendicular
* `DoorShutter_CheckShouldDraw` -> `DoorShutter_ShouldDraw`
* Improve comment on `DoorShutter_GetPlayerSide`
* `jabuDoorClosed`/`barsClosed` +`Amount`
* attempt to improve a comment
* fix shameful left-aligned numbers
* unname closing/opening
* action funcs names
* run formatter
* enums improvements
Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_actor.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c index a6c607243..4246a0b71 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -931,20 +931,24 @@ f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint) { return Math_Vec3f_DistXZ(&actor->world.pos, refPoint); } -void func_8002DBD0(Actor* actor, Vec3f* result, Vec3f* arg2) { - f32 cosRot2Y; - f32 sinRot2Y; +/** + * Convert `pos` to be relative to the actor's position and yaw, store into `dest`. + * Actor_WorldToActorCoords + */ +void func_8002DBD0(Actor* actor, Vec3f* dest, Vec3f* pos) { + f32 cosY; + f32 sinY; f32 deltaX; f32 deltaZ; - cosRot2Y = Math_CosS(actor->shape.rot.y); - sinRot2Y = Math_SinS(actor->shape.rot.y); - deltaX = arg2->x - actor->world.pos.x; - deltaZ = arg2->z - actor->world.pos.z; + cosY = Math_CosS(actor->shape.rot.y); + sinY = Math_SinS(actor->shape.rot.y); + deltaX = pos->x - actor->world.pos.x; + deltaZ = pos->z - actor->world.pos.z; - result->x = (deltaX * cosRot2Y) - (deltaZ * sinRot2Y); - result->z = (deltaX * sinRot2Y) + (deltaZ * cosRot2Y); - result->y = arg2->y - actor->world.pos.y; + dest->x = (deltaX * cosY) - (deltaZ * sinY); + dest->z = (deltaX * sinY) + (deltaZ * cosY); + dest->y = pos->y - actor->world.pos.y; } f32 Actor_HeightDiff(Actor* actorA, Actor* actorB) { |
