MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
envitia::maplink::earth::Vec3 Class Reference
Inheritance diagram for envitia::maplink::earth::Vec3:

Detailed Description

A vector in 3D space

This class is used to specify positions and directions within the MapLink 3D SDK

This class does not define a particular unit itself, please refer to the documentation of classes which use Vec3.

Public Member Functions

virtual ~Vec3 ()
 Destructor.
 
double x () const
 Get the x component of the vector.
 
double y () const
 Get the y component of the vector.
 
double z () const
 Get the z component of the vector.
 
void x (double v)
 Set the x component of the vector.
 
void y (double v)
 Set the y component of the vector.
 
void z (double v)
 Set the z component of the vector.
 
double length () const
 Get the length of the vector.
 
void normalise ()
 

Protected Member Functions

 Vec3 ()
 Constructor.
 
 Vec3 (double x, double y, double z)
 Constructor.
 
 Vec3 (const Vec3 &other)
 Copy Constructor.
 
bool operator== (const Vec3 &v) const
 Equality operator.
 
bool operator!= (const Vec3 &v) const
 Inequality operator.
 
bool operator< (const Vec3 &v) const
 Less than operator.
 
const Vec3 operator* (const double &v) const
 Multiply the vector by a scalar value.
 
Vec3 operator*= (const double &v)
 Multiply the vector by a scalar value.
 
const Vec3 operator/ (const double &v) const
 Divide the vector by a scalar value.
 
Vec3 operator/= (const double &v)
 Divide the vector by a scalar value.
 
const Vec3 operator+ (const Vec3 &v) const
 Addition operator.
 
Vec3 operator+= (const Vec3 &v)
 Addition operator.
 
const Vec3 operator- (const Vec3 &v) const
 Subtraction operator.
 
Vec3 operator-= (const Vec3 &v)
 Subtraction operator.
 
double operator* (const Vec3 &v) const
 
const Vec3 operator^ (const Vec3 &v) const
 

Protected Attributes

double m_v [3]
 

Constructor & Destructor Documentation

◆ ~Vec3()

virtual envitia::maplink::earth::Vec3::~Vec3 ( )
virtual

Destructor.

◆ Vec3() [1/3]

envitia::maplink::earth::Vec3::Vec3 ( )
protected

Constructor.

◆ Vec3() [2/3]

envitia::maplink::earth::Vec3::Vec3 ( double x,
double y,
double z )
protected

Constructor.

◆ Vec3() [3/3]

envitia::maplink::earth::Vec3::Vec3 ( const Vec3 & other)
protected

Copy Constructor.

Member Function Documentation

◆ length()

double envitia::maplink::earth::Vec3::length ( ) const

Get the length of the vector.

◆ normalise()

void envitia::maplink::earth::Vec3::normalise ( )

Normalise the vector

The vector will be modified in order to set the length to 1.0.

◆ operator!=()

bool envitia::maplink::earth::Vec3::operator!= ( const Vec3 & v) const
protected

Inequality operator.

◆ operator*() [1/2]

const Vec3 envitia::maplink::earth::Vec3::operator* ( const double & v) const
protected

Multiply the vector by a scalar value.

◆ operator*() [2/2]

double envitia::maplink::earth::Vec3::operator* ( const Vec3 & v) const
protected

Calculate the dot product with another vector

Parameters
vThe vector to perform a dot product against
Returns
The dot product (this . v)

◆ operator*=()

Vec3 envitia::maplink::earth::Vec3::operator*= ( const double & v)
protected

Multiply the vector by a scalar value.

◆ operator+()

const Vec3 envitia::maplink::earth::Vec3::operator+ ( const Vec3 & v) const
protected

Addition operator.

◆ operator+=()

Vec3 envitia::maplink::earth::Vec3::operator+= ( const Vec3 & v)
protected

Addition operator.

◆ operator-()

const Vec3 envitia::maplink::earth::Vec3::operator- ( const Vec3 & v) const
protected

Subtraction operator.

◆ operator-=()

Vec3 envitia::maplink::earth::Vec3::operator-= ( const Vec3 & v)
protected

Subtraction operator.

◆ operator/()

const Vec3 envitia::maplink::earth::Vec3::operator/ ( const double & v) const
protected

Divide the vector by a scalar value.

◆ operator/=()

Vec3 envitia::maplink::earth::Vec3::operator/= ( const double & v)
protected

Divide the vector by a scalar value.

◆ operator<()

bool envitia::maplink::earth::Vec3::operator< ( const Vec3 & v) const
protected

Less than operator.

◆ operator==()

bool envitia::maplink::earth::Vec3::operator== ( const Vec3 & v) const
protected

Equality operator.

◆ operator^()

const Vec3 envitia::maplink::earth::Vec3::operator^ ( const Vec3 & v) const
protected

Calculate the cross product with another vector

Parameters
vThe vector to perform a cross product against
Returns
The cross product (this x v)

◆ x() [1/2]

double envitia::maplink::earth::Vec3::x ( ) const

Get the x component of the vector.

◆ x() [2/2]

void envitia::maplink::earth::Vec3::x ( double v)

Set the x component of the vector.

◆ y() [1/2]

double envitia::maplink::earth::Vec3::y ( ) const

Get the y component of the vector.

◆ y() [2/2]

void envitia::maplink::earth::Vec3::y ( double v)

Set the y component of the vector.

◆ z() [1/2]

double envitia::maplink::earth::Vec3::z ( ) const

Get the z component of the vector.

◆ z() [2/2]

void envitia::maplink::earth::Vec3::z ( double v)

Set the z component of the vector.

Member Data Documentation

◆ m_v

double envitia::maplink::earth::Vec3::m_v[3]
protected