
Image showing the Phantom Camera component, as seen in the Entity Inspector.
Phantom Camera Overview
Phantom Cameras are the powerful force behind the PhantomCam system, hence its naming. Phantom Cameras represent Cameras, their states, settings, and advanced behaviour.
When a Phantom Cam takes dominance through it’s priority hitting the top of other Phantom Cameras, the MainCamera blends to it based on Blend Settings. The phantom camera itself drives complex behaviour, like orbit inputs, tracking and lookat settings, damping, screen shake, and more.
The robust library of Phantom Camera Types should be able to satisfy most Cinematic and Camera needs.
Functionality
Using Phantom Cameras
For initial startup instructions refer to the PhantomCam Set Up Guide in Get Started section.
Any number of Phantom Cameras can be created and exist in any part of the game state. They will all be connected to the system and be available for blending, priority filtration, and everything else.
To bring a particular phantom cam to become the desired camera, you can affect it or neighbouring cameras in a few ways.
- You can change the desired phantom cam priority to be above the rest of the cameras. Say priority: 100.
- You can change the neighbouring phantom cameras priority to fall below the desired phantom cam. Say reducing neighbours priority to 5, because the desired camera priority is 10.
- You can call Disable Camera on the current dominant camera. This drops it to 0 while it’s disabled. If your desired camera is the next in line, it will then take over.
- You can call Enable Camera on your desired camera, while it has a higher than the rest priority. Say your desired cam has priority 100, but is disabled, leaving it at 0. When you enable it, it’ll take priority.
Blending
API
// CamManagerOutgoingEventBus
void HandleStartup() override;
// PhantomCameraIncomingEventBus
void EnableCamera() override;
void DisableCamera() override;
void SetCameraPriority(AZ::s32 newPriority) override;
AZ::s32 GetCameraPriority() override { return priority; };
void SetCameraTarget(AZ::EntityId targetEntity) override;
void SetTargetFocusGroup(AZ::EntityId targetFocusGroup) override;
const PhantomCamData* GetCameraData() override { return &camData; };
// Local Methods
virtual void StartupCheck();
virtual void EvaluateCamTick();
//Follow
virtual void ProcessTransformFollow(AZ::Vector3& desiredPos, float deltaTime);
virtual void ProcessPhysicsFollow(float deltaTime);
virtual void ProcessFollowOffset(AZ::Vector3& destFollowPos, AZ::Transform destWorldTMFollow);
//LookAt
virtual void ProcessTransformLookAt(AZ::Quaternion& desiredRot, AZ::Transform curWorldTM, float deltaTime);
virtual void ProcessPhysicsLookAt(float deltaTime);
virtual void ProcessLookAtOffset(AZ::Vector3& destLookPos, AZ::Transform curWorldTM, AZ::Transform destWorldTMLook);
