SmartFoxServer 2X C++ API
Sfs2X::Entities::Data::Vec3D Class Reference

The Vec3D object represents a position in a 2D or 3D space. More...

#include <Vec3D.h>

Public Member Functions

 Vec3D (long int px, long int py, long int pz)
 Creates a new Vec3D instance for a 3D coordinates system with integer values. More...
 
 Vec3D (long int px, long int py)
 Creates a new Vec3D instance for a 2D coordinates system with integer values. More...
 
 Vec3D (float px, float py, float pz)
 Creates a new Vec3D instance for a 3D coordinates system with float values. More...
 
 Vec3D (float px, float py)
 Creates a new Vec3D instance for a 2D coordinates system with float values. More...
 
bool IsFloat ()
 Indicates whether the position is expressed using floating point values or not. More...
 
float FloatX ()
 Returns the position along the X axis as a float value. More...
 
float FloatY ()
 Returns the position along the Y axis as a float value. More...
 
float FloatZ ()
 Returns the position along the Z axis as a float value. More...
 
long int IntX ()
 Returns the position along the X axis as an integer value. More...
 
long int IntY ()
 Returns the position along the Y axis as an integer value. More...
 
long int IntZ ()
 Returns the position along the Z axis as an integer value. More...
 
boost::shared_ptr< vector< long int > > ToIntArray ()
 <exclude>
 
boost::shared_ptr< vector< float > > ToFloatArray ()
 <exclude>
 
boost::shared_ptr< string > ToString ()
 <exclude>
 

Static Public Member Functions

static boost::shared_ptr< Vec3DfromArray (long int tp, boost::shared_ptr< void > array)
 <exclude>
 

Detailed Description

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, based on the game's coordinate system requirements.

Constructor & Destructor Documentation

◆ Vec3D() [1/4]

Sfs2X::Entities::Data::Vec3D::Vec3D ( long int  px,
long int  py,
long int  pz 
)

Creates a new Vec3D instance for a 3D coordinates system with integer values.

Parameters
pxThe position along the X axis.
pyThe position along the Y axis.
pzThe position along the Z axis.

◆ Vec3D() [2/4]

Sfs2X::Entities::Data::Vec3D::Vec3D ( long int  px,
long int  py 
)

Creates a new Vec3D instance for a 2D coordinates system with integer values.

Parameters
pxThe position along the X axis.
pyThe position along the Y axis.

◆ Vec3D() [3/4]

Sfs2X::Entities::Data::Vec3D::Vec3D ( float  px,
float  py,
float  pz 
)

Creates a new Vec3D instance for a 3D coordinates system with float values.

Parameters
pxThe position along the X axis.
pyThe position along the Y axis.
pzThe position along the Z axis.

◆ Vec3D() [4/4]

Sfs2X::Entities::Data::Vec3D::Vec3D ( float  px,
float  py 
)

Creates a new Vec3D instance for a 2D coordinates system with float values.

Parameters
pxThe position along the X axis.
pyThe position along the Y axis.

Member Function Documentation

◆ FloatX()

float Sfs2X::Entities::Data::Vec3D::FloatX ( )

Returns the position along the X axis as a float value.

◆ FloatY()

float Sfs2X::Entities::Data::Vec3D::FloatY ( )

Returns the position along the Y axis as a float value.

◆ FloatZ()

float Sfs2X::Entities::Data::Vec3D::FloatZ ( )

Returns the position along the Z axis as a float value.

◆ IntX()

long int Sfs2X::Entities::Data::Vec3D::IntX ( )

Returns the position along the X axis as an integer value.

◆ IntY()

long int Sfs2X::Entities::Data::Vec3D::IntY ( )

Returns the position along the Y axis as an integer value.

◆ IntZ()

long int Sfs2X::Entities::Data::Vec3D::IntZ ( )

Returns the position along the Z axis as an integer value.

◆ IsFloat()

bool Sfs2X::Entities::Data::Vec3D::IsFloat ( )

Indicates whether the position is expressed using floating point values or not.

Returns
true if the position is expressed using floating point values.