36 private float $totalTime,
37 private int $easeType,
39 private array $progressKeyFrames,
40 private array $rotationOptions,
43 public function getTotalTime() : float{ return $this->totalTime; }
48 public function getEaseType() : int{ return $this->easeType; }
53 public function getCurve() : array{ return $this->curve; }
65 public static function read(ByteBufferReader $in) : self{
66 $totalTime = LE::readFloat($in);
67 $easeType = Byte::readUnsigned($in);
70 $curveCount = VarInt::readUnsignedInt($in);
71 for($i = 0; $i < $curveCount; ++$i){
72 $curve[] = CommonTypes::getVector3($in);
75 $progressKeyFrames = [];
76 $progressKeyFrameCount = VarInt::readUnsignedInt($in);
77 for($i = 0; $i < $progressKeyFrameCount; ++$i){
78 $progressKeyFrames[] = CameraProgressOption::read($in);
81 $rotationOptions = [];
82 $rotationOptionCount = VarInt::readUnsignedInt($in);
83 for($i = 0; $i < $rotationOptionCount; ++$i){
84 $rotationOptions[] = CameraRotationOption::read($in);
87 return new self($totalTime, $easeType, $curve, $progressKeyFrames, $rotationOptions);
90 public function write(ByteBufferWriter $out) : void{
91 LE::writeFloat($out, $this->totalTime);
92 Byte::writeUnsigned($out, $this->easeType);
94 VarInt::writeUnsignedInt($out, count($this->curve));
95 foreach($this->curve as $point){
96 CommonTypes::putVector3($out, $point);
99 VarInt::writeUnsignedInt($out, count($this->progressKeyFrames));
100 foreach($this->progressKeyFrames as $keyFrame){
101 $keyFrame->write($out);
104 VarInt::writeUnsignedInt($out, count($this->rotationOptions));
105 foreach($this->rotationOptions as $option){
106 $option->write($out);