Rename PHD_3DPOS to PoseData

This commit is contained in:
Sezz 2022-09-06 23:22:32 +10:00
parent 5de91df23b
commit a464518ed1
75 changed files with 183 additions and 185 deletions

View file

@ -616,7 +616,7 @@ void HarpoonBoltControl(short itemNumber)
if (currentMesh->HitPoints <= 0)
{
TriggerExplosionSparks(currentMesh->pos.Position.x, currentMesh->pos.Position.y, currentMesh->pos.Position.z, 3, -2, 0, item->RoomNumber);
auto pos = PHD_3DPOS(currentMesh->pos.Position.x, currentMesh->pos.Position.y - 128, currentMesh->pos.Position.z, 0, currentMesh->pos.Orientation.y, 0);
auto pos = PoseData(currentMesh->pos.Position.x, currentMesh->pos.Position.y - 128, currentMesh->pos.Position.z, 0, currentMesh->pos.Orientation.y, 0);
TriggerShockwave(&pos, 40, 176, 64, 0, 96, 128, 16, 0, 0);
ShatterObject(nullptr, currentMesh, -128, item->RoomNumber, 0);
SmashedMeshRoom[SmashedMeshCount] = item->RoomNumber;
@ -981,7 +981,7 @@ void GrenadeControl(short itemNumber)
{
// Smash objects are legacy objects from TRC, let's make them explode in the legacy way
TriggerExplosionSparks(currentItem->Pose.Position.x, currentItem->Pose.Position.y, currentItem->Pose.Position.z, 3, -2, 0, currentItem->RoomNumber);
auto pos = PHD_3DPOS(currentItem->Pose.Position.x, currentItem->Pose.Position.y - 128, currentItem->Pose.Position.z);
auto pos = PoseData(currentItem->Pose.Position.x, currentItem->Pose.Position.y - 128, currentItem->Pose.Position.z);
TriggerShockwave(&pos, 48, 304, 96, 0, 96, 128, 24, 0, 0);
ExplodeItemNode(currentItem, 0, 0, 128);
short currentItemNumber = (currentItem - CollidedItems[0]);
@ -1004,7 +1004,7 @@ void GrenadeControl(short itemNumber)
if (currentMesh->HitPoints <= 0)
{
TriggerExplosionSparks(currentMesh->pos.Position.x, currentMesh->pos.Position.y, currentMesh->pos.Position.z, 3, -2, 0, item->RoomNumber);
auto pos = PHD_3DPOS(currentMesh->pos.Position.x, currentMesh->pos.Position.y - 128, currentMesh->pos.Position.z, 0, currentMesh->pos.Orientation.y, 0);
auto pos = PoseData(currentMesh->pos.Position.x, currentMesh->pos.Position.y - 128, currentMesh->pos.Position.z, 0, currentMesh->pos.Orientation.y, 0);
TriggerShockwave(&pos, 40, 176, 64, 0, 96, 128, 16, 0, 0);
ShatterObject(nullptr, currentMesh, -128, item->RoomNumber, 0);
SmashedMeshRoom[SmashedMeshCount] = item->RoomNumber;
@ -1277,7 +1277,7 @@ void RocketControl(short itemNumber)
{
// Smash objects are legacy objects from TRC, let's make them explode in the legacy way
TriggerExplosionSparks(currentItem->Pose.Position.x, currentItem->Pose.Position.y, currentItem->Pose.Position.z, 3, -2, 0, currentItem->RoomNumber);
auto pose = PHD_3DPOS(currentItem->Pose.Position.x, currentItem->Pose.Position.y - 128, currentItem->Pose.Position.z);
auto pose = PoseData(currentItem->Pose.Position.x, currentItem->Pose.Position.y - 128, currentItem->Pose.Position.z);
TriggerShockwave(&pose, 48, 304, 96, 0, 96, 128, 24, 0, 0);
ExplodeItemNode(currentItem, 0, 0, 128);
short currentItemNumber = (currentItem - CollidedItems[0]);
@ -1314,7 +1314,7 @@ void RocketControl(short itemNumber)
if (currentMesh->HitPoints <= 0)
{
TriggerExplosionSparks(currentMesh->pos.Position.x, currentMesh->pos.Position.y, currentMesh->pos.Position.z, 3, -2, 0, item->RoomNumber);
auto pose = PHD_3DPOS(currentMesh->pos.Position.x, currentMesh->pos.Position.y - 128, currentMesh->pos.Position.z, 0, currentMesh->pos.Orientation.y, 0);
auto pose = PoseData(currentMesh->pos.Position.x, currentMesh->pos.Position.y - 128, currentMesh->pos.Position.z, 0, currentMesh->pos.Orientation.y, 0);
TriggerShockwave(&pose, 40, 176, 64, 0, 96, 128, 16, 0, 0);
ShatterObject(nullptr, currentMesh, -128, item->RoomNumber, 0);
SmashedMeshRoom[SmashedMeshCount] = item->RoomNumber;
@ -1358,7 +1358,7 @@ void RocketControl(short itemNumber)
}
}
void FireCrossbow(ItemInfo* laraItem, PHD_3DPOS* pos)
void FireCrossbow(ItemInfo* laraItem, PoseData* pos)
{
auto* lara = GetLaraInfo(laraItem);
@ -1441,7 +1441,7 @@ void FireCrossBowFromLaserSight(ItemInfo* laraItem, GameVector* src, GameVector*
auto angles = GetOrientTowardPoint(
Vector3(src->x, src->y, src->z),
Vector3(target->x, target->y, target->z));
auto boltPose = PHD_3DPOS(src->x, src->y, src->z, angles);
auto boltPose = PoseData(src->x, src->y, src->z, angles);
FireCrossbow(laraItem, &boltPose);
}

View file

@ -55,7 +55,7 @@ void GrenadeControl(short itemNumber);
//void GrenadeExplosionEffects(int x, int y, int z, short roomNumber);
void FireRocket(ItemInfo* laraItem);
void RocketControl(short itemNumber);
void FireCrossbow(ItemInfo* laraItem, PHD_3DPOS* pos);
void FireCrossbow(ItemInfo* laraItem, PoseData* pos);
void CrossbowBoltControl(short itemNumber);
void FireCrossBowFromLaserSight(ItemInfo* laraItem, GameVector* src, GameVector* target);

View file

@ -1282,7 +1282,7 @@ struct LaraInfo
int ProjectedFloorHeight;
EulerAngles TargetOrientation;
int WaterSurfaceDist;
PHD_3DPOS NextCornerPos;
PoseData NextCornerPos;
// TODO: Use BurnType in place of Burn, BurnBlue, and BurnSmoke. Core didn't make replacing them easy.
BurnType BurnType;

View file

@ -66,6 +66,6 @@ struct JumpTestSetup
struct CornerTestResult
{
bool Success;
PHD_3DPOS ProbeResult;
PHD_3DPOS RealPositionResult;
PoseData ProbeResult;
PoseData RealPositionResult;
};

View file

@ -678,7 +678,7 @@ CornerTestResult TestItemAtNextCornerPosition(ItemInfo* item, CollisionInfo* col
auto turnAngle = outer ? angle : -angle;
// Backup previous position into array
PHD_3DPOS pos[3] = { item->Pose, item->Pose, item->Pose };
PoseData pos[3] = { item->Pose, item->Pose, item->Pose };
// Do a two-step rotation check. First step is real resulting position, and second step is probing
// position. We need this because checking at exact ending position does not always return

View file

@ -559,7 +559,7 @@ void DrawAnimatingItem(ItemInfo* item)
// Empty stub because actually we disable items drawing when drawRoutine pointer is nullptr in ObjectInfo
}
void ClampRotation(PHD_3DPOS* pose, short angle, short rotation)
void ClampRotation(PoseData* pose, short angle, short rotation)
{
if (angle <= rotation)
{

View file

@ -1,7 +1,7 @@
#pragma once
#include "Specific/phd_global.h"
struct PHD_3DPOS;
struct PoseData;
struct Vector3i;
struct ItemInfo;
@ -92,7 +92,7 @@ int GetFrame(ItemInfo* item, ANIM_FRAME* framePtr[], int* rate);
ANIM_FRAME* GetBestFrame(ItemInfo* item);
BOUNDING_BOX* GetBoundsAccurate(ItemInfo* item);
void ClampRotation(PHD_3DPOS* pose, short angle, short rotation);
void ClampRotation(PoseData* pose, short angle, short rotation);
void DrawAnimatingItem(ItemInfo* item);
Vector3i GetLaraJointPosition(int jointIndex, Vector3i offset = Vector3i::Zero);

View file

@ -42,8 +42,8 @@ struct OLD_CAMERA
short actualElevation;
short targetElevation;
short actualAngle;
PHD_3DPOS pos;
PHD_3DPOS pos2;
PoseData pos;
PoseData pos2;
Vector3i target;
};
@ -1738,14 +1738,14 @@ void ResetLook(ItemInfo* item)
}
}
bool TestBoundsCollideCamera(BOUNDING_BOX* bounds, PHD_3DPOS* pos, short radius)
bool TestBoundsCollideCamera(BOUNDING_BOX* bounds, PoseData* pos, short radius)
{
auto dxBox = TO_DX_BBOX(*pos, bounds);
auto sphere = BoundingSphere(Vector3(Camera.pos.x, Camera.pos.y, Camera.pos.z), radius);
return sphere.Intersects(dxBox);
}
void ItemPushCamera(BOUNDING_BOX* bounds, PHD_3DPOS* pos, short radius)
void ItemPushCamera(BOUNDING_BOX* bounds, PoseData* pos, short radius)
{
int dx = Camera.pos.x - pos->Position.x;
int dz = Camera.pos.z - pos->Position.z;

View file

@ -90,8 +90,8 @@ void LookLeftRight(ItemInfo* item);
void LookUpDown(ItemInfo* item);
void ResetLook(ItemInfo* item);
void RumbleScreen();
bool TestBoundsCollideCamera(BOUNDING_BOX* bounds, PHD_3DPOS* pos, short radius);
void ItemPushCamera(BOUNDING_BOX* bounds, PHD_3DPOS* pos, short radius);
bool TestBoundsCollideCamera(BOUNDING_BOX* bounds, PoseData* pos, short radius);
void ItemPushCamera(BOUNDING_BOX* bounds, PoseData* pos, short radius);
void ItemsCollideCamera();
void SetScreenFadeOut(float speed);

View file

@ -453,7 +453,7 @@ bool MoveLaraPosition(Vector3i* vec, ItemInfo* item, ItemInfo* laraItem)
{
auto* lara = GetLaraInfo(laraItem);
auto target = PHD_3DPOS(item->Pose.Orientation);
auto target = PoseData(item->Pose.Orientation);
auto pos = vec->ToVector3();
Matrix matrix = Matrix::CreateFromYawPitchRoll(
@ -501,7 +501,7 @@ static bool ItemInRange(int x, int z, int radius)
return ((SQUARE(x) + SQUARE(z)) <= SQUARE(radius));
}
bool ItemNearLara(PHD_3DPOS* pos, int radius)
bool ItemNearLara(PoseData* pos, int radius)
{
auto target = GameVector(
pos->Position.x - LaraItem->Pose.Position.x,
@ -525,7 +525,7 @@ bool ItemNearLara(PHD_3DPOS* pos, int radius)
return false;
}
bool ItemNearTarget(PHD_3DPOS* src, ItemInfo* target, int radius)
bool ItemNearTarget(PoseData* src, ItemInfo* target, int radius)
{
auto pos = src->Position - target->Pose.Position;
@ -545,7 +545,7 @@ bool ItemNearTarget(PHD_3DPOS* src, ItemInfo* target, int radius)
return false;
}
bool Move3DPosTo3DPos(PHD_3DPOS* origin, PHD_3DPOS* target, int velocity, short angleAdd)
bool Move3DPosTo3DPos(PoseData* origin, PoseData* target, int velocity, short angleAdd)
{
auto direction = target->Position - origin->Position;
int distance = sqrt(SQUARE(direction.x) + SQUARE(direction.y) + SQUARE(direction.z));
@ -891,7 +891,7 @@ void CollideSolidStatics(ItemInfo* item, CollisionInfo* coll)
}
}
bool CollideSolidBounds(ItemInfo* item, BOUNDING_BOX* box, PHD_3DPOS pos, CollisionInfo* coll)
bool CollideSolidBounds(ItemInfo* item, BOUNDING_BOX* box, PoseData pos, CollisionInfo* coll)
{
bool result = false;
@ -936,11 +936,11 @@ bool CollideSolidBounds(ItemInfo* item, BOUNDING_BOX* box, PHD_3DPOS pos, Collis
}
// Get and test DX item coll bounds
auto collBounds = TO_DX_BBOX(PHD_3DPOS(item->Pose.Position), &collBox);
auto collBounds = TO_DX_BBOX(PoseData(item->Pose.Position), &collBox);
bool intersects = staticBounds.Intersects(collBounds);
// Check if previous item horizontal position intersects bounds
auto oldCollBounds = TO_DX_BBOX(PHD_3DPOS(coll->Setup.OldPosition.x, item->Pose.Position.y, coll->Setup.OldPosition.z), &collBox);
auto oldCollBounds = TO_DX_BBOX(PoseData(coll->Setup.OldPosition.x, item->Pose.Position.y, coll->Setup.OldPosition.z), &collBox);
bool oldHorIntersects = staticBounds.Intersects(oldCollBounds);
// Draw item coll bounds
@ -1030,7 +1030,7 @@ bool CollideSolidBounds(ItemInfo* item, BOUNDING_BOX* box, PHD_3DPOS pos, Collis
return false;
// Check if bounds still collide after top/bottom position correction
if (!staticBounds.Intersects(TO_DX_BBOX(PHD_3DPOS(item->Pose.Position.x, item->Pose.Position.y, item->Pose.Position.z), &collBox)))
if (!staticBounds.Intersects(TO_DX_BBOX(PoseData(item->Pose.Position.x, item->Pose.Position.y, item->Pose.Position.z), &collBox)))
return result;
// Determine identity rotation/distance
@ -1839,7 +1839,7 @@ void DoObjectCollision(ItemInfo* laraItem, CollisionInfo* coll)
!harmless && abs(laraItem->Animation.Velocity.z) > VEHICLE_COLLISION_TERMINAL_VELOCITY &&
StaticObjects[mesh->staticNumber].shatterType != SHT_NONE)
{
SoundEffect(GetShatterSound(mesh->staticNumber), (PHD_3DPOS*)mesh);
SoundEffect(GetShatterSound(mesh->staticNumber), (PoseData*)mesh);
ShatterObject(nullptr, mesh, -128, laraItem->RoomNumber, 0);
SmashedMeshRoom[SmashedMeshCount] = laraItem->RoomNumber;
SmashedMesh[SmashedMeshCount] = mesh;

View file

@ -36,17 +36,17 @@ bool TestLaraPosition(OBJECT_COLLISION_BOUNDS* bounds, ItemInfo* item, ItemInfo*
bool AlignLaraPosition(Vector3i* vec, ItemInfo* item, ItemInfo* laraItem);
bool MoveLaraPosition(Vector3i* pos, ItemInfo* item, ItemInfo* laraItem);
bool ItemNearLara(PHD_3DPOS* pos, int radius);
bool ItemNearTarget(PHD_3DPOS* src, ItemInfo* target, int radius);
bool ItemNearLara(PoseData* pos, int radius);
bool ItemNearTarget(PoseData* src, ItemInfo* target, int radius);
bool Move3DPosTo3DPos(PHD_3DPOS* src, PHD_3DPOS* dest, int velocity, short angleAdd);
bool Move3DPosTo3DPos(PoseData* src, PoseData* dest, int velocity, short angleAdd);
bool TestBoundsCollide(ItemInfo* item, ItemInfo* laraItem, int radius);
bool TestBoundsCollideStatic(ItemInfo* item, MESH_INFO* mesh, int radius);
bool ItemPushItem(ItemInfo* item, ItemInfo* laraItem, CollisionInfo* coll, bool spasmEnabled, char bigPush);
bool ItemPushStatic(ItemInfo* laraItem, MESH_INFO* mesh, CollisionInfo* coll);
bool CollideSolidBounds(ItemInfo* item, BOUNDING_BOX* box, PHD_3DPOS pos, CollisionInfo* coll);
bool CollideSolidBounds(ItemInfo* item, BOUNDING_BOX* box, PoseData pos, CollisionInfo* coll);
void CollideSolidStatics(ItemInfo* item, CollisionInfo* coll);
void AIPickupCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll);

View file

@ -109,7 +109,7 @@ void DropEntityPickups(ItemInfo* item)
}
}
bool MoveCreature3DPos(PHD_3DPOS* origin, PHD_3DPOS* target, int velocity, short angleDif, int angleAdd)
bool MoveCreature3DPos(PoseData* origin, PoseData* target, int velocity, short angleDif, int angleAdd)
{
auto differenceVector = target->Position - origin->Position;
float distance = Vector3::Distance(origin->Position.ToVector3(), target->Position.ToVector3());
@ -138,7 +138,7 @@ bool MoveCreature3DPos(PHD_3DPOS* origin, PHD_3DPOS* target, int velocity, short
return false;
}
void CreatureYRot2(PHD_3DPOS* srcPos, short angle, short angleAdd)
void CreatureYRot2(PoseData* srcPos, short angle, short angleAdd)
{
if (angleAdd < angle)
{

View file

@ -152,8 +152,8 @@ void FindAITargetObject(CreatureInfo* creature, short objectNumber);
void GetAITarget(CreatureInfo* creature);
int CreatureVault(short itemNumber, short angle, int vault, int shift);
void DropEntityPickups(ItemInfo* item);
bool MoveCreature3DPos(PHD_3DPOS* origin, PHD_3DPOS* target, int velocity, short angleDif, int angleAdd);
void CreatureYRot2(PHD_3DPOS* srcPos, short angle, short angleAdd);
bool MoveCreature3DPos(PoseData* origin, PoseData* target, int velocity, short angleDif, int angleAdd);
void CreatureYRot2(PoseData* srcPos, short angle, short angleAdd);
bool SameZone(CreatureInfo* creature, ItemInfo* target);
void FindAITargetObject(CreatureInfo* creature, short objNum);
short AIGuard(CreatureInfo* creature);

View file

@ -125,7 +125,7 @@ bool GetTargetOnLOS(GameVector* src, GameVector* dest, bool drawTarget, bool fir
SmashedMesh[SmashedMeshCount] = mesh;
++SmashedMeshCount;
mesh->flags &= ~StaticMeshFlags::SM_VISIBLE;
SoundEffect(GetShatterSound(mesh->staticNumber), (PHD_3DPOS*)mesh);
SoundEffect(GetShatterSound(mesh->staticNumber), (PoseData*)mesh);
}
TriggerRicochetSpark(&target, LaraItem->Pose.Orientation.y, 3, 0);
@ -301,7 +301,7 @@ int ObjectOnLOS2(GameVector* start, GameVector* end, Vector3i* vec, MESH_INFO**
for (int r = 0; r < NumberLosRooms; ++r)
{
PHD_3DPOS pos;
PoseData pos;
auto* room = &g_Level.Rooms[LosRooms[r]];
for (int m = 0; m < room->mesh.size(); m++)
@ -358,7 +358,7 @@ int ObjectOnLOS2(GameVector* start, GameVector* end, Vector3i* vec, MESH_INFO**
return ClosestItem;
}
bool DoRayBox(GameVector* start, GameVector* end, BOUNDING_BOX* box, PHD_3DPOS* itemOrStaticPos, Vector3i* hitPos, short closesItemNumber)
bool DoRayBox(GameVector* start, GameVector* end, BOUNDING_BOX* box, PoseData* itemOrStaticPos, Vector3i* hitPos, short closesItemNumber)
{
// Ray
FXMVECTOR rayStart = { (float)start->x, (float)start->y, (float)start->z };

View file

@ -12,4 +12,4 @@ int zLOS(GameVector* start, GameVector* end);
bool ClipTarget(GameVector* start, GameVector* target);
bool GetTargetOnLOS(GameVector* src, GameVector* dest, bool drawTarget, bool firing);
int ObjectOnLOS2(GameVector* start, GameVector* end, Vector3i* vec, MESH_INFO** mesh, GAME_OBJECT_ID priorityObject = GAME_OBJECT_ID::ID_NO_OBJECT);
bool DoRayBox(GameVector* start, GameVector* end, BOUNDING_BOX* box, PHD_3DPOS* itemOrStaticPos, Vector3i* hitPos, short closesItemNumber);
bool DoRayBox(GameVector* start, GameVector* end, BOUNDING_BOX* box, PoseData* itemOrStaticPos, Vector3i* hitPos, short closesItemNumber);

View file

@ -123,7 +123,7 @@ namespace TEN::Control::Volumes
void TestVolumes(CAMERA_INFO* camera)
{
auto pos = PHD_3DPOS(camera->pos.x, camera->pos.y, camera->pos.z, 0, 0, 0);
auto pos = PoseData(camera->pos.x, camera->pos.y, camera->pos.z, 0, 0, 0);
auto box = BOUNDING_BOX();
box.X1 = box.Y1 = box.Z1 = CAM_SIZE;
box.X2 = box.Y2 = box.Z2 = -CAM_SIZE;

View file

@ -99,7 +99,7 @@ void TriggerChaffEffects(ItemInfo* item, Vector3i* pos, Vector3i* vel, int speed
}
}
PHD_3DPOS position = item->Pose;
PoseData position = item->Pose;
if (item->IsLara())
{
Vector3i handPos = {};

View file

@ -14,7 +14,7 @@ void TriggerChaffSmoke(Vector3i* pos, Vector3i* vel, int speed, bool moving, boo
void TriggerChaffBubbles(Vector3i* pos, int FlareRoomNumber);
/* void TriggerChaffEffects(ItemInfo* item, PHD_3DPOS pos, short angle, int speed, bool underwater);
void TriggerChaffSparkles(PHD_3DPOS pos, short angle, int speed);
void TriggerChaffSmoke(PHD_3DPOS pos, short angle, int speed, bool moving);
void TriggerChaffBubbles(PHD_3DPOS pos, int FlareRoomNumber); */
/* void TriggerChaffEffects(ItemInfo* item, PoseData pos, short angle, int speed, bool underwater);
void TriggerChaffSparkles(PoseData pos, short angle, int speed);
void TriggerChaffSmoke(PoseData pos, short angle, int speed, bool moving);
void TriggerChaffBubbles(PoseData pos, int FlareRoomNumber); */

View file

@ -938,7 +938,7 @@ void SetupSplash(const SPLASH_SETUP* const setup, int room)
}
TEN::Effects::Drip::SpawnSplashDrips(Vector3(setup->x, setup->y-15, setup->z),32,room);
PHD_3DPOS soundPosition;
PoseData soundPosition;
soundPosition.Position.x = setup->x;
soundPosition.Position.y = setup->y;
soundPosition.Position.z = setup->z;
@ -1081,7 +1081,7 @@ void TriggerUnderwaterBlood(int x, int y, int z, int size)
}
}
void Richochet(PHD_3DPOS* pos)
void Richochet(PoseData* pos)
{
short angle = mGetAngle(pos->Position.z, pos->Position.x, LaraItem->Pose.Position.z, LaraItem->Pose.Position.x);
GameVector target;

View file

@ -40,7 +40,7 @@ enum SpriteEnumFlag
struct FX_INFO
{
PHD_3DPOS pos;
PoseData pos;
short roomNumber;
short objectNumber;
short nextFx;
@ -216,4 +216,4 @@ void WadeSplash(ItemInfo* item, int wh, int wd);
void Splash(ItemInfo* item);
void TriggerRocketFire(int x, int y, int z);
void TriggerExplosionBubbles(int x, int y, int z, short roomNumber);
void Richochet(PHD_3DPOS* pos);
void Richochet(PoseData* pos);

View file

@ -39,7 +39,7 @@ namespace TEN::Effects::Explosion
if (triggerShockwave)
{
PHD_3DPOS shockPos;
PoseData shockPos;
shockPos.Position.x = pos.x;
shockPos.Position.y = pos.y;
shockPos.Position.z = pos.z;

View file

@ -10,7 +10,7 @@ struct ItemInfo;
struct HAIR_STRUCT
{
PHD_3DPOS pos;
PoseData pos;
Vector3i hvel;
Vector3i unknown;

View file

@ -1527,7 +1527,7 @@ int GetFreeShockwave()
return -1;
}
void TriggerShockwave(PHD_3DPOS* pos, short innerRad, short outerRad, int speed, unsigned char r, unsigned char g, unsigned char b, unsigned char life, short angle, short flags)
void TriggerShockwave(PoseData* pos, short innerRad, short outerRad, int speed, unsigned char r, unsigned char g, unsigned char b, unsigned char life, short angle, short flags)
{
int s = GetFreeShockwave();
SHOCKWAVE_STRUCT* sptr;

View file

@ -65,7 +65,7 @@ struct SHOCKWAVE_STRUCT
struct GUNSHELL_STRUCT
{
PHD_3DPOS pos;
PoseData pos;
short fallspeed;
short roomNumber;
short speed;
@ -238,7 +238,7 @@ void UpdateDrips();
void TriggerLaraDrips(ItemInfo* item);
void ExplodingDeath(short itemNumber, short flags); // EXPLODE_ flags
int GetFreeShockwave();
void TriggerShockwave(PHD_3DPOS* pos, short innerRad, short outerRad, int speed, unsigned char r, unsigned char g, unsigned char b, unsigned char life, short angle, short flags);
void TriggerShockwave(PoseData* pos, short innerRad, short outerRad, int speed, unsigned char r, unsigned char g, unsigned char b, unsigned char life, short angle, short flags);
void TriggerShockwaveHitEffect(int x, int y, int z, unsigned char r, unsigned char g, unsigned char b, short rot, int vel);
void UpdateShockwaves();
void TriggerSmallSplash(int x, int y, int z, int number);

View file

@ -597,7 +597,7 @@ short SpawnItem(ItemInfo* item, GAME_OBJECT_ID objectNumber)
spawn->ObjectNumber = objectNumber;
spawn->RoomNumber = item->RoomNumber;
memcpy(&spawn->Pose, &item->Pose, sizeof(PHD_3DPOS));
memcpy(&spawn->Pose, &item->Pose, sizeof(PoseData));
InitialiseItem(itemNumber);

View file

@ -77,8 +77,8 @@ struct ItemInfo
ITEM_DATA Data;
EntityAnimationData Animation;
PHD_3DPOS StartPose;
PHD_3DPOS Pose;
PoseData StartPose;
PoseData Pose;
ROOM_VECTOR Location;
short RoomNumber;
int Floor;

View file

@ -86,7 +86,7 @@ short GunMiss(int x, int y, int z, short velocity, short yRot, short roomNumber)
LaraItem->RoomNumber
);
Richochet((PHD_3DPOS*)&pos);
Richochet((PoseData*)&pos);
return GunShot(x, y, z, velocity, yRot, roomNumber);
}

View file

@ -41,7 +41,7 @@ struct ROOM_LIGHT
struct MESH_INFO
{
PHD_3DPOS pos;
PoseData pos;
float scale;
short staticNumber;
short flags;

View file

@ -78,9 +78,9 @@ void LoadSavegameInfos()
}
}
PHD_3DPOS ToPHD(Save::Position const* src)
PoseData ToPHD(Save::Position const* src)
{
PHD_3DPOS dest;
PoseData dest;
dest.Position.x = src->x_pos();
dest.Position.y = src->y_pos();
dest.Position.z = src->z_pos();
@ -90,7 +90,7 @@ PHD_3DPOS ToPHD(Save::Position const* src)
return dest;
}
Save::Position FromPHD(PHD_3DPOS const& src)
Save::Position FromPHD(PoseData const& src)
{
return Save::Position{
src.Position.x,

View file

@ -8,51 +8,51 @@
//namespace TEN::Math
//{
PHD_3DPOS const PHD_3DPOS::Empty = PHD_3DPOS(Vector3i::Zero, EulerAngles::Zero);
PoseData const PoseData::Empty = PoseData(Vector3i::Zero, EulerAngles::Zero);
PHD_3DPOS::PHD_3DPOS()
PoseData::PoseData()
{
}
PHD_3DPOS::PHD_3DPOS(const Vector3i& pos)
PoseData::PoseData(const Vector3i& pos)
{
this->Position = pos;
}
PHD_3DPOS::PHD_3DPOS(int xPos, int yPos, int zPos)
PoseData::PoseData(int xPos, int yPos, int zPos)
{
this->Position = Vector3i(xPos, yPos, zPos);
}
PHD_3DPOS::PHD_3DPOS(const EulerAngles& orient)
PoseData::PoseData(const EulerAngles& orient)
{
this->Orientation = orient;
}
PHD_3DPOS::PHD_3DPOS(short xOrient, short yOrient, short zOrient)
PoseData::PoseData(short xOrient, short yOrient, short zOrient)
{
this->Orientation = EulerAngles(xOrient, yOrient, zOrient);
}
PHD_3DPOS::PHD_3DPOS(const Vector3i& pos, const EulerAngles& orient)
PoseData::PoseData(const Vector3i& pos, const EulerAngles& orient)
{
this->Position = pos;
this->Orientation = orient;
}
PHD_3DPOS::PHD_3DPOS(const Vector3i& pos, short xOrient, short yOrient, short zOrient)
PoseData::PoseData(const Vector3i& pos, short xOrient, short yOrient, short zOrient)
{
this->Position = pos;
this->Orientation = EulerAngles(xOrient, yOrient, zOrient);
}
PHD_3DPOS::PHD_3DPOS(int xPos, int yPos, int zPos, const EulerAngles& orient)
PoseData::PoseData(int xPos, int yPos, int zPos, const EulerAngles& orient)
{
this->Position = Vector3i(xPos, yPos, zPos);
this->Orientation = orient;
}
PHD_3DPOS::PHD_3DPOS(int xPos, int yPos, int zPos, short xOrient, short yOrient, short zOrient)
PoseData::PoseData(int xPos, int yPos, int zPos, short xOrient, short yOrient, short zOrient)
{
this->Position = Vector3i(xPos, yPos, zPos);
this->Orientation = EulerAngles(xOrient, yOrient, zOrient);

View file

@ -4,23 +4,21 @@
//namespace TEN::Math
//{
// TODO: Rename to PoseData (or something else that specifically describes a position + orientation representation, if we prefer).
// This struct has changed vastly and the old name is no longer appropriate. -- Sezz 2022.07.23
struct PHD_3DPOS
struct PoseData
{
Vector3i Position = Vector3i::Zero;
EulerAngles Orientation = EulerAngles::Zero;
static const PHD_3DPOS Empty;
static const PoseData Empty;
PHD_3DPOS();
PHD_3DPOS(const Vector3i& pos);
PHD_3DPOS(int xPos, int yPos, int zPos);
PHD_3DPOS(const EulerAngles& orient);
PHD_3DPOS(short xOrient, short yOrient, short zOrient);
PHD_3DPOS(const Vector3i& pos, const EulerAngles& orient);
PHD_3DPOS(const Vector3i& pos, short xOrient, short yOrient, short zOrient);
PHD_3DPOS(int xPos, int yPos, int zPos, const EulerAngles& orient);
PHD_3DPOS(int xPos, int yPos, int zPos, short xOrient, short yOrient, short zOrient);
PoseData();
PoseData(const Vector3i& pos);
PoseData(int xPos, int yPos, int zPos);
PoseData(const EulerAngles& orient);
PoseData(short xOrient, short yOrient, short zOrient);
PoseData(const Vector3i& pos, const EulerAngles& orient);
PoseData(const Vector3i& pos, short xOrient, short yOrient, short zOrient);
PoseData(int xPos, int yPos, int zPos, const EulerAngles& orient);
PoseData(int xPos, int yPos, int zPos, short xOrient, short yOrient, short zOrient);
};
//}

View file

@ -92,7 +92,7 @@
return EulerAngles(xOrient, yOrient, 0.0f);
}
bool IsPointInFront(const PHD_3DPOS& pose, const Vector3& target)
bool IsPointInFront(const PoseData& pose, const Vector3& target)
{
return IsPointInFront(pose.Position.ToVector3(), target, pose.Orientation);
}
@ -128,7 +128,7 @@
return false;
}
bool IsPointOnLeft(const PHD_3DPOS& pose, const Vector3& target)
bool IsPointOnLeft(const PoseData& pose, const Vector3& target)
{
return IsPointOnLeft(pose.Position.ToVector3(), target, pose.Orientation);
}

View file

@ -1,6 +1,6 @@
#pragma once
struct PHD_3DPOS;
struct PoseData;
struct Vector3i;
class EulerAngles;
@ -21,10 +21,10 @@ class EulerAngles;
// Since Y is assumed as the vertical axis, only the Y Euler component needs to be considered and
// 2D vector operations can be done in the XZ plane. Maybe revise these to each take an up vector argument someday.
bool IsPointInFront(const PHD_3DPOS& pose, const Vector3& target);
bool IsPointInFront(const PoseData& pose, const Vector3& target);
bool IsPointInFront(const Vector3& origin, const Vector3& target, const EulerAngles& orient);
bool IsPointInFront(const Vector3& origin, const Vector3& target, const Vector3& refPoint);
bool IsPointOnLeft(const PHD_3DPOS& pose, const Vector3& target);
bool IsPointOnLeft(const PoseData& pose, const Vector3& target);
bool IsPointOnLeft(const Vector3& origin, const Vector3& target, const EulerAngles& orient);
bool IsPointOnLeft(const Vector3& origin, const Vector3& target, const Vector3& refPoint);
//}

View file

@ -625,7 +625,7 @@ namespace TEN::Entities::Effects
TriggerDynamicLight(x, item->Pose.Position.y, z, 12, (GetRandomControl() & 0x3F) + 192, ((GetRandomControl() >> 4) & 0x1F) + 96, 0);
auto pos = PHD_3DPOS(item->Pose.Position);
auto pos = PoseData(item->Pose.Position);
if (ItemNearLara(&pos, 600))
{

View file

@ -5,7 +5,7 @@
struct LOCUST_INFO
{
bool on;
PHD_3DPOS pos;
PoseData pos;
ItemInfo* target;
short roomNumber;
short randomRotation;

View file

@ -178,7 +178,7 @@ namespace TEN::Entities::Generic
if (!(Wibble & 7))
TriggerTorchFlame(LaraItem - g_Level.Items.data(), 0);
SoundEffect(SFX_TR4_LOOP_FOR_SMALL_FIRES, (PHD_3DPOS*)&pos);
SoundEffect(SFX_TR4_LOOP_FOR_SMALL_FIRES, (PoseData*)&pos);
}
}

View file

@ -285,7 +285,7 @@ namespace TEN::Entities::TR3
{
if (item->Flags & OCB_FISH_LETAL)
{
PHD_3DPOS pos;
PoseData pos;
pos.Position.x = item->Pose.Position.x + fish->x;
pos.Position.y = item->Pose.Position.y + fish->y;
pos.Position.z = item->Pose.Position.z + fish->z;
@ -401,7 +401,7 @@ namespace TEN::Entities::TR3
}
}
bool FishNearLara(PHD_3DPOS* pos, int distance, ItemInfo* item)
bool FishNearLara(PoseData* pos, int distance, ItemInfo* item)
{
int x = pos->Position.x - item->Pose.Position.x;
int y = abs(pos->Position.y - item->Pose.Position.y);

View file

@ -5,5 +5,5 @@ namespace TEN::Entities::TR3
{
void SetupShoal(int shoalNumber);
void ControlFish(short itemNumber);
bool FishNearLara(PHD_3DPOS* pos, int distance, ItemInfo* item);
bool FishNearLara(PoseData* pos, int distance, ItemInfo* item);
}

View file

@ -12,7 +12,7 @@ namespace TEN::Entities::Vehicles
int LeftVerticalVelocity = 0;
int RightVerticalVelocity = 0;
PHD_3DPOS OldPose = PHD_3DPOS();
PoseData OldPose = PoseData();
unsigned int LeftRightPaddleCount = 0;
int WaterHeight = 0;
bool Turn = false;

View file

@ -976,7 +976,7 @@ namespace TEN::Entities::Vehicles
TriggerRubberBoatMist(prop.x, prop.y, prop.z, abs(rBoatItem->Animation.Velocity.z), rBoatItem->Pose.Orientation.y + 0x8000, 0);
if ((GetRandomControl() & 1) == 0)
{
PHD_3DPOS pos;
PoseData pos;
pos.Position.x = prop.x + (GetRandomControl() & 63) - 32;
pos.Position.y = prop.y + (GetRandomControl() & 15);
pos.Position.z = prop.z + (GetRandomControl() & 63) - 32;

View file

@ -341,7 +341,7 @@ namespace TEN::Entities::Vehicles
if ((GetRandomControl() & 1) == 0)
{
auto pos2 = PHD_3DPOS(
auto pos2 = PoseData(
pos.x + (GetRandomControl() & 63) - 32,
pos.y + UPV_SHIFT,
pos.z + (GetRandomControl() & 63) - 32
@ -675,7 +675,7 @@ namespace TEN::Entities::Vehicles
//sub->Flags &= ~UPV_FLAG_CONTROL; having this here causes the UPV glitch, moving it directly to the states' code is better
StopSoundEffect(SFX_TR3_VEHICLE_UPV_LOOP);
SoundEffect(SFX_TR3_VEHICLE_UPV_STOP, (PHD_3DPOS*)&UPVItem->Pose.Position.x, SoundEnvironment::Always);
SoundEffect(SFX_TR3_VEHICLE_UPV_STOP, (PoseData*)&UPVItem->Pose.Position.x, SoundEnvironment::Always);
}
}
else if (TrInput & VEHICLE_IN_ACCELERATE)
@ -699,7 +699,7 @@ namespace TEN::Entities::Vehicles
UPVItem->Pose.Orientation.x += ANGLE(1.0f);
if (frame == UPV_MOUNT_WATER_SURFACE_SOUND_FRAME)
SoundEffect(SFX_TR3_VEHICLE_UPV_LOOP, (PHD_3DPOS*)&UPVItem->Pose.Position.x, SoundEnvironment::Always);
SoundEffect(SFX_TR3_VEHICLE_UPV_LOOP, (PoseData*)&UPVItem->Pose.Position.x, SoundEnvironment::Always);
if (frame == UPV_MOUNT_WATER_SURFACE_CONTROL_FRAME)
UPV->Flags |= UPV_FLAG_CONTROL;
@ -708,7 +708,7 @@ namespace TEN::Entities::Vehicles
else if (anim == UPV_ANIM_MOUNT_UNDERWATER)
{
if (frame == UPV_MOUNT_UNDERWATER_SOUND_FRAME)
SoundEffect(SFX_TR3_VEHICLE_UPV_LOOP, (PHD_3DPOS*)&UPVItem->Pose.Position.x, SoundEnvironment::Always);
SoundEffect(SFX_TR3_VEHICLE_UPV_LOOP, (PoseData*)&UPVItem->Pose.Position.x, SoundEnvironment::Always);
if (frame == UPV_MOUNT_UNDERWATER_CONTROL_FRAME)
UPV->Flags |= UPV_FLAG_CONTROL;
@ -1007,7 +1007,7 @@ namespace TEN::Entities::Vehicles
DoVehicleCollision(UPVItem, UPV_RADIUS);
if (UPV->Flags & UPV_FLAG_CONTROL)
SoundEffect(SFX_TR3_VEHICLE_UPV_LOOP, (PHD_3DPOS*)&UPVItem->Pose.Position.x, SoundEnvironment::Always, 1.0f + (float)UPVItem->Animation.Velocity.z / 96.0f);
SoundEffect(SFX_TR3_VEHICLE_UPV_LOOP, (PoseData*)&UPVItem->Pose.Position.x, SoundEnvironment::Always, 1.0f + (float)UPVItem->Animation.Velocity.z / 96.0f);
UPVItem->Animation.AnimNumber = Objects[ID_UPV].animIndex + (laraItem->Animation.AnimNumber - Objects[ID_UPV_LARA_ANIMS].animIndex);
UPVItem->Animation.FrameNumber = g_Level.Anims[UPVItem->Animation.AnimNumber].frameBase + (laraItem->Animation.FrameNumber - g_Level.Anims[laraItem->Animation.AnimNumber].frameBase);

View file

@ -109,7 +109,7 @@ namespace TEN::Entities::TR4
BABOON_ANIM_ACTIVATE_SWITCH = 31
};
static void TriggerBaboonShockwave(PHD_3DPOS pos, short xRot)
static void TriggerBaboonShockwave(PoseData pos, short xRot)
{
short shockwaveID = GetFreeShockwave();
if (shockwaveID != NO_ITEM)
@ -132,7 +132,7 @@ namespace TEN::Entities::TR4
void BaboonDieEffect(ItemInfo* item)
{
auto pose = PHD_3DPOS(item->Pose.Position.x, item->Pose.Position.y - CLICK(0.5f), item->Pose.Position.z);
auto pose = PoseData(item->Pose.Position.x, item->Pose.Position.y - CLICK(0.5f), item->Pose.Position.z);
// Trigger shockwave effect.
TriggerBaboonShockwave(pose, ANGLE(0.0f));

View file

@ -7,7 +7,7 @@ namespace TEN::Entities::TR4
struct BaboonRespawnData
{
int ID;
PHD_3DPOS Pose;
PoseData Pose;
unsigned int Count;
unsigned int MaxCount; // Used to limit the number of respawns.
};

View file

@ -5,7 +5,7 @@ namespace TEN::Entities::TR4
{
struct BeetleData
{
PHD_3DPOS Pose;
PoseData Pose;
short RoomNumber;
int Velocity;
int VerticalVelocity;

View file

@ -150,7 +150,7 @@ namespace TEN::Entities::TR4
}
}
void TriggerDemigodMissile(PHD_3DPOS* pose, short roomNumber, int flags)
void TriggerDemigodMissile(PoseData* pose, short roomNumber, int flags)
{
short fxNumber = CreateNewEffect(roomNumber);
if (fxNumber != -1)
@ -196,7 +196,7 @@ namespace TEN::Entities::TR4
GetJointAbsPosition(item, &pos2, 16);
auto angles = GetOrientTowardPoint(pos1.ToVector3(), pos2.ToVector3());
auto pose = PHD_3DPOS(pos1, angles);
auto pose = PoseData(pos1, angles);
if (item->ObjectNumber == ID_DEMIGOD3)
TriggerDemigodMissile(&pose, item->RoomNumber, 3);
else
@ -214,7 +214,7 @@ namespace TEN::Entities::TR4
GetJointAbsPosition(item, &pos2, 16);
auto angles = GetOrientTowardPoint(pos1.ToVector3(), pos2.ToVector3());
auto pose = PHD_3DPOS(pos1, angles);
auto pose = PoseData(pos1, angles);
if (item->ObjectNumber == ID_DEMIGOD3)
TriggerDemigodMissile(&pose, item->RoomNumber, 3);
else
@ -242,7 +242,7 @@ namespace TEN::Entities::TR4
}
auto angles = GetOrientTowardPoint(pos1.ToVector3(), pos2.ToVector3());
auto pose = PHD_3DPOS(pos1, angles);
auto pose = PoseData(pos1, angles);
TriggerDemigodMissile(&pose, item->RoomNumber, 4);
}
}
@ -699,7 +699,7 @@ namespace TEN::Entities::TR4
else
pos.y = height - 128;
TriggerShockwave((PHD_3DPOS*)&pos, 24, 88, 256, 128, 128, 128, 32, 0, 2);
TriggerShockwave((PoseData*)&pos, 24, 88, 256, 128, 128, 128, 32, 0, 2);
TriggerHammerSmoke(pos.x, pos.y + 128, pos.z, 8);
Camera.bounce = -128;

View file

@ -1,13 +1,13 @@
#pragma once
struct Vector3i;
struct PHD_3DPOS;
struct PoseData;
namespace TEN::Entities::TR4
{
void InitialiseDemigod(short itemNumber);
void DemigodControl(short itemNumber);
void TriggerDemigodMissile(PHD_3DPOS* pose, short roomNumber, int flags);
void TriggerDemigodMissile(PoseData* pose, short roomNumber, int flags);
void DoDemigodEffects(short itemNumber);
void TriggerHammerSmoke(int x, int y, int z, int maxSmokeCount);
void TriggerDemigodMissileFlame(short fxNumber, short xVel, short yVel, short zVel);

View file

@ -75,7 +75,7 @@ namespace TEN::Entities::TR4
HARPY_ANIM_GLIDE = 18
};
static void TriggerHarpyMissile(PHD_3DPOS* pose, short roomNumber, short mesh)
static void TriggerHarpyMissile(PoseData* pose, short roomNumber, short mesh)
{
short fxNumber = CreateNewEffect(roomNumber);
if (fxNumber != -1)
@ -229,7 +229,7 @@ namespace TEN::Entities::TR4
GetJointAbsPosition(item, &pos3, HarpyAttack1.meshNum);
auto angles = GetOrientTowardPoint(rh.ToVector3(), lr.ToVector3());
auto pose = PHD_3DPOS(rh, angles);
auto pose = PoseData(rh, angles);
TriggerHarpyMissile(&pose, item->RoomNumber, 2);
}
@ -240,7 +240,7 @@ namespace TEN::Entities::TR4
GetJointAbsPosition(item, &pos3, HarpyAttack2.meshNum);
auto angles = GetOrientTowardPoint(rh.ToVector3(), lr.ToVector3());
auto pose = PHD_3DPOS(rh, angles);
auto pose = PoseData(rh, angles);
TriggerHarpyMissile(&pose, item->RoomNumber, 2);
}
}

View file

@ -63,7 +63,7 @@ namespace TEN::Entities::TR4
C_WEST_NORTH = 315
};
void TriggerCrocgodMissile(PHD_3DPOS* src, short roomNumber, short counter)
void TriggerCrocgodMissile(PoseData* src, short roomNumber, short counter)
{
short fxNumber = NO_ITEM;
@ -139,7 +139,7 @@ namespace TEN::Entities::TR4
sptr->dSize = size / 4;
}
static void ShootFireball(PHD_3DPOS* src, MissileRotationType rotationType, short roomNumber, int timer)
static void ShootFireball(PoseData* src, MissileRotationType rotationType, short roomNumber, int timer)
{
switch (rotationType)
{
@ -189,7 +189,7 @@ namespace TEN::Entities::TR4
headAngle = (short)(phd_atan(z, x) - item->Pose.Orientation.y) / 2;
}
static void GetTargetPosition(ItemInfo* item, PHD_3DPOS* target)
static void GetTargetPosition(ItemInfo* item, PoseData* target)
{
auto start = Vector3i(0, -96, 144);
GetJointAbsPosition(item, &start, 9);
@ -317,7 +317,7 @@ namespace TEN::Entities::TR4
frameNumber = item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase;
if (frameNumber >= 94 && frameNumber <= 96)
{
PHD_3DPOS src;
PoseData src;
GetTargetPosition(item, &src);
if (frameNumber == 94)
@ -346,7 +346,7 @@ namespace TEN::Entities::TR4
case MUTANT_STATE_LOCUST_ATTACK_2:
if (ShootFrame(item))
{
PHD_3DPOS src;
PoseData src;
GetTargetPosition(item, &src);
ShootFireball(&src, MissileRotationType::Front, item->RoomNumber, 1);
}

View file

@ -498,7 +498,7 @@ namespace TEN::Entities::TR4
}
}
void SethaThrowAttack(PHD_3DPOS* pose, short roomNumber, short mesh)
void SethaThrowAttack(PoseData* pose, short roomNumber, short mesh)
{
short fxNumber = CreateNewEffect(roomNumber);
if (fxNumber != -1)
@ -591,7 +591,7 @@ namespace TEN::Entities::TR4
GetJointAbsPosition(item, &pos, SethaAttack1.meshNum);
auto angles = GetOrientTowardPoint(pos1.ToVector3(), pos.ToVector3());
auto attackPose = PHD_3DPOS(pos1, angles);
auto attackPose = PoseData(pos1, angles);
SethaThrowAttack(&attackPose, item->RoomNumber, 0);
}
else if (item->ItemFlags[0] >= 122 && item->ItemFlags[0] <= 125)
@ -601,7 +601,7 @@ namespace TEN::Entities::TR4
GetJointAbsPosition(item, &pos, SethaAttack2.meshNum);
auto angles = GetOrientTowardPoint(pos2.ToVector3(), pos.ToVector3());
auto attackPose = PHD_3DPOS(pos2, angles);
auto attackPose = PoseData(pos2, angles);
SethaThrowAttack(&attackPose, item->RoomNumber, 0);
}
@ -630,7 +630,7 @@ namespace TEN::Entities::TR4
GetJointAbsPosition(item, &pos, SethaAttack1.meshNum);
auto angles = GetOrientTowardPoint(pos1.ToVector3(), pos.ToVector3());
auto attackPose = PHD_3DPOS(pos1, angles);
auto attackPose = PoseData(pos1, angles);
SethaThrowAttack(&attackPose, item->RoomNumber, 0);
pos = Vector3i(SethaAttack2.Position);
@ -638,7 +638,7 @@ namespace TEN::Entities::TR4
GetJointAbsPosition(item, &pos, SethaAttack2.meshNum);
angles = GetOrientTowardPoint(pos2.ToVector3(), pos.ToVector3());
attackPose = PHD_3DPOS(pos2, angles);
attackPose = PoseData(pos2, angles);
SethaThrowAttack(&attackPose, item->RoomNumber, 0);
}
}
@ -701,7 +701,7 @@ namespace TEN::Entities::TR4
GetJointAbsPosition(item, &pos, SethaAttack1.meshNum);
auto angles = GetOrientTowardPoint(pos1.ToVector3(), pos.ToVector3());
auto attackPose = PHD_3DPOS(pos1, angles);
auto attackPose = PoseData(pos1, angles);
SethaThrowAttack(&attackPose, item->RoomNumber, 0);
}

View file

@ -1,6 +1,6 @@
#pragma once
struct PHD_3DPOS;
struct PoseData;
namespace TEN::Entities::TR4
{
@ -8,6 +8,6 @@ namespace TEN::Entities::TR4
void SethaControl(short itemNumber);
void TriggerSethaSparks1(int x, int y, int z, short xv, short yv, short zv);
void TriggerSethaSparks2(short itemNumber, char node, int size);
void SethaThrowAttack(PHD_3DPOS* pose, short roomNumber, short mesh);
void SethaThrowAttack(PoseData* pose, short roomNumber, short mesh);
void SethaAttack(int itemNumber);
}

View file

@ -46,8 +46,8 @@ void ObeliskControl(short itemNumber)
auto* item = &g_Level.Items[itemNumber];
short someNumber;
PHD_3DPOS pos;
PHD_3DPOS pos2;
PoseData pos;
PoseData pos2;
if (TriggerActive(item))
{

View file

@ -25,7 +25,7 @@ namespace TEN::Entities::TR4
{
Vector3i pos;
GetJointAbsPosition(item, &pos, 0);
SoundEffect(SFX_TR4_LIBRARY_COG_LOOP, (PHD_3DPOS*)&pos);
SoundEffect(SFX_TR4_LIBRARY_COG_LOOP, (PoseData*)&pos);
//Shouldnt this be TR4_LIBRARY_COG_LOOP? Changed. Rollback if incorrect. Stranger1992 06/06/22

View file

@ -44,7 +44,7 @@ namespace TEN::Entities::TR4
TriggerExplosionSparks(sphere->x, sphere->y, sphere->z, 3, -2, 0, -item->RoomNumber);
TriggerExplosionSparks(sphere->x, sphere->y, sphere->z, 3, -1, 0, -item->RoomNumber);
TriggerShockwave((PHD_3DPOS*)sphere, 48, 304, (GetRandomControl() & 0x1F) + 112, 0, 96, 128, 32, 2048, 0);
TriggerShockwave((PoseData*)sphere, 48, 304, (GetRandomControl() & 0x1F) + 112, 0, 96, 128, 32, 2048, 0);
}
}

View file

@ -6,7 +6,7 @@ constexpr auto NUM_BATS = 64;
struct BatData
{
bool On;
PHD_3DPOS Pose;
PoseData Pose;
short RoomNumber;
short Velocity;

View file

@ -6,7 +6,7 @@ constexpr auto NUM_RATS = 32;
struct RatData
{
byte On;
PHD_3DPOS Pose;
PoseData Pose;
short RoomNumber;
short Velocity;

View file

@ -6,7 +6,7 @@ constexpr auto NUM_SPIDERS = 64;
struct SpiderData
{
byte On;
PHD_3DPOS Pose;
PoseData Pose;
short RoomNumber;
short Velocity;

View file

@ -52,7 +52,7 @@ namespace TEN::Entities::TR5
item->Pose.Position.x -= CLICK(1);
}
static void HydraBubblesAttack(PHD_3DPOS* pos, short roomNumber, int count)
static void HydraBubblesAttack(PoseData* pos, short roomNumber, int count)
{
short fxNumber = CreateNewEffect(roomNumber);
if (fxNumber != NO_ITEM)
@ -324,7 +324,7 @@ namespace TEN::Entities::TR5
GetJointAbsPosition(item, &pos2, 10);
auto angles = GetOrientTowardPoint(pos2.ToVector3(), pos1.ToVector3());
auto pos = PHD_3DPOS(pos1, angles);
auto pos = PoseData(pos1, angles);
roomNumber = item->RoomNumber;
GetFloor(pos2.x, pos2.y, pos2.z, &roomNumber);

View file

@ -224,7 +224,7 @@ namespace TEN::Entities::TR5
spark->sSize = (spark->size = factor * ((GetRandomControl() & 0x1F) + 64)) / 16;
}
static void RomanStatueAttack(PHD_3DPOS* pos, short roomNumber, short count)
static void RomanStatueAttack(PoseData* pos, short roomNumber, short count)
{
short fxNumber = CreateNewEffect(roomNumber);
@ -593,7 +593,7 @@ namespace TEN::Entities::TR5
if (StaticObjects[mesh->staticNumber].shatterType != SHT_NONE)
{
ShatterObject(0, mesh, -64, LaraItem->RoomNumber, 0);
SoundEffect(GetShatterSound(mesh->staticNumber), (PHD_3DPOS*)mesh);
SoundEffect(GetShatterSound(mesh->staticNumber), (PoseData*)mesh);
mesh->flags &= ~StaticMeshFlags::SM_VISIBLE;
floor->Stopper = false;
@ -627,10 +627,10 @@ namespace TEN::Entities::TR5
if (item->ItemFlags[0])
item->ItemFlags[0]--;
TriggerShockwave((PHD_3DPOS*)&pos1, 16, 160, 96, 0, 64, 128, 48, 0, 1);
TriggerShockwave((PoseData*)&pos1, 16, 160, 96, 0, 64, 128, 48, 0, 1);
TriggerRomanStatueShockwaveAttackSparks(pos1.x, pos1.y, pos1.z, 128, 64, 0, 128);
pos1.y -= 64;
TriggerShockwave((PHD_3DPOS*)&pos1, 16, 160, 64, 0, 64, 128, 48, 0, 1);
TriggerShockwave((PoseData*)&pos1, 16, 160, 64, 0, 64, 128, 48, 0, 1);
}
deltaFrame = item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase;
@ -733,7 +733,7 @@ namespace TEN::Entities::TR5
GetJointAbsPosition(item, &pos2, 14);
auto angles = GetOrientTowardPoint(pos2.ToVector3(), pos1.ToVector3());
auto attackPos = PHD_3DPOS(pos2, angles);
auto attackPos = PoseData(pos2, angles);
short roomNumber = item->RoomNumber;
GetFloor(pos2.x, pos2.y, pos2.z, &roomNumber);

View file

@ -117,9 +117,9 @@ void MissileControl(short itemNumber)
{
TriggerExplosionSparks(x, y, z, 3, -2, 2, fx->roomNumber);
fx->pos.Position.y -= 64;
TriggerShockwave((PHD_3DPOS*)fx, 48, 256, 64, 64, 128, 0, 24, 0, 1);
TriggerShockwave((PoseData*)fx, 48, 256, 64, 64, 128, 0, 24, 0, 1);
fx->pos.Position.y -= 128;
TriggerShockwave((PHD_3DPOS*)fx, 48, 256, 48, 64, 128, 0, 24, 0, 1);
TriggerShockwave((PoseData*)fx, 48, 256, 48, 64, 128, 0, 24, 0, 1);
}
else if (fx->flag1 == 2)
{
@ -130,12 +130,12 @@ void MissileControl(short itemNumber)
else
{
TriggerExplosionSparks(x, y, z, 3, -2, 0, fx->roomNumber);
TriggerShockwave((PHD_3DPOS*)fx, 48, 240, 48, 0, 96, 128, 24, 0, 2);
TriggerShockwave((PoseData*)fx, 48, 240, 48, 0, 96, 128, 24, 0, 2);
}
KillEffect(itemNumber);
}
else if (ItemNearLara((PHD_3DPOS*)fx, 200))
else if (ItemNearLara((PoseData*)fx, 200))
{
if (fx->flag1)
{
@ -144,9 +144,9 @@ void MissileControl(short itemNumber)
// ROMAN_GOD hit effect
TriggerExplosionSparks(x, y, z, 3, -2, 2, fx->roomNumber);
fx->pos.Position.y -= 64;
TriggerShockwave((PHD_3DPOS*)fx, 48, 256, 64, 0, 128, 64, 24, 0, 1);
TriggerShockwave((PoseData*)fx, 48, 256, 64, 0, 128, 64, 24, 0, 1);
fx->pos.Position.y -= 128;
TriggerShockwave((PHD_3DPOS*)fx, 48, 256, 48, 0, 128, 64, 24, 0, 1);
TriggerShockwave((PoseData*)fx, 48, 256, 48, 0, 128, 64, 24, 0, 1);
KillEffect(itemNumber);
DoDamage(LaraItem, 200);
}
@ -169,7 +169,7 @@ void MissileControl(short itemNumber)
{
// HYDRA hit effect
TriggerExplosionSparks(x, y, z, 3, -2, 0, fx->roomNumber);
TriggerShockwave((PHD_3DPOS*)fx, 48, 240, 48, 0, 96, 128, 24, 0, 0);
TriggerShockwave((PoseData*)fx, 48, 240, 48, 0, 96, 128, 24, 0, 0);
if (LaraItem->HitPoints >= 500)
DoDamage(LaraItem, 300);
else

View file

@ -77,7 +77,7 @@ void ExplosionControl(short itemNumber)
for (int i = 0; i < item->ItemFlags[2]; ++i)
TriggerExplosionSparks(item->Pose.Position.x + (GetRandomControl() % 128 - 64) * item->ItemFlags[2], item->Pose.Position.y + (GetRandomControl() % 128 - 64) * item->ItemFlags[2], item->Pose.Position.z + (GetRandomControl() % 128 - 64) * item->ItemFlags[2], 2, 0, i, item->RoomNumber);
PHD_3DPOS pos;
PoseData pos;
pos.Position.x = item->Pose.Position.x;
pos.Position.y = item->Pose.Position.y - 128;
pos.Position.z = item->Pose.Position.z;

View file

@ -219,7 +219,7 @@ namespace TEN::Entities::Vehicles
currentVelocity -= std::copysign(currentVelocity * ((waterDepth / VEHICLE_WATER_HEIGHT_MAX) / coeff), currentVelocity);
if (TEN::Math::Random::GenerateInt(0, 32) > 28)
SoundEffect(SFX_TR4_LARA_WADE, &PHD_3DPOS(vehicleItem->Pose.Position), SoundEnvironment::Land, isWater ? 0.8f : 0.7f);
SoundEffect(SFX_TR4_LARA_WADE, &PoseData(vehicleItem->Pose.Position), SoundEnvironment::Land, isWater ? 0.8f : 0.7f);
if (isWater)
TEN::Effects::TriggerSpeedboatFoam(vehicleItem, Vector3(0, -waterDepth / 2.0f, -radius));

View file

@ -232,7 +232,7 @@ namespace Effects
*/
static void EmitShockwave(Vec3 pos, TypeOrNil<int> innerRadius, TypeOrNil<int> outerRadius, TypeOrNil<ScriptColor> col, TypeOrNil<float> lifetime, TypeOrNil<int> speed, TypeOrNil<int> angle, TypeOrNil<bool> hurtsLara)
{
PHD_3DPOS p;
PoseData p;
p.Position.x = pos.x;
p.Position.y = pos.y;
p.Position.z = pos.z;

View file

@ -122,7 +122,7 @@ namespace Misc
static void PlaySoundEffect(int id, sol::optional<Vec3> p)
{
SoundEffect(id, p.has_value() ? &PHD_3DPOS(p.value().x, p.value().y, p.value().z) : nullptr, SoundEnvironment::Always);
SoundEffect(id, p.has_value() ? &PoseData(p.value().x, p.value().y, p.value().z) : nullptr, SoundEnvironment::Always);
}
static bool KeyIsHeld(int actionIndex)

View file

@ -46,14 +46,14 @@ Rotation::Rotation(int aX, int aY, int aZ)
z = aZ;
}
void Rotation::StoreInPHDPos(PHD_3DPOS& pos) const
void Rotation::StoreInPHDPos(PoseData& pos) const
{
pos.Orientation.x = x;
pos.Orientation.y = y;
pos.Orientation.z = z;
}
Rotation::Rotation(PHD_3DPOS const & pos)
Rotation::Rotation(PoseData const & pos)
{
x = pos.Orientation.x;
y = pos.Orientation.y;

View file

@ -3,7 +3,7 @@
namespace sol {
class state;
}
struct PHD_3DPOS;
struct PoseData;
class Rotation {
public:
@ -13,11 +13,11 @@ public:
Rotation() = default;
Rotation(int x, int y, int z);
Rotation(PHD_3DPOS const& pos);
Rotation(PoseData const& pos);
std::string ToString() const;
void StoreInPHDPos(PHD_3DPOS& pos) const;
void StoreInPHDPos(PoseData& pos) const;
static void Register(sol::table & parent);
};

View file

@ -59,11 +59,11 @@ Vec3::Vec3(int aX, int aY, int aZ) : x{aX}, y{aY}, z{aZ}
{
}
Vec3::Vec3(PHD_3DPOS const& pos) : x{pos.Position.x}, y{pos.Position.y}, z{pos.Position.z}
Vec3::Vec3(PoseData const& pos) : x{pos.Position.x}, y{pos.Position.y}, z{pos.Position.z}
{
}
void Vec3::StoreInPHDPos(PHD_3DPOS& pos) const
void Vec3::StoreInPHDPos(PoseData& pos) const
{
pos.Position.x = x;
pos.Position.y = y;

View file

@ -4,7 +4,7 @@ namespace sol {
class state;
}
struct PHD_3DPOS;
struct PoseData;
struct GameVector;
class Vec3 {
@ -14,12 +14,12 @@ public:
int z;
Vec3(int x, int y, int z);
Vec3(PHD_3DPOS const& pos);
Vec3(PoseData const& pos);
[[nodiscard]] std::string ToString() const;
void ToLength(int newLength);
void StoreInPHDPos(PHD_3DPOS& pos) const;
void StoreInPHDPos(PoseData& pos) const;
void StoreInGameVector(GameVector& vec) const;
static void Register(sol::table &);

View file

@ -140,7 +140,7 @@ bool LoadSample(char *pointer, int compSize, int uncompSize, int index)
return true;
}
bool SoundEffect(int effectID, PHD_3DPOS* position, SoundEnvironment condition, float pitchMultiplier, float gainMultiplier)
bool SoundEffect(int effectID, PoseData* position, SoundEnvironment condition, float pitchMultiplier, float gainMultiplier)
{
if (!g_Configuration.EnableSound)
return false;
@ -594,7 +594,7 @@ int Sound_GetFreeSlot()
// We use origin position as a reference, because in original TRs it's not possible to clearly
// identify what's the source of the producing effect.
int Sound_EffectIsPlaying(int effectID, PHD_3DPOS *position)
int Sound_EffectIsPlaying(int effectID, PoseData *position)
{
for (int i = 0; i < SOUND_MAX_CHANNELS; i++)
{
@ -627,7 +627,7 @@ int Sound_EffectIsPlaying(int effectID, PHD_3DPOS *position)
// Gets the distance to the source.
float Sound_DistanceToListener(PHD_3DPOS *position)
float Sound_DistanceToListener(PoseData *position)
{
if (!position) return 0.0f; // Assume sound is 2D menu sound
return Sound_DistanceToListener(Vector3(position->Position.x, position->Position.y, position->Position.z));
@ -668,7 +668,7 @@ void Sound_FreeSlot(int index, unsigned int fadeout)
// Update sound position in a level.
bool Sound_UpdateEffectPosition(int index, PHD_3DPOS *position, bool force)
bool Sound_UpdateEffectPosition(int index, PoseData *position, bool force)
{
if (index > SOUND_MAX_CHANNELS || index < 0)
return false;
@ -921,6 +921,6 @@ void PlaySoundSources()
else if (FlipStats[group] && (sound->flags & 128) == 0)
continue;
SoundEffect(sound->soundId, (PHD_3DPOS*)&sound->x);
SoundEffect(sound->soundId, (PoseData*)&sound->x);
}
}

View file

@ -111,7 +111,7 @@ extern std::map<std::string, int> SoundTrackMap;
extern std::unordered_map<int, SoundTrackInfo> SoundTracks;
extern int SecretSoundIndex;
bool SoundEffect(int effectID, PHD_3DPOS* position, SoundEnvironment condition = SoundEnvironment::Land, float pitchMultiplier = 1.0f, float gainMultiplier = 1.0f);
bool SoundEffect(int effectID, PoseData* position, SoundEnvironment condition = SoundEnvironment::Land, float pitchMultiplier = 1.0f, float gainMultiplier = 1.0f);
void StopSoundEffect(short effectID);
bool LoadSample(char *buffer, int compSize, int uncompSize, int currentIndex);
void FreeSamples();
@ -144,9 +144,9 @@ void Sound_UpdateScene();
void Sound_FreeSample(int index);
int Sound_GetFreeSlot();
void Sound_FreeSlot(int index, unsigned int fadeout = 0);
int Sound_EffectIsPlaying(int effectID, PHD_3DPOS *position);
float Sound_DistanceToListener(PHD_3DPOS *position);
int Sound_EffectIsPlaying(int effectID, PoseData *position);
float Sound_DistanceToListener(PoseData *position);
float Sound_DistanceToListener(Vector3 position);
float Sound_Attenuate(float gain, float distance, float radius);
bool Sound_UpdateEffectPosition(int index, PHD_3DPOS *position, bool force = false);
bool Sound_UpdateEffectPosition(int index, PoseData *position, bool force = false);
bool Sound_UpdateEffectAttributes(int index, float pitch, float gain);

View file

@ -190,7 +190,7 @@ void LoadItems()
g_GameScriptEntities->AddName(item->LuaName, i);
g_GameScriptEntities->TryAddColliding(i);
memcpy(&item->StartPose, &item->Pose, sizeof(PHD_3DPOS));
memcpy(&item->StartPose, &item->Pose, sizeof(PoseData));
}
for (int i = 0; i < g_Level.NumItems; i++)

View file

@ -54,7 +54,7 @@ struct AI_OBJECT
{
GAME_OBJECT_ID objectNumber;
short roomNumber;
PHD_3DPOS pos;
PoseData pos;
short triggerFlags;
short flags;
int boxNumber;

View file

@ -1,7 +1,7 @@
#include "framework.h"
#include "Specific/phd_global.h"
BOUNDING_BOX operator+(const BOUNDING_BOX& box, const PHD_3DPOS& vec)
BOUNDING_BOX operator+(const BOUNDING_BOX& box, const PoseData& vec)
{
BOUNDING_BOX box2 = box;
box2.X1 += vec.Position.x;

View file

@ -229,5 +229,5 @@ struct BOUNDING_BOX
int Height() { return abs(Y2 - Y1); }
};
BOUNDING_BOX operator+(const BOUNDING_BOX& box, const PHD_3DPOS& vec);
BOUNDING_BOX operator+(const BOUNDING_BOX& box, const PoseData& vec);
BOUNDING_BOX operator*(const BOUNDING_BOX& box, const float scale);

View file

@ -71,7 +71,7 @@ int phd_atan(int x, int y)
return FROM_RAD(atan2(y, x));
}
void phd_RotBoundingBoxNoPersp(PHD_3DPOS* pos, BOUNDING_BOX* bounds, BOUNDING_BOX* tbounds)
void phd_RotBoundingBoxNoPersp(PoseData* pos, BOUNDING_BOX* bounds, BOUNDING_BOX* tbounds)
{
auto world = Matrix::CreateFromYawPitchRoll(
TO_RAD(pos->Orientation.y),
@ -151,7 +151,7 @@ void GetMatrixFromTrAngle(Matrix* matrix, short* framePtr, int index)
}
}
BoundingOrientedBox TO_DX_BBOX(PHD_3DPOS pos, BOUNDING_BOX* box)
BoundingOrientedBox TO_DX_BBOX(PoseData pos, BOUNDING_BOX* box)
{
auto boxCentre = Vector3((box->X2 + box->X1) / 2.0f, (box->Y2 + box->Y1) / 2.0f, (box->Z2 + box->Z1) / 2.0f);
auto boxExtent = Vector3((box->X2 - box->X1) / 2.0f, (box->Y2 - box->Y1) / 2.0f, (box->Z2 - box->Z1) / 2.0f);

View file

@ -29,7 +29,7 @@ short FROM_RAD(float angle);
float TO_DEGREES(short angle);
float TO_RAD(short angle);
BoundingOrientedBox TO_DX_BBOX(PHD_3DPOS pos, BOUNDING_BOX* box);
BoundingOrientedBox TO_DX_BBOX(PoseData pos, BOUNDING_BOX* box);
float phd_sin(short a);
float phd_cos(short a);
@ -38,7 +38,7 @@ const Vector3 GetRandomVector();
const Vector3 GetRandomVectorInCone(const Vector3& direction,const float angleDegrees);
int mGetAngle(int x1, int y1, int x2, int y2);
int phd_atan(int dz, int dx);
void phd_RotBoundingBoxNoPersp(PHD_3DPOS* pos, BOUNDING_BOX* bounds, BOUNDING_BOX* tbounds);
void phd_RotBoundingBoxNoPersp(PoseData* pos, BOUNDING_BOX* bounds, BOUNDING_BOX* tbounds);
void InterpolateAngle(short angle, short* rotation, short* outAngle, int shift);
void GetMatrixFromTrAngle(Matrix* matrix, short* framePtr, int index);