Code_TYMPAN  4.4.0
Industrial site acoustic simulation
Public Member Functions | Public Attributes | List of all members
core_mathlib::base_vec3< base_t > Class Template Reference

3D vector Vector defined with 3 float numbers More...

#include <mathlib.h>

Public Member Functions

 base_vec3 (void)
 
 base_vec3 (const base_t &_x, const base_t &_y, const base_t &_z)
 
 base_vec3 (const base_t *_v)
 
 base_vec3 (const vec2 &_v, base_t _z)
 
 base_vec3 (const base_vec3 &_v)
 
 base_vec3 (const base_vec3 *_v)
 
 base_vec3 (const base_vec3 &_v, const base_vec3 &_w)
 ab vector coordinates More...
 
 base_vec3 (const vec4 &_v)
 
base_t get_x ()
 
base_t get_y ()
 
base_t get_z ()
 
bool operator== (const base_vec3 &_v)
 
bool operator!= (const base_vec3 &_v)
 
base_vec3operator= (base_t _f)
 
const base_vec3 operator* (base_t _f) const
 
const base_vec3 operator/ (base_t _f) const
 
base_vec3 operator/ (const base_vec3 &_v) const
 
const base_vec3 operator+ (const base_vec3 &_v) const
 
const base_vec3 operator- () const
 
const base_vec3 operator- (const base_vec3 &_v) const
 
base_vec3operator*= (base_t _f)
 
base_vec3operator/= (base_t _f)
 
base_vec3operator+= (const base_vec3 &_v)
 
base_vec3operator-= (const base_vec3 &_v)
 
base_t operator* (const base_vec3 &_v) const
 
base_vec3 operator^ (const base_vec3 &_v) const
 cross product More...
 
base_t operator* (const vec4 &_v) const
 
 operator base_t * ()
 
 operator const base_t * () const
 
base_t & operator[] (int _i)
 
const base_t & operator[] (int _i) const
 
bool barelyEqual (const base_vec3 &_v) const
 
void set (base_t _x, base_t _y, base_t _z)
 
void reset (void)
 
base_t length (void) const
 
base_t normalize (void)
 
void cross (const base_vec3 &v1, const base_vec3 &v2)
 
void cross (const base_vec3 &v2)
 
base_t cosinus (const base_vec3 &ac)
 
base_t dot (const base_vec3 &v) const
 Scalar product. More...
 
bool compare (const base_vec3 &_v, base_t epsi=EPSILON_6)
 
base_t angle (const base_vec3 &v) const
 Return the angle in radians between *this and v. More...
 
base_vec3 closestPointOnLine (const base_vec3 &vA, const base_vec3 &vB) const
 Return the coordinates of the nearest point of *this on the line passing by vA and vB. More...
 
base_vec3 closestPointOnSegment (const base_vec3 &vA, const base_vec3 &vB) const
 Return the coordinates of the nearest point of *this on the segment [vA,vB]. More...
 
base_t projectionOnLine (const base_vec3 &vA, const base_vec3 &vB) const
 Return the projection factor of *this on the line passing by vA and vB. More...
 
base_vec3 lerp (base_vec3 &u, base_vec3 &v, base_t factor)
 Linear interpolation function between 2 vectors. More...
 
decimal distance (const base_vec3 &a_vector) const
 Compute the distance between two points pointed by *this and a_vector. More...
 
base_vec3 Rotation (const base_vec3 &n, const base_t &angle) const
 Vector rotation. More...
 

Public Attributes

union {
   struct {
      base_t   x
 
      base_t   y
 
      base_t   z
 
   } 
 
   struct {
      base_t   s
 
      base_t   t
 
      base_t   p
 
   } 
 
   struct {
      base_t   r
 
      base_t   g
 
      base_t   b
 
   } 
 
   base_t   v [3]
 
}; 
 

Detailed Description

template<typename base_t>
class core_mathlib::base_vec3< base_t >

3D vector Vector defined with 3 float numbers

Definition at line 107 of file mathlib.h.

Constructor & Destructor Documentation

◆ base_vec3() [1/8]

template<typename base_t >
core_mathlib::base_vec3< base_t >::base_vec3 ( void  )
inline

Definition at line 110 of file mathlib.h.

Here is the caller graph for this function:

◆ base_vec3() [2/8]

template<typename base_t >
core_mathlib::base_vec3< base_t >::base_vec3 ( const base_t &  _x,
const base_t &  _y,
const base_t &  _z 
)
inline

Definition at line 111 of file mathlib.h.

◆ base_vec3() [3/8]

template<typename base_t >
core_mathlib::base_vec3< base_t >::base_vec3 ( const base_t *  _v)
inline

Definition at line 112 of file mathlib.h.

◆ base_vec3() [4/8]

template<typename base_t >
core_mathlib::base_vec3< base_t >::base_vec3 ( const vec2 _v,
base_t  _z 
)
inline

Definition at line 675 of file mathlib.h.

◆ base_vec3() [5/8]

template<typename base_t >
core_mathlib::base_vec3< base_t >::base_vec3 ( const base_vec3< base_t > &  _v)
inline

Definition at line 114 of file mathlib.h.

◆ base_vec3() [6/8]

template<typename base_t >
core_mathlib::base_vec3< base_t >::base_vec3 ( const base_vec3< base_t > *  _v)
inline

Definition at line 115 of file mathlib.h.

◆ base_vec3() [7/8]

template<typename base_t >
core_mathlib::base_vec3< base_t >::base_vec3 ( const base_vec3< base_t > &  _v,
const base_vec3< base_t > &  _w 
)
inline

ab vector coordinates

Definition at line 116 of file mathlib.h.

◆ base_vec3() [8/8]

template<typename base_t >
core_mathlib::base_vec3< base_t >::base_vec3 ( const vec4 _v)
inline

Definition at line 886 of file mathlib.h.

Member Function Documentation

◆ angle()

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::angle ( const base_vec3< base_t > &  v) const
inline

Return the angle in radians between *this and v.

Definition at line 285 of file mathlib.h.

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

◆ barelyEqual()

template<typename base_t >
bool core_mathlib::base_vec3< base_t >::barelyEqual ( const base_vec3< base_t > &  _v) const
inline

Definition at line 226 of file mathlib.h.

◆ closestPointOnLine()

template<typename base_t >
base_vec3 core_mathlib::base_vec3< base_t >::closestPointOnLine ( const base_vec3< base_t > &  vA,
const base_vec3< base_t > &  vB 
) const
inline

Return the coordinates of the nearest point of *this on the line passing by vA and vB.

Definition at line 295 of file mathlib.h.

Here is the call graph for this function:

◆ closestPointOnSegment()

template<typename base_t >
base_vec3 core_mathlib::base_vec3< base_t >::closestPointOnSegment ( const base_vec3< base_t > &  vA,
const base_vec3< base_t > &  vB 
) const
inline

Return the coordinates of the nearest point of *this on the segment [vA,vB].

Definition at line 300 of file mathlib.h.

Here is the call graph for this function:

◆ compare()

template<typename base_t >
bool core_mathlib::base_vec3< base_t >::compare ( const base_vec3< base_t > &  _v,
base_t  epsi = EPSILON_6 
)
inline

Definition at line 280 of file mathlib.h.

◆ cosinus()

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::cosinus ( const base_vec3< base_t > &  ac)
inline

Definition at line 271 of file mathlib.h.

Here is the call graph for this function:

◆ cross() [1/2]

template<typename base_t >
void core_mathlib::base_vec3< base_t >::cross ( const base_vec3< base_t > &  v1,
const base_vec3< base_t > &  v2 
)
inline

Definition at line 257 of file mathlib.h.

Here is the caller graph for this function:

◆ cross() [2/2]

template<typename base_t >
void core_mathlib::base_vec3< base_t >::cross ( const base_vec3< base_t > &  v2)
inline

Definition at line 263 of file mathlib.h.

◆ distance()

template<typename base_t >
decimal core_mathlib::base_vec3< base_t >::distance ( const base_vec3< base_t > &  a_vector) const
inline

Compute the distance between two points pointed by *this and a_vector.

Parameters
a_vectorA vector defining the second point
Returns
Distance

Definition at line 330 of file mathlib.h.

◆ dot()

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::dot ( const base_vec3< base_t > &  v) const
inline

Scalar product.

Definition at line 275 of file mathlib.h.

Here is the caller graph for this function:

◆ get_x()

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::get_x ( )
inline

Definition at line 120 of file mathlib.h.

◆ get_y()

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::get_y ( )
inline

Definition at line 124 of file mathlib.h.

◆ get_z()

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::get_z ( )
inline

Definition at line 128 of file mathlib.h.

◆ length()

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::length ( void  ) const
inline

Definition at line 240 of file mathlib.h.

Here is the caller graph for this function:

◆ lerp()

template<typename base_t >
base_vec3 core_mathlib::base_vec3< base_t >::lerp ( base_vec3< base_t > &  u,
base_vec3< base_t > &  v,
base_t  factor 
)
inline

Linear interpolation function between 2 vectors.

Definition at line 320 of file mathlib.h.

◆ normalize()

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::normalize ( void  )
inline

Definition at line 244 of file mathlib.h.

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

◆ operator base_t *()

template<typename base_t >
core_mathlib::base_vec3< base_t >::operator base_t * ( )
inline

Definition at line 209 of file mathlib.h.

◆ operator const base_t *()

template<typename base_t >
core_mathlib::base_vec3< base_t >::operator const base_t * ( ) const
inline

Definition at line 213 of file mathlib.h.

◆ operator!=()

template<typename base_t >
bool core_mathlib::base_vec3< base_t >::operator!= ( const base_vec3< base_t > &  _v)
inline

Definition at line 138 of file mathlib.h.

◆ operator*() [1/3]

template<typename base_t >
const base_vec3 core_mathlib::base_vec3< base_t >::operator* ( base_t  _f) const
inline

Definition at line 150 of file mathlib.h.

Here is the call graph for this function:

◆ operator*() [2/3]

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::operator* ( const base_vec3< base_t > &  _v) const
inline

Definition at line 197 of file mathlib.h.

◆ operator*() [3/3]

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::operator* ( const vec4 _v) const
inline

Definition at line 892 of file mathlib.h.

◆ operator*=()

template<typename base_t >
base_vec3& core_mathlib::base_vec3< base_t >::operator*= ( base_t  _f)
inline

Definition at line 180 of file mathlib.h.

◆ operator+()

template<typename base_t >
const base_vec3 core_mathlib::base_vec3< base_t >::operator+ ( const base_vec3< base_t > &  _v) const
inline

Definition at line 167 of file mathlib.h.

Here is the call graph for this function:

◆ operator+=()

template<typename base_t >
base_vec3& core_mathlib::base_vec3< base_t >::operator+= ( const base_vec3< base_t > &  _v)
inline

Definition at line 188 of file mathlib.h.

◆ operator-() [1/2]

template<typename base_t >
const base_vec3 core_mathlib::base_vec3< base_t >::operator- ( ) const
inline

Definition at line 171 of file mathlib.h.

Here is the call graph for this function:

◆ operator-() [2/2]

template<typename base_t >
const base_vec3 core_mathlib::base_vec3< base_t >::operator- ( const base_vec3< base_t > &  _v) const
inline

Definition at line 175 of file mathlib.h.

Here is the call graph for this function:

◆ operator-=()

template<typename base_t >
base_vec3& core_mathlib::base_vec3< base_t >::operator-= ( const base_vec3< base_t > &  _v)
inline

Definition at line 192 of file mathlib.h.

◆ operator/() [1/2]

template<typename base_t >
const base_vec3 core_mathlib::base_vec3< base_t >::operator/ ( base_t  _f) const
inline

Definition at line 154 of file mathlib.h.

◆ operator/() [2/2]

template<typename base_t >
base_vec3 core_mathlib::base_vec3< base_t >::operator/ ( const base_vec3< base_t > &  _v) const
inline

Definition at line 163 of file mathlib.h.

Here is the call graph for this function:

◆ operator/=()

template<typename base_t >
base_vec3& core_mathlib::base_vec3< base_t >::operator/= ( base_t  _f)
inline

Definition at line 184 of file mathlib.h.

◆ operator=()

template<typename base_t >
base_vec3& core_mathlib::base_vec3< base_t >::operator= ( base_t  _f)
inline

Definition at line 143 of file mathlib.h.

◆ operator==()

template<typename base_t >
bool core_mathlib::base_vec3< base_t >::operator== ( const base_vec3< base_t > &  _v)
inline

Definition at line 133 of file mathlib.h.

◆ operator[]() [1/2]

template<typename base_t >
base_t& core_mathlib::base_vec3< base_t >::operator[] ( int  _i)
inline

Definition at line 217 of file mathlib.h.

◆ operator[]() [2/2]

template<typename base_t >
const base_t& core_mathlib::base_vec3< base_t >::operator[] ( int  _i) const
inline

Definition at line 221 of file mathlib.h.

◆ operator^()

template<typename base_t >
base_vec3 core_mathlib::base_vec3< base_t >::operator^ ( const base_vec3< base_t > &  _v) const
inline

cross product

Definition at line 201 of file mathlib.h.

Here is the call graph for this function:

◆ projectionOnLine()

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::projectionOnLine ( const base_vec3< base_t > &  vA,
const base_vec3< base_t > &  vB 
) const
inline

Return the projection factor of *this on the line passing by vA and vB.

Definition at line 314 of file mathlib.h.

Here is the caller graph for this function:

◆ reset()

template<typename base_t >
void core_mathlib::base_vec3< base_t >::reset ( void  )
inline

Definition at line 236 of file mathlib.h.

◆ Rotation()

template<typename base_t >
base_vec3 core_mathlib::base_vec3< base_t >::Rotation ( const base_vec3< base_t > &  n,
const base_t &  angle 
) const
inline

Vector rotation.

Function to change the coordinates of the vector *this by rotation around the vector n with an angle (radians)

Parameters
[in]angleAngle in radians
[in]nRotation vector

Definition at line 349 of file mathlib.h.

Here is the call graph for this function:

◆ set()

template<typename base_t >
void core_mathlib::base_vec3< base_t >::set ( base_t  _x,
base_t  _y,
base_t  _z 
)
inline

Definition at line 230 of file mathlib.h.

Member Data Documentation

◆ 

union { ... }

◆ b

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::b

Definition at line 376 of file mathlib.h.

◆ g

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::g

Definition at line 376 of file mathlib.h.

◆ p

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::p

Definition at line 372 of file mathlib.h.

◆ r

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::r

Definition at line 376 of file mathlib.h.

◆ s

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::s

Definition at line 372 of file mathlib.h.

◆ t

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::t

Definition at line 372 of file mathlib.h.

◆ v

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::v[3]

Definition at line 378 of file mathlib.h.

◆ x

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::x

Definition at line 368 of file mathlib.h.

◆ y

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::y

Definition at line 368 of file mathlib.h.

◆ z

template<typename base_t >
base_t core_mathlib::base_vec3< base_t >::z

Definition at line 368 of file mathlib.h.


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