ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
Vec3 Class Reference

#include <Vec3.h>

Public Member Functions

 Vec3 (double _x, double _y, double _z)
 
 Vec3 ()
 
 Vec3 (const Vec3 &v)
 
double length () const
 
Vec3 normalized () const
 
void operator+= (const Vec3 &v)
 
Vec3 operator/ (const double &a) const
 
Vec3 operator- (const Vec3 &v) const
 
Vec3 operator+ (const Vec3 &v) const
 
Vec3 operator* (const double &a) const
 
Vec3 operator- () const
 
Vec3 cross (const Vec3 &v) const
 
double dot (const Vec3 &v) const
 

Public Attributes

union {
   struct {
      double   x
 
      double   y
 
      double   z
 
   } 
 
   double   f [3]
 
}; 
 

Detailed Description

Definition at line 13 of file Vec3.h.

Constructor & Destructor Documentation

◆ Vec3() [1/3]

Vec3::Vec3 ( double  _x,
double  _y,
double  _z 
)
inline

Definition at line 23 of file Vec3.h.

◆ Vec3() [2/3]

Vec3::Vec3 ( )
inline

Definition at line 25 of file Vec3.h.

Referenced by cross(), normalized(), operator*(), operator+(), operator-(), and operator/().

◆ Vec3() [3/3]

Vec3::Vec3 ( const Vec3 v)
inline

Definition at line 27 of file Vec3.h.

Member Function Documentation

◆ cross()

Vec3 Vec3::cross ( const Vec3 v) const
inline

Definition at line 60 of file Vec3.h.

References Vec3(), x, y, and z.

◆ dot()

double Vec3::dot ( const Vec3 v) const
inline

Definition at line 64 of file Vec3.h.

References x, y, and z.

◆ length()

double Vec3::length ( ) const
inline

Definition at line 29 of file Vec3.h.

References x, y, and z.

Referenced by normalized().

◆ normalized()

Vec3 Vec3::normalized ( ) const
inline

Definition at line 31 of file Vec3.h.

References length(), Vec3(), x, y, and z.

◆ operator*()

Vec3 Vec3::operator* ( const double &  a) const
inline

Definition at line 54 of file Vec3.h.

References Vec3(), x, y, and z.

◆ operator+()

Vec3 Vec3::operator+ ( const Vec3 v) const
inline

Definition at line 50 of file Vec3.h.

References Vec3(), x, y, and z.

◆ operator+=()

void Vec3::operator+= ( const Vec3 v)
inline

Definition at line 36 of file Vec3.h.

References x, y, and z.

◆ operator-() [1/2]

Vec3 Vec3::operator- ( void  ) const
inline

Definition at line 58 of file Vec3.h.

References Vec3(), x, y, and z.

◆ operator-() [2/2]

Vec3 Vec3::operator- ( const Vec3 v) const
inline

Definition at line 46 of file Vec3.h.

References Vec3(), x, y, and z.

◆ operator/()

Vec3 Vec3::operator/ ( const double &  a) const
inline

Definition at line 42 of file Vec3.h.

References Vec3(), x, y, and z.

Member Data Documentation

◆ 

union { ... }

◆ f

double Vec3::f[3]

Definition at line 20 of file Vec3.h.

◆ x

◆ y

◆ z


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