CARLA
Public Member Functions | Public Attributes | Friends | List of all members
carla::geom::Vector2D Class Reference

#include <Vector2D.h>

+ Collaboration diagram for carla::geom::Vector2D:

Public Member Functions

float Length () const
 
Vector2D MakeUnitVector () const
 
bool operator!= (const Vector2D &rhs) const
 
Vector2Doperator*= (float rhs)
 
Vector2Doperator+= (const Vector2D &rhs)
 
Vector2Doperator-= (const Vector2D &rhs)
 
Vector2Doperator/= (float rhs)
 
bool operator== (const Vector2D &rhs) const
 
float SquaredLength () const
 
 Vector2D ()=default
 
 Vector2D (float ix, float iy)
 

Public Attributes

float x = 0.0f
 
float y = 0.0f
 

Friends

Vector2D operator* (Vector2D lhs, float rhs)
 
Vector2D operator* (float lhs, Vector2D rhs)
 
Vector2D operator+ (Vector2D lhs, const Vector2D &rhs)
 
Vector2D operator- (Vector2D lhs, const Vector2D &rhs)
 
Vector2D operator/ (Vector2D lhs, float rhs)
 
Vector2D operator/ (float lhs, Vector2D rhs)
 

Detailed Description

Definition at line 17 of file geom/Vector2D.h.

Constructor & Destructor Documentation

◆ Vector2D() [1/2]

carla::geom::Vector2D::Vector2D ( )
default

Referenced by MakeUnitVector().

+ Here is the caller graph for this function:

◆ Vector2D() [2/2]

carla::geom::Vector2D::Vector2D ( float  ix,
float  iy 
)
inline

Definition at line 34 of file geom/Vector2D.h.

Member Function Documentation

◆ Length()

float carla::geom::Vector2D::Length ( ) const
inline

Definition at line 46 of file geom/Vector2D.h.

References SquaredLength().

Referenced by MakeUnitVector().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeUnitVector()

Vector2D carla::geom::Vector2D::MakeUnitVector ( ) const
inline

Definition at line 50 of file geom/Vector2D.h.

References DEVELOPMENT_ASSERT, Length(), and Vector2D().

+ Here is the call graph for this function:

◆ operator!=()

bool carla::geom::Vector2D::operator!= ( const Vector2D rhs) const
inline

Definition at line 123 of file geom/Vector2D.h.

References x.

◆ operator*=()

Vector2D& carla::geom::Vector2D::operator*= ( float  rhs)
inline

Definition at line 83 of file geom/Vector2D.h.

◆ operator+=()

Vector2D& carla::geom::Vector2D::operator+= ( const Vector2D rhs)
inline

Definition at line 61 of file geom/Vector2D.h.

References x, and y.

◆ operator-=()

Vector2D& carla::geom::Vector2D::operator-= ( const Vector2D rhs)
inline

Definition at line 72 of file geom/Vector2D.h.

References x, and y.

◆ operator/=()

Vector2D& carla::geom::Vector2D::operator/= ( float  rhs)
inline

Definition at line 99 of file geom/Vector2D.h.

◆ operator==()

bool carla::geom::Vector2D::operator== ( const Vector2D rhs) const
inline

Definition at line 119 of file geom/Vector2D.h.

References x, and y.

◆ SquaredLength()

float carla::geom::Vector2D::SquaredLength ( ) const
inline

Definition at line 42 of file geom/Vector2D.h.

References y.

Referenced by Length().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator* [1/2]

Vector2D operator* ( Vector2D  lhs,
float  rhs 
)
friend

Definition at line 89 of file geom/Vector2D.h.

◆ operator* [2/2]

Vector2D operator* ( float  lhs,
Vector2D  rhs 
)
friend

Definition at line 94 of file geom/Vector2D.h.

◆ operator+

Vector2D operator+ ( Vector2D  lhs,
const Vector2D rhs 
)
friend

Definition at line 67 of file geom/Vector2D.h.

◆ operator-

Vector2D operator- ( Vector2D  lhs,
const Vector2D rhs 
)
friend

Definition at line 78 of file geom/Vector2D.h.

◆ operator/ [1/2]

Vector2D operator/ ( Vector2D  lhs,
float  rhs 
)
friend

Definition at line 105 of file geom/Vector2D.h.

◆ operator/ [2/2]

Vector2D operator/ ( float  lhs,
Vector2D  rhs 
)
friend

Definition at line 110 of file geom/Vector2D.h.

Member Data Documentation

◆ x

float carla::geom::Vector2D::x = 0.0f

◆ y

float carla::geom::Vector2D::y = 0.0f

The documentation for this class was generated from the following file: