26 use GetTypeIdFromConstTrait;
28 public const ID = PrimitiveShapeType::PAYLOAD_TYPE_ARROW;
30 public function __construct(
31 private ?
Vector3 $lineEndLocation,
32 private ?
float $arrowHeadLength,
33 private ?
float $arrowHeadRadius,
34 private ?
int $segments,
37 public function getLineEndLocation() : ?
Vector3{
return $this->lineEndLocation; }
39 public function getArrowHeadLength() : ?
float{
return $this->arrowHeadLength; }
41 public function getArrowHeadRadius() : ?
float{
return $this->arrowHeadRadius; }
43 public function getSegments() : ?
int{
return $this->segments; }
45 public static function read(ByteBufferReader $in) :
self{
46 $lineEndLocation = CommonTypes::readOptional($in, CommonTypes::getVector3(...));
47 $arrowHeadLength = CommonTypes::readOptional($in, LE::readFloat(...));
48 $arrowHeadRadius = CommonTypes::readOptional($in, LE::readFloat(...));
49 $segments = CommonTypes::readOptional($in, Byte::readUnsigned(...));
59 public function write(ByteBufferWriter $out) :
void{
60 CommonTypes::writeOptional($out, $this->lineEndLocation, CommonTypes::putVector3(...));
61 CommonTypes::writeOptional($out, $this->arrowHeadLength, LE::writeFloat(...));
62 CommonTypes::writeOptional($out, $this->arrowHeadRadius, LE::writeFloat(...));
63 CommonTypes::writeOptional($out, $this->segments, Byte::writeUnsigned(...));