Packagecom.smartfoxserver.v2.entities.data
Classpublic class Vec3D
InheritanceVec3D Inheritance Object

The Vec3D object represents a position in a 2D or 3D space. This class is used to express a position inside a virtual environment with no specific unit of measure (could be pixels, feet, meters, etc).

Positions along the X,Y,Z axes can be expressed as Integers or Floats. Due to the fact that ActionScript 3 doesn't make a clear distinction between these types, while SmartFoxServer 2X does, it is necessary to declare what type will be used by means of the useFloatCoordinates static field.Long and Doubles are not supported on the server side.



Public Properties
 PropertyDefined By
  px : Number
[read-only] Returns the position along the X axis.
Vec3D
  py : Number
[read-only] Returns the position along the Y axis.
Vec3D
  pz : Number
[read-only] Returns the position along the Z axis.
Vec3D
  useFloatCoordinates : Boolean = false
[static] Forces the API to send all Vec3D instances as floating point coordinates.
Vec3D
Public Methods
 MethodDefined By
  
Vec3D(px:Number, py:Number, pz:Number = 0)
Creates a new Vec3D instance.
Vec3D
Property Detail
pxproperty
px:Number  [read-only]

Returns the position along the X axis.


Implementation
    public function get px():Number
pyproperty 
py:Number  [read-only]

Returns the position along the Y axis.


Implementation
    public function get py():Number
pzproperty 
pz:Number  [read-only]

Returns the position along the Z axis.


Implementation
    public function get pz():Number
useFloatCoordinatesproperty 
public static var useFloatCoordinates:Boolean = false

Forces the API to send all Vec3D instances as floating point coordinates. This should be set in the application before the first MMORoom is created or joined.

Constructor Detail
Vec3D()Constructor
public function Vec3D(px:Number, py:Number, pz:Number = 0)

Creates a new Vec3D instance. The position along the Z axis is optional for 2D environments.

Parameters
px:Number — The position along the X axis.
 
py:Number — The position along the Y axis.
 
pz:Number (default = 0) — The position along the Z axis (optional).