-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement API for new camera features #5832
base: minor-next
Are you sure you want to change the base?
Conversation
Missing camera set
- Fix fade color not being played correctyl (blame microsoft) - Fix rotation not being encoded correctly
@@ -2095,6 +2096,10 @@ public function sendToastNotification(string $title, string $body) : void{ | |||
$this->getNetworkSession()->onToastNotification($title, $body); | |||
} | |||
|
|||
public function sendCameraInstruction(CameraInstruction ...$instructions) : void{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sendCameraInstructions()
would more fit according to the parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put it this way because most of the time only a single instruction is sent
@@ -1152,6 +1169,15 @@ public function onToastNotification(string $title, string $body) : void{ | |||
$this->sendDataPacket(ToastRequestPacket::create($title, $body)); | |||
} | |||
|
|||
public function onCameraInstruction(CameraInstruction ...$instructions) : void{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sendCameraInstructions()
would more fit according to the parameter.
interface CameraInstruction{ | ||
|
||
/** | ||
* Writes this instriction in a CompoundTag in order to be sent to the client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Writes this instriction in a CompoundTag in order to be sent to the client. | |
* Writes this instruction in a CompoundTag in order to be sent to the client. |
|
||
public function __construct( | ||
private CameraEaseType $type, | ||
private float $duration //in seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should put the comment in phpdoc? Maybe at the getDuration function too?
I don't this should be merged unless these features become non-experimental. Until they stabilize, we can't introduce API for them. |
They're now non-experimental since 1.20.30. |
This PR isn't updated to the latest changes in 1.20.30, I will convert it to a draft until this is fixed. |
To help you, I corrected the packet, now has work : pmmp/BedrockProtocol#198 |
What's blocking the progress on this? Anything i can do to advance it? |
The PR is stale and the camera system it's still on "early" development, it gets changes almost every new protocol version. |
This PR has been marked as "Waiting on Author", but we haven't seen any activity in 7 days. If there is no further activity, it will be closed in 28 days. Note for maintainers: Adding an assignee to the PR will prevent it from being marked as stale. |
Introduction
Implement an appropriate API for this to make it easier for developers to use these new features and create fabulous cinematics.
Changes
API changes
pocketmine\data\bedrock\CameraEaseTypeIdMap
pocketmine\player\camera\CameraEaseType
pocketmine\player\camera\CameraPreset
pocketmine\player\camera\CameraPresetFactory
pocketmine\player\camera\VanillaCameraPresets
pocketmine\player\camera\element\CameraEase
pocketmine\player\camera\element\CameraState
pocketmine\player\camera\instruction\ClearCameraInstruction
pocketmine\player\camera\instruction\FadeCameraInstruction
pocketmine\player\camera\instruction\SetCameraInstruction
public Player->sendCameraInstruction(CameraInstruction ...$instructions) : void
Behavioural changes
CameraPresetsPacket
during PreSpawnLevelSettings
&ResourcePackStackPacket
Follow-up
Tests
The following tests can be found int the plugin:
/camera cinematic
- a basic cinematic that follows the player/camera multiple
- a test that sends two instuctions in a single packet/camera clear
- returns the player's camera back to normal/camera fade [r] [g] [b] [fadeInSeconds] [holdSeconds] [fadeOutSeconds]
- allows fade the camera/camera set <preset> [x] [y] [z] [yaw] [pitch] [easeType] [easeDuration]
- allows test presets