class
cCameraManagerThe implementation of ICameraManager; this should only be used for extending and detouring.
Base classes
- class ICameraManager
- This manager handles the cameras in the game.
- class IVirtual
- A default interface that provides a virtual destructor, it should only be used internally.
Constructors, destructors, conversion operators
Public functions
-
auto HandleMessage(uint32_
t messageID, void* msg) -> bool override - Called every time a message is received.
- auto AddRef() -> int override
- auto Release() -> int override
- auto Initialize(const char* pCheatName) -> bool override
- auto Dispose() -> bool override
- auto SetViewer(cViewer* pViewer) -> void override
- Sets the Viewer that will receive the results of the camera in this camera manager.
- auto GetViewer() -> cViewer* override
- Gets the Viewer that will receive the results of the camera in this camera manager.
-
auto AddCameraType(uint32_
t typeID, CameraFactoryFunction_ t function) -> void override - Adds a new camera type.
-
auto PutCamera(uint32_
t cameraID, ICamera* pCamera, const char16_ t* pName) -> void override - Adds a new camera into this manager.
- auto ParseCameras() -> void override
- Reads and stores in this manager all the cameras in the 0x40410100 (camera_properties~) folder.
- auto Update(int nDeltaTime) -> void override
- A method called every game loop that updates the active camera.
-
auto SetActiveCameraByKey(const char16_
t* pKeyString) -> bool override - Sets the active camera to the one that matches the given key eastl::string.
-
auto SetActiveCameraByID(uint32_
t cameraID) -> bool override - Sets the active camera to the one mapped to the given ID.
- auto GetActiveCamera() -> ICamera* override
- Returns the currently active camera, or nullptr if there is no active camera.
-
auto GetActiveCameraID() -> uint32_
t override - Returns the ID mapped to the currently active camera, or 0 if there is no active camera.
-
auto GetCamera(uint32_
t cameraID) -> ICamera* override - Returns the ICamera mapped to the given ID, or nullptr if there is no camera mapped to that ID.
-
auto GetCameraID(const char* pName) -> uint32_
t override - Returns the ID of the camera mapped to the given name, or 0 if there is no ID mapped to that name.
-
auto GetCamerasCount() -> size_
t override - Returns the number of cameras contained in this manager.
- auto GetCameraAt(int nIndex) -> ICamera* override
- Returns the ICamera at the given index, or nullptr if the index is not valid.
-
auto GetCameraIDAt(int nIndex) -> uint32_
t override - Returns the camera ID at the given index, or nullptr if the index is not valid.
- auto SetActiveCamera(int nIndex) -> bool override
- Sets the active camera of this manager, which will be used to calculate all the view transformations used for rendering, and that will receive all the input events.
- auto GetActiveCameraIndex() -> int override
- Returns the index of the currently active camera, or -1 if there is no active camera.
- auto RemoveCameras() -> void override
- Removes all the cameras and their mappings from this manager.
Public variables
- int mnRefCount
- bool field_0C
- eastl::string mCheatKeyword
- eastl::hash_map<eastl::string16, int> field_20
-
eastl::hash_map<uint32_
t, CameraFactoryFunction_ t> mTypeFactories -
eastl::hash_map<uint32_
t, size_ t> mCameraIndices - eastl::vector<ICameraPtr> mpCameras
- eastl::vector<eastl::string16> mCameraNames
- int mnActiveIndex
- int field_AC
- cViewer* mpViewer
Function documentation
bool App:: cCameraManager:: HandleMessage(uint32_ t messageID,
void* msg) override
Called every time a message is received.
Parameters | |
---|---|
messageID | The ID of the message received. |
msg | The data of the message received, it might be nullptr. |
Returns | Whether the message was handled or not. |
Only the messages with an ID this listener signed up for will call this event.
void App:: cCameraManager:: AddCameraType(uint32_ t typeID,
CameraFactoryFunction_ t function) override
Adds a new camera type.
Parameters | |
---|---|
typeID | The ID that identifies this type of camera. |
function | A function that takes a App:: |
When a camera settings .prop file uses the 'cameraType' property with this typeID value, the given factory function will be called to create a new ICamera.
void App:: cCameraManager:: PutCamera(uint32_ t cameraID,
ICamera* pCamera,
const char16_ t* pName) override
Adds a new camera into this manager.
Parameters | |
---|---|
cameraID | The ID that uniquely identifices the camera. |
pCamera | The new ICamera. |
pName | [Optional] A eastl::string that identifies the camera. |
The camera will be mapped to the given cameraID and ICamera::
A name can also be optionally specified.
void App:: cCameraManager:: Update(int nDeltaTime) override
A method called every game loop that updates the active camera.
Parameters | |
---|---|
nDeltaTime | The time ellapsed since the last call, in milliseconds. |
This will call the ICamera::
bool App:: cCameraManager:: SetActiveCameraByKey(const char16_ t* pKeyString) override
Sets the active camera to the one that matches the given key eastl::string.
Parameters | |
---|---|
pKeyString | The eastl::string representation of a ResourceKey. |
Returns | True if the active camera was changed, false otherwise. |
Only the instance ID will be used, the rest will be ignored. The eastl::string will be parsed using ResourceKey::
bool App:: cCameraManager:: SetActiveCameraByID(uint32_ t cameraID) override
Sets the active camera to the one mapped to the given ID.
Parameters | |
---|---|
cameraID | The ID of the new active camera. |
Returns | True if the active camera was changed, false otherwise. |
If the ID is not mapped, nothing will happen. This will call SetActiveCamera(size_t)
uint32_ t App:: cCameraManager:: GetCameraID(const char* pName) override
Returns the ID of the camera mapped to the given name, or 0 if there is no ID mapped to that name.
Parameters | |
---|---|
pName | A char c-eastlstring. |
ICamera* App:: cCameraManager:: GetCameraAt(int nIndex) override
Returns the ICamera at the given index, or nullptr if the index is not valid.
Parameters | |
---|---|
nIndex |
uint32_ t App:: cCameraManager:: GetCameraIDAt(int nIndex) override
Returns the camera ID at the given index, or nullptr if the index is not valid.
Parameters | |
---|---|
nIndex |
bool App:: cCameraManager:: SetActiveCamera(int nIndex) override
Sets the active camera of this manager, which will be used to calculate all the view transformations used for rendering, and that will receive all the input events.
Parameters | |
---|---|
nIndex | The index of the new active camera. |
Returns | True if the active camera changed, false otherwise. |
ICamera::