JunkBox_Lib++ (for Windows) 1.10.1
Loading...
Searching...
No Matches
Vector4< T > Class Template Reference

#include <Vector.h>

Public Member Functions

 Vector4 (T X=0, T Y=0, T Z=0, T U=0, double N=0.0, double C=1.0, int D=0)
 
virtual ~Vector4 (void)
 
norm2 (void)
 
double norm (void)
 
Vector4< T > normalize (void)
 
void init (double C=1.0)
 
void set (T X, T Y=0, T Z=0, T U=0, double N=0.0, double C=1.0, int D=0)
 
T & element1 (void)
 
T & element2 (void)
 
T & element3 (void)
 
T & element4 (void)
 
T & element (int i)
 
template<typename R >
Vector4< T > & operator= (const Vector4< R > a)
 

Public Attributes

x
 
y
 
z
 
t
 
double n
 ノルム
 
double c
 信頼度
 
int d
 汎用
 

Detailed Description

template<typename T = double>
class jbxl::Vector4< T >

template <typename T=double>> class Vector

4次元ベクトルの定義

Definition at line 706 of file Vector.h.

Constructor & Destructor Documentation

◆ Vector4()

template<typename T = double>
Vector4 ( T X = 0,
T Y = 0,
T Z = 0,
T U = 0,
double N = 0.0,
double C = 1.0,
int D = 0 )
inline

Definition at line 719 of file Vector.h.

719{ set(X, Y, Z, U, N, C, D);}
void set(T X, T Y=0, T Z=0, T U=0, double N=0.0, double C=1.0, int D=0)
Definition Vector.h:764

◆ ~Vector4()

template<typename T = double>
virtual ~Vector4 ( void )
inlinevirtual

Definition at line 720 of file Vector.h.

720{}

Member Function Documentation

◆ element()

template<typename T = double>
T & element ( int i)
inline

Definition at line 734 of file Vector.h.

734{ if(i==1) return x; else if(i==2) return y; else if(i==3) return z; else if(i==4) return t; else return x;}

Referenced by GLTFData::createBinDataAoS(), GLTFData::createBinDataSoA(), and GLTFData::createShellGeometryData().

Here is the caller graph for this function:

◆ element1()

template<typename T = double>
T & element1 ( void )
inline

Definition at line 730 of file Vector.h.

730{ return x;}

◆ element2()

template<typename T = double>
T & element2 ( void )
inline

Definition at line 731 of file Vector.h.

731{ return y;}

◆ element3()

template<typename T = double>
T & element3 ( void )
inline

Definition at line 732 of file Vector.h.

732{ return z;}

◆ element4()

template<typename T = double>
T & element4 ( void )
inline

Definition at line 733 of file Vector.h.

733{ return t;}

◆ init()

template<typename T = double>
void init ( double C = 1.0)
inline

Definition at line 726 of file Vector.h.

726{ x = y = z = t = (T)0; n = 0.0; c = C; d = 0;}
double c
信頼度
Definition Vector.h:715
int d
汎用
Definition Vector.h:716
double n
ノルム
Definition Vector.h:714

◆ norm()

template<typename T = double>
double norm ( void )
inline

Definition at line 723 of file Vector.h.

723{ n = (double)sqrt(x*x + y*y + z*z + t*t); return n;}

Referenced by jbxl::Vector4Dist().

Here is the caller graph for this function:

◆ norm2()

template<typename T = double>
T norm2 ( void )
inline

Definition at line 722 of file Vector.h.

722{ return (x*x + y*y + z*z + t*t);}

◆ normalize()

template<typename T >
Vector4< T > normalize ( void )

Definition at line 740 of file Vector.h.

741{
742 double nrm = (double)sqrt(x*x + y*y + z*z + t*t);
743
744 if (nrm>=Zero_Eps) {
745 x = (T)(x/nrm);
746 y = (T)(y/nrm);
747 z = (T)(z/nrm);
748 t = (T)(t/nrm);
749 n = 1.0;
750 }
751 else {
752 init();
753 }
754
755 return *this;
756}
void init(double C=1.0)
Definition Vector.h:726
double Zero_Eps
1に対して 0とするトレランス
Definition Tolerance.cpp:26

References jbxl::Zero_Eps.

Referenced by jbxl::Vector4Angle().

Here is the caller graph for this function:

◆ operator=()

template<typename T = double>
template<typename R >
Vector4< T > & operator= ( const Vector4< R > a)
inline

Definition at line 736 of file Vector.h.

736{ x=(T)a.x; y=(T)a.y; z=(T)a.z; t=(T)a.t; n=a.n; c=a.c; d=a.d; return *this;}

References Vector4< T >::c, Vector4< T >::d, Vector4< T >::n, Vector4< T >::t, Vector4< T >::x, Vector4< T >::y, and Vector4< T >::z.

◆ set()

template<typename T >
void set ( T X,
T Y = 0,
T Z = 0,
T U = 0,
double N = 0.0,
double C = 1.0,
int D = 0 )
inline

template <typename T> inline void Vector4<T>::set(T X, T Y, T Z, T U, double N, double C, int D)

3次元ベクトルに値をセット.

Definition at line 764 of file Vector.h.

765{
766 x = X;
767 y = Y;
768 z = Z;
769 t = U;
770 n = N;
771 c = C;
772 d = D;
773
774 if (n<=0.0) {
775 n = (double)sqrt(x*x + y*y + z*z + t*t);
776 }
777}

Member Data Documentation

◆ c

◆ d

◆ n

template<typename T = double>
double n

◆ t

◆ x

◆ y

◆ z


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