Name

SPVM::Point3D - Point 3D

Usage

  use Point3D;
  
  my $point = Point3D->new;
  my $point = Point3D->new(1, 2, 3);

  $point->set_x(1);
  $point->set_y(2);
  $point->set_z(3);
  
  my $x = $point->x;
  my $y = $point->y;
  my $z = $point->z;
  
  my $point_string = $point->to_string;

Description

Point3D is a class for a point 3D.

Super Class

Point is the super class of Point3D.

Interfaces

Point3D inherits the interfaces of Point.

Fields

Point3D inherits the fields of Point.

z

  has z : rw protected int;

z.

Class Methods

new

  static method new : Point3D ($x = 0 : int, $y = 0 : int, $z = 0 : int);

Creates a new Point3D object with $x, $y, $z.

Instance Methods

Point3D inherits the instance methods of Point.

init

  protected method init : Point3D ($x = 0 : int, $y = 0 : int, $z = 0 : int)

Initializes "x", "y", and "z".

clear

  method clear : void ();

Sets x, y, and "z" to 0.

clone

  method clone : Point3D ();

Creates a new Point3D object that clones myself.

to_string

  method to_string : string ();

Stringifies the Point3D object as the following format.

  (1,2,3)