-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
194 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
namespace RE | ||
{ | ||
class InputEvent; | ||
|
||
class BSInputEventReceiver | ||
{ | ||
public: | ||
virtual ~BSInputEventReceiver() = default; // 00 | ||
|
||
// add | ||
virtual void PerformInputProcessing(const InputEvent* a_queueHead) = 0; // 01 | ||
|
||
// members | ||
std::uint32_t currInputTimeCount; // 08 | ||
}; | ||
static_assert(sizeof(BSInputEventReceiver) == 0x10); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#pragma once | ||
|
||
#include "RE/B/BSInputEventReceiver.h" | ||
#include "RE/B/BSTEvent.h" | ||
#include "RE/T/TESCamera.h" | ||
|
||
namespace RE | ||
{ | ||
class BSWorldOriginShiftEvent; | ||
class OtherEventEnabledEvent; | ||
class UserEventEnabledEvent; | ||
struct IdleInputEvent; | ||
|
||
namespace Spaceship | ||
{ | ||
struct TakeOffEvent; | ||
struct DockEvent; | ||
struct LandedSetEvent; | ||
} | ||
|
||
struct CameraStates | ||
{ | ||
enum CameraState : std::uint32_t | ||
{ | ||
kFirstPerson = 0, | ||
kAutoVanity, | ||
kVATS, | ||
kIronSights, | ||
kPCTransition, | ||
kTween, | ||
kUnk06, | ||
kFlightCamera, | ||
kShipFarTravel, | ||
kShipAction, | ||
kShipTargeting, | ||
kShipCombatOrbit, | ||
kFreeWalk, | ||
kFreeAdvanced, | ||
kFreeFly, | ||
kFreeTethered, | ||
kDialogue, | ||
kWorkshopIsometric, | ||
kPhotoMode, | ||
kThirdPerson, | ||
kFurniture, | ||
kHorse, | ||
kBleedout | ||
}; | ||
}; | ||
using CameraState = CameraStates::CameraState; | ||
|
||
class PlayerCamera : | ||
public TESCamera, // 00 | ||
public BSInputEventReceiver, // 48 | ||
public BSTEventSink<IdleInputEvent>, // 58 | ||
public BSTEventSink<UserEventEnabledEvent>, // 60 | ||
public BSTEventSink<OtherEventEnabledEvent>, // 68 | ||
public BSTEventSink<Spaceship::TakeOffEvent>, // 70 | ||
public BSTEventSink<Spaceship::DockEvent>, // 78 | ||
public BSTEventSink<Spaceship::LandedSetEvent>, // 80 | ||
public BSTEventSink<BSWorldOriginShiftEvent> // 88 | ||
{ | ||
public: | ||
SF_RTTI_VTABLE(PlayerCamera); | ||
|
||
~PlayerCamera() override; // 00 | ||
|
||
// override (TESCamera) | ||
void SetCameraRoot(NiNode* a_root) override; // 01 | ||
void SetEnabled(bool a_enabled) override; // 02 | ||
void Unk_04() override; // 04 | ||
|
||
static PlayerCamera* GetSingleton(); | ||
|
||
void ForceFirstPerson(); | ||
void ForceThirdPerson(); | ||
bool IsInFirstPerson() const; | ||
bool IsInThirdPerson() const; | ||
void SetCameraState(CameraState a_cameraState); | ||
|
||
// More... | ||
|
||
private: | ||
bool QCameraEquals(CameraState a_cameraState) const; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#pragma once | ||
|
||
namespace RE | ||
{ | ||
class NiNode; | ||
|
||
class TESCamera | ||
{ | ||
public: | ||
SF_RTTI(TESCamera); | ||
|
||
virtual ~TESCamera(); // 00 | ||
|
||
// add | ||
virtual void SetCameraRoot(NiNode* a_cameraRoot); // 01 | ||
virtual void SetEnabled(bool a_enabled); // 02 | ||
virtual void Update(); // 03 | ||
virtual void Unk_04(); // 04 | ||
|
||
// members | ||
void* cameraRoot; // 08 - NiPointer<NiNode> | ||
void* currentState; // 10 - BSTSmartPointer<TESCameraState> | ||
std::uint64_t unk18; // 18 | ||
bool enabled; // 20 | ||
float unk24; // 24 | ||
float unk28; // 28 | ||
float unk2C; // 2C | ||
float unk30; // 30 | ||
float unk34; // 34 | ||
float unk38; // 38 | ||
float unk3C; // 3C | ||
float unk40; // 40 | ||
std::uint32_t pad44; // 44 | ||
}; | ||
static_assert(sizeof(TESCamera) == 0x48); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "RE/P/PlayerCamera.h" | ||
|
||
namespace RE | ||
{ | ||
PlayerCamera* PlayerCamera::GetSingleton() | ||
{ | ||
REL::Relocation<PlayerCamera**> singleton{ REL::Offset(0x058F1978) }; | ||
return *singleton; | ||
} | ||
|
||
void PlayerCamera::ForceFirstPerson() | ||
{ | ||
using func_t = decltype(&PlayerCamera::ForceFirstPerson); | ||
REL::Relocation<func_t> func{ REL::Offset(0x0286A798) }; | ||
return func(this); | ||
} | ||
|
||
void PlayerCamera::ForceThirdPerson() | ||
{ | ||
using func_t = decltype(&PlayerCamera::ForceThirdPerson); | ||
REL::Relocation<func_t> func{ REL::Offset(0x0286A850) }; | ||
return func(this); | ||
} | ||
|
||
bool PlayerCamera::IsInFirstPerson() const | ||
{ | ||
return QCameraEquals(CameraState::kFirstPerson); | ||
} | ||
|
||
bool PlayerCamera::IsInThirdPerson() const | ||
{ | ||
return QCameraEquals(CameraState::kThirdPerson); | ||
} | ||
|
||
void PlayerCamera::SetCameraState(CameraState a_cameraState) | ||
{ | ||
using func_t = decltype(&PlayerCamera::SetCameraState); | ||
REL::Relocation<func_t> func{ REL::Offset(0x0286BCBC) }; | ||
return func(this, a_cameraState); | ||
} | ||
|
||
bool PlayerCamera::QCameraEquals(CameraState a_cameraState) const | ||
{ | ||
using func_t = decltype(&PlayerCamera::QCameraEquals); | ||
REL::Relocation<func_t> func{ REL::Offset(0x0286BDC8) }; | ||
return func(this, a_cameraState); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "RE/T/TESCamera.h" | ||
namespace RE | ||
{ | ||
} | ||
|