26 use GetTypeIdFromConstTrait;
28 public const ID = PrimitiveShapeType::PAYLOAD_TYPE_CONE;
30 public function __construct(
32 private float $height,
33 private int $segments,
36 public function getRadii() :
Vector2{
return $this->radii; }
38 public function getHeight() :
float{
return $this->height; }
40 public function getSegments() :
int{
return $this->segments; }
42 public static function read(ByteBufferReader $in) :
self{
43 $radii = CommonTypes::getVector2($in);
44 $height = LE::readFloat($in);
45 $segments = Byte::readUnsigned($in);
47 return new self($radii, $height, $segments);
50 public function write(ByteBufferWriter $out) :
void{
51 CommonTypes::putVector2($out, $this->radii);
52 LE::writeFloat($out, $this->height);
53 Byte::writeUnsigned($out, $this->segments);