public |
Inheritance Graph
graph BT
_Vec2
click _Vec2 "classGeometry_1_1__Vec2"
Description
Two-dimensional vector.
[ _Vec2 ]
Classes
class | Geometry::_Vec2::Comparator |
Main
_Vec2() | |
_Vec2( value_t _xy) | |
_Vec2( value_t _x, value_t _y) | |
template< class other_t > | |
_Vec2(const _Vec2 < other_t > & v) | |
_Vec2(const value_t * v) |
Information
const value_t | x() const |
const value_t | y() const |
const value_t | getX() const |
const value_t | getY() const |
const value_t | getWidth() const |
const value_t | getHeight() const |
const value_t | width() const |
const value_t | height() const |
template< typename float_t > | |
float_t | length() const |
value_t | length() const |
value_t & | operator[](const unsigned int nr) |
value_t * | getVec() |
const value_t * | getVec() const |
template< typename float_t > | |
float_t | distance(const _Vec2 & other) const |
value_t | distance(const _Vec2 & other) const |
value_t | distanceSquared(const _Vec2 & other) const |
value_t | dot(const vec2_t & p) const |
bool | isZero() const |
Modification
void | setValue(const value_t a, const value_t b) |
void | setValue(const value_t * v) |
void | x(const value_t a) |
void | y(const value_t a) |
void | setX(const value_t a) |
void | setY(const value_t a) |
void | setWidth(const value_t a) |
void | setHeight(const value_t a) |
void | width(const value_t a) |
void | height(const value_t a) |
vec2_t & | normalize() |
vec2_t & | operator+=(const vec2_t & p1) |
vec2_t & | operator-=(const vec2_t & p1) |
vec2_t & | operator*=(const value_t & f) |
vec2_t & | operator/=(const value_t & f) |
Creation
const vec2_t | operator-() const |
const vec2_t | operator+(const vec2_t & p) const |
const vec2_t | operator-(const vec2_t & p) const |
const vec2_t | operator*(const value_t & f) const |
const vec2_t | operator/(const value_t & f) const |
const vec2_t | operator*(const vec2_t & p) const |
const vec2_t | operator/(const vec2_t & p) const |
Comparators
bool | equals(const vec2_t & other, value_t epsilon) const |
int | operator==(const vec2_t & p1) const |
int | operator!=(const vec2_t & p1) const |
Serialization
Public Types
typedef T_ | value_t |
typedef _Vec2 < value_t > | vec2_t |
Documentation
function
Geometry::_Vec2::_Vec2
public | inline |
_Vec2( | ) |
Defined in Geometry/Vec2.h:53
function
Geometry::_Vec2::_Vec2
public | inline |
_Vec2( | value_t | _xy ) |
Defined in Geometry/Vec2.h:58
function
Geometry::_Vec2::_Vec2
public | inline |
_Vec2( | value_t | _x, |
value_t | _y | |
) |
Defined in Geometry/Vec2.h:63
function
Geometry::_Vec2::_Vec2
public | inline |
template< class other_t > | ||
_Vec2( | const _Vec2 < other_t > & | v ) |
Defined in Geometry/Vec2.h:69
function
Geometry::_Vec2::_Vec2
public | inline |
_Vec2( | const value_t * | v ) |
Defined in Geometry/Vec2.h:74
function
Geometry::_Vec2::x
public | const | inline |
const value_t x( | ) const |
Defined in Geometry/Vec2.h:85
function
Geometry::_Vec2::y
public | const | inline |
const value_t y( | ) const |
Defined in Geometry/Vec2.h:88
function
Geometry::_Vec2::getX
public | const | inline |
const value_t getX( | ) const |
Defined in Geometry/Vec2.h:91
function
Geometry::_Vec2::getY
public | const | inline |
const value_t getY( | ) const |
Defined in Geometry/Vec2.h:94
function
Geometry::_Vec2::getWidth
public | const | inline |
const value_t getWidth( | ) const |
Defined in Geometry/Vec2.h:97
function
Geometry::_Vec2::getHeight
public | const | inline |
const value_t getHeight( | ) const |
Defined in Geometry/Vec2.h:100
function
Geometry::_Vec2::width
public | const | inline |
const value_t width( | ) const |
Defined in Geometry/Vec2.h:103
function
Geometry::_Vec2::height
public | const | inline |
const value_t height( | ) const |
Defined in Geometry/Vec2.h:106
function
Geometry::_Vec2::length
public | const | inline |
template< typename float_t > | |
float_t length( | ) const |
Defined in Geometry/Vec2.h:111
function
Geometry::_Vec2::length
public | const | inline |
value_t length( | ) const |
Defined in Geometry/Vec2.h:115
function
Geometry::_Vec2::operator[]
public | inline |
value_t & operator[]( | const unsigned int | nr ) |
Defined in Geometry/Vec2.h:119
function
Geometry::_Vec2::getVec
public | inline |
value_t * getVec( | ) |
Defined in Geometry/Vec2.h:124
function
Geometry::_Vec2::getVec
public | const | inline |
const value_t * getVec( | ) const |
Defined in Geometry/Vec2.h:127
function
Geometry::_Vec2::distance
public | const | inline |
template< typename float_t > | ||
float_t distance( | const _Vec2 & | other ) const |
Calculate the Euclidean distance between this and another vector.
Parameters
- other
- Other vector
Returns
Distance
Defined in Geometry/Vec2.h:138
function
Geometry::_Vec2::distance
public | const | inline |
value_t distance( | const _Vec2 & | other ) const |
Defined in Geometry/Vec2.h:142
function
Geometry::_Vec2::distanceSquared
public | const | inline |
value_t distanceSquared( | const _Vec2 & | other ) const |
Calculate the squared Euclidean distance between this and another vector.
Parameters
- other
- Other vector
Returns
Squared distance
Defined in Geometry/Vec2.h:152
function
Geometry::_Vec2::dot
public | const | inline |
value_t dot( | const vec2_t & | p ) const |
Defined in Geometry/Vec2.h:158
function
Geometry::_Vec2::isZero
public | const | inline |
bool isZero( | ) const |
Defined in Geometry/Vec2.h:161
function
Geometry::_Vec2::setValue
public | inline |
void setValue( | const value_t | a, |
const value_t | b | |
) |
Defined in Geometry/Vec2.h:170
function
Geometry::_Vec2::setValue
public | inline |
void setValue( | const value_t * | v ) |
Defined in Geometry/Vec2.h:175
function
Geometry::_Vec2::x
public | inline |
void x( | const value_t | a ) |
Defined in Geometry/Vec2.h:180
function
Geometry::_Vec2::y
public | inline |
void y( | const value_t | a ) |
Defined in Geometry/Vec2.h:183
function
Geometry::_Vec2::setX
public | inline |
void setX( | const value_t | a ) |
Defined in Geometry/Vec2.h:186
function
Geometry::_Vec2::setY
public | inline |
void setY( | const value_t | a ) |
Defined in Geometry/Vec2.h:189
function
Geometry::_Vec2::setWidth
public | inline |
void setWidth( | const value_t | a ) |
Defined in Geometry/Vec2.h:192
function
Geometry::_Vec2::setHeight
public | inline |
void setHeight( | const value_t | a ) |
Defined in Geometry/Vec2.h:195
function
Geometry::_Vec2::width
public | inline |
void width( | const value_t | a ) |
Defined in Geometry/Vec2.h:198
function
Geometry::_Vec2::height
public | inline |
void height( | const value_t | a ) |
Defined in Geometry/Vec2.h:201
function
Geometry::_Vec2::normalize
public | inline |
vec2_t & normalize( | ) |
Defined in Geometry/Vec2.h:205
function
Geometry::_Vec2::operator+=
public | inline |
vec2_t & operator+=( | const vec2_t & | p1 ) |
Defined in Geometry/Vec2.h:216
function
Geometry::_Vec2::operator-=
public | inline |
vec2_t & operator-=( | const vec2_t & | p1 ) |
Defined in Geometry/Vec2.h:221
function
Geometry::_Vec2::operator*=
public | inline |
vec2_t & operator*=( | const value_t & | f ) |
Defined in Geometry/Vec2.h:226
function
Geometry::_Vec2::operator/=
public | inline |
vec2_t & operator/=( | const value_t & | f ) |
Defined in Geometry/Vec2.h:232
function
Geometry::_Vec2::operator-
public | const | inline |
const vec2_t operator-( | ) const |
Defined in Geometry/Vec2.h:244
function
Geometry::_Vec2::operator+
public | const | inline |
const vec2_t operator+( | const vec2_t & | p ) const |
Defined in Geometry/Vec2.h:247
function
Geometry::_Vec2::operator-
public | const | inline |
const vec2_t operator-( | const vec2_t & | p ) const |
Defined in Geometry/Vec2.h:250
function
Geometry::_Vec2::operator*
public | const | inline |
const vec2_t operator*( | const value_t & | f ) const |
Defined in Geometry/Vec2.h:253
function
Geometry::_Vec2::operator/
public | const | inline |
const vec2_t operator/( | const value_t & | f ) const |
Defined in Geometry/Vec2.h:257
function
Geometry::_Vec2::operator*
public | const | inline |
const vec2_t operator*( | const vec2_t & | p ) const |
Defined in Geometry/Vec2.h:261
function
Geometry::_Vec2::operator/
public | const | inline |
const vec2_t operator/( | const vec2_t & | p ) const |
Defined in Geometry/Vec2.h:264
function
Geometry::_Vec2::equals
public | const | inline |
bool equals( | const vec2_t & | other, |
value_t | epsilon | |
) const |
compares this with other componentwise
Parameters
- other
- the object to compare with
- epsilon
- the maximum allowed difference between the component pairs
Returns
true iff any the absolute difference between any pai of components is larger than epsilon
Defined in Geometry/Vec2.h:277
function
Geometry::_Vec2::operator==
public | const | inline |
int operator==( | const vec2_t & | p1 ) const |
Defined in Geometry/Vec2.h:280
function
Geometry::_Vec2::operator!=
public | const | inline |
int operator!=( | const vec2_t & | p1 ) const |
Defined in Geometry/Vec2.h:283
typedef
Geometry::_Vec2::value_t
public |
typedef T_ value_t |
Defined in Geometry/Vec2.h:28
typedef
Geometry::_Vec2::vec2_t
public |
typedef _Vec2 < value_t > vec2_t |
Defined in Geometry/Vec2.h:29