Class SFS2X.Entities.Data.Vec3D

The position in a 2D or 3D space.

Class Summary
Constructor Attributes Constructor Name and Description
 
Creates a new Vec3D instance.

Field Summary

Method Summary

Class Detail

SFS2X.Entities.Data.Vec3D(px, py, pz)
Creates a new Vec3D instance. 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. Although JavaScript doesn't make a clear distinction between these types, SmartFoxServer 2X does. For this reason it is important to make sure to stick with 32-bit signed integers or floating point values. Long and Doubles are not supported on the server side.

The position along the Z axis is optional, for 2D environments.

Parameters:
{Number} px
The position along the X axis.
{Number} py
The position along the Y axis.
{Number} pz Optional, Default: 0
The position along the Z axis.

Field Detail

{Number} px
Returns the position along the X axis.
{Number} py
Returns the position along the Y axis.
{Number} pz
Returns the position along the Z axis.

Method Detail

  • {Boolean} isFloat()
    Indicates whether the position is expressed using floating point values or not.
    Returns:
    {Boolean} true if the position is expressed using floating point values.