OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::Vector3D< Type > Struct Template Reference

3 次元のベクトル More...

#include <Vector3D.hpp>

Public Types

using value_type = Type
 ベクトルの要素の型 More...
 

Public Member Functions

SIV3D_NODISCARD_CXX20 Vector3D ()=default
 
SIV3D_NODISCARD_CXX20 Vector3D (const Vector3D &)=default
 
constexpr SIV3D_NODISCARD_CXX20 Vector3D (value_type _x, value_type _y, value_type _z) noexcept
 
template<class X , class Y , class Z >
constexpr SIV3D_NODISCARD_CXX20 Vector3D (X _x, Y _y, Z _z) noexcept
 
template<class U >
constexpr SIV3D_NODISCARD_CXX20 Vector3D (const Vector3D< U > &v) noexcept
 
template<class Z >
constexpr SIV3D_NODISCARD_CXX20 Vector3D (const Vector2D< value_type > &xy, Z _z) noexcept
 
template<class X >
constexpr SIV3D_NODISCARD_CXX20 Vector3D (X _x, const Vector2D< value_type > &yz) noexcept
 
constexpr value_type elem (size_t index) const noexcept
 
value_typegetPointer () noexcept
 
const value_typegetPointer () const noexcept
 
constexpr Vector3Doperator= (const Vector3D &)=default
 
constexpr Vector3D operator+ () const noexcept
 
constexpr Vector3D operator- () const noexcept
 
constexpr Vector3D operator+ (Vector3D v) const noexcept
 
constexpr Vector3D operator- (Vector3D v) const noexcept
 
constexpr Vector3D operator* (value_type s) const noexcept
 
constexpr Vector3D operator* (Vector3D v) const noexcept
 
constexpr Vector3D operator/ (value_type s) const noexcept
 
constexpr Vector3D operator/ (Vector3D v) const noexcept
 
constexpr Vector3Doperator+= (Vector3D v) noexcept
 
constexpr Vector3Doperator-= (Vector3D v) noexcept
 
constexpr Vector3Doperator*= (value_type s) noexcept
 
constexpr Vector3Doperator*= (Vector3D v) noexcept
 
constexpr Vector3Doperator/= (value_type s) noexcept
 
constexpr Vector3Doperator/= (Vector3D v) noexcept
 
constexpr bool epsilonEquals (Vector3D other, value_type epsilon) const noexcept
 
constexpr bool hasSameDirection (Vector3D other) const noexcept
 
constexpr bool hasOppositeDirection (Vector3D other) const noexcept
 
constexpr bool isZero () const noexcept
 ゼロベクトルであるかを返します。 More...
 
bool hasNaN () const noexcept
 NaN である成分を持つかを返します。 More...
 
constexpr value_type minComponent () const noexcept
 最小の成分を返します。 More...
 
constexpr value_type maxComponent () const noexcept
 最大の成分を返します。 More...
 
constexpr void clear () noexcept
 各成分を 0 にセットします。 More...
 
constexpr Vector3Dset (value_type _x, value_type _y, value_type _z) noexcept
 各成分を変更します。 More...
 
constexpr Vector3Dset (Vector3D v) noexcept
 ベクトルを変更します。 More...
 
constexpr Vector3D movedBy (value_type _x, value_type _y, value_type _z) const noexcept
 
constexpr Vector3D movedBy (Vector3D v) const noexcept
 
constexpr Vector3DmoveBy (value_type _x, value_type _y, value_type _z) noexcept
 
constexpr Vector3DmoveBy (Vector3D v) noexcept
 
Vector3D clamped (const Box &box) const noexcept
 
Vector3Dclamp (const Box &box) noexcept
 
constexpr value_type dot (Vector3D v) const noexcept
 
constexpr Vector3D cross (Vector3D v) const noexcept
 
value_type angleTo (Vector3D v) const noexcept
 
constexpr Vector3D projectOnVector (Vector3D v) const noexcept
 
constexpr Vector3D projectOnPlane (Vector3D planeNormal) const noexcept
 
value_type length () const noexcept
 ベクトルの大きさ(長さ)を返します。 More...
 
constexpr value_type lengthSq () const noexcept
 ベクトルの大きさ(長さ)の二乗を返します。 More...
 
value_type invLength () const noexcept
 ベクトルの長さの逆数 (1 / length())を返します。 More...
 
constexpr value_type manhattanLength () const noexcept
 原点からこの位置ベクトルまでの 3 次元マンハッタン距離を返します。 More...
 
constexpr value_type manhattanDistanceFrom (value_type _x, value_type _y, value_type _z) const noexcept
 別の位置ベクトルからの 3 次元マンハッタン距離を返します。 More...
 
constexpr value_type manhattanDistanceFrom (Vector3D v) const noexcept
 別の位置ベクトルからの 3 次元マンハッタン距離を返します。 More...
 
value_type distanceFrom (value_type _x, value_type _y, value_type _z) const noexcept
 別の位置ベクトルからの距離を返します。 More...
 
value_type distanceFrom (Vector3D v) const noexcept
 別の位置ベクトルからの距離を返します。 More...
 
constexpr value_type distanceFromSq (value_type _x, value_type _y, value_type _z) const noexcept
 別の位置ベクトルからの距離の二乗を返します。 More...
 
constexpr value_type distanceFromSq (Vector3D v) const noexcept
 別の位置ベクトルからの距離の二乗を返します。 More...
 
Vector3D withLength (value_type _length) const noexcept
 向きが同じで大きさ(長さ)を変更した新しいベクトルを返します。 More...
 
Vector3DsetLength (value_type _length) noexcept
 ベクトルの向きはそのままで、大きさ(長さ)だけを変更します。 More...
 
Vector3D limitLength (value_type maxLength) const noexcept
 向きが同じで大きさ(長さ)を一定の値以下にした新しいベクトルを返します。 More...
 
Vector3DlimitLengthSelf (value_type maxLength) noexcept
 ベクトルの向きはそのままで、大きさ(長さ)を一定の値以下にします More...
 
Vector3D normalized () const noexcept
 正規化した(大きさを 1 にした)ベクトルを返します。 More...
 
Vector3Dnormalize () noexcept
 自身を正規化(大きさを 1 に)します。 More...
 
constexpr Vector3D getMidpoint (Vector3D other) const noexcept
 
constexpr Vector3D lerp (Vector3D other, value_type f) const noexcept
 
size_t hash () const noexcept
 
constexpr Vector2D< value_typexx () const noexcept
 
constexpr Vector2D< value_typexy () const noexcept
 
constexpr Vector2D< value_typexz () const noexcept
 
constexpr Vector2D< value_typeyx () const noexcept
 
constexpr Vector2D< value_typeyy () const noexcept
 
constexpr Vector2D< value_typeyz () const noexcept
 
constexpr Vector2D< value_typezx () const noexcept
 
constexpr Vector2D< value_typezy () const noexcept
 
constexpr Vector2D< value_typezz () const noexcept
 
constexpr Vector3D xxx () const noexcept
 
constexpr Vector3D xyz () const noexcept
 
constexpr Vector3D xzy () const noexcept
 
constexpr Vector3D yyy () const noexcept
 
constexpr Vector3D yxz () const noexcept
 
constexpr Vector3D yzx () const noexcept
 
constexpr Vector3D zzz () const noexcept
 
constexpr Vector3D zxy () const noexcept
 
constexpr Vector3D zyx () const noexcept
 
constexpr Vector4D< Type > xyz0 () const noexcept
 
constexpr Vector4D< Type > xyz1 () const noexcept
 

Static Public Member Functions

static constexpr Vector3D Zero () noexcept
 Vector3D{ 0, 0, 0 } を返します。 More...
 
static constexpr Vector3D One () noexcept
 Vector3D{ 1, 1, 1 } を返します。 More...
 
static constexpr Vector3D All (value_type value=1) noexcept
 Vector3D{ value, value, value } を返します。 More...
 
static constexpr Vector3D UnitX () noexcept
 Vector3D{ 1, 0, 0 } を返します。 More...
 
static constexpr Vector3D UnitY () noexcept
 Vector3D{ 0, 1, 0 } を返します。 More...
 
static constexpr Vector3D UnitZ () noexcept
 Vector3D{ 0, 0, 1 } を返します。 More...
 
static constexpr Vector3D Left (value_type length=1) noexcept
 Vector3D{ -length, 0, 0 } を返します。 More...
 
static constexpr Vector3D Right (value_type length=1) noexcept
 Vector3D{ length, 0, 0 } を返します。 More...
 
static constexpr Vector3D Up (value_type length=1) noexcept
 Vector3D{ 0, length, 0 } を返します。 More...
 
static constexpr Vector3D Down (value_type length=1) noexcept
 Vector3D{ 0, -length, 0 } を返します。 More...
 
static constexpr Vector3D Forward (value_type length=1) noexcept
 Vector3D{ 0, 0, length } を返します。 More...
 
static constexpr Vector3D Backward (value_type length=1) noexcept
 Vector3D{ 0, 0, -length } を返します。 More...
 
static void _Formatter (FormatData &formatData, const Vector3D &value)
 

Public Attributes

value_type x
 ベクトルの X 成分 More...
 
value_type y
 ベクトルの Y 成分 More...
 
value_type z
 ベクトルの Z 成分 More...
 

Static Public Attributes

static constexpr size_t Dimension = 3
 ベクトルの次元数 More...
 

Friends

SIV3D_CONCEPT_ARITHMETIC constexpr friend Vector3D operator* (Arithmetic s, const Vector3D &v) noexcept
 
constexpr friend bool operator== (const Vector3D &lhs, const Vector3D &rhs) noexcept
 
constexpr friend bool operator!= (const Vector3D &lhs, const Vector3D &rhs) noexcept
 
template<class CharType >
std::basic_ostream< CharType > & operator<< (std::basic_ostream< CharType > &output, const Vector3D &value)
 
template<class CharType >
std::basic_istream< CharType > & operator>> (std::basic_istream< CharType > &input, Vector3D &value)
 
void Formatter (FormatData &formatData, const Vector3D &value)
 

Detailed Description

template<class Type>
struct s3d::Vector3D< Type >

3 次元のベクトル

Template Parameters
Typeベクトルの要素の型

Member Typedef Documentation

◆ value_type

template<class Type >
using s3d::Vector3D< Type >::value_type = Type

ベクトルの要素の型

Constructor & Destructor Documentation

◆ Vector3D() [1/7]

template<class Type >
SIV3D_NODISCARD_CXX20 s3d::Vector3D< Type >::Vector3D ( )
default

◆ Vector3D() [2/7]

template<class Type >
SIV3D_NODISCARD_CXX20 s3d::Vector3D< Type >::Vector3D ( const Vector3D< Type > &  )
default

◆ Vector3D() [3/7]

template<class Type >
constexpr SIV3D_NODISCARD_CXX20 s3d::Vector3D< Type >::Vector3D ( value_type  _x,
value_type  _y,
value_type  _z 
)
constexprnoexcept

◆ Vector3D() [4/7]

template<class Type >
template<class X , class Y , class Z >
constexpr SIV3D_NODISCARD_CXX20 s3d::Vector3D< Type >::Vector3D ( _x,
_y,
_z 
)
constexprnoexcept

◆ Vector3D() [5/7]

template<class Type >
template<class U >
constexpr SIV3D_NODISCARD_CXX20 s3d::Vector3D< Type >::Vector3D ( const Vector3D< U > &  v)
constexprnoexcept

◆ Vector3D() [6/7]

template<class Type >
template<class Z >
constexpr SIV3D_NODISCARD_CXX20 s3d::Vector3D< Type >::Vector3D ( const Vector2D< value_type > &  xy,
_z 
)
constexprnoexcept

◆ Vector3D() [7/7]

template<class Type >
template<class X >
constexpr SIV3D_NODISCARD_CXX20 s3d::Vector3D< Type >::Vector3D ( _x,
const Vector2D< value_type > &  yz 
)
constexprnoexcept

Member Function Documentation

◆ _Formatter()

template<class Type >
static void s3d::Vector3D< Type >::_Formatter ( FormatData formatData,
const Vector3D< Type > &  value 
)
static

◆ All()

template<class Type >
static constexpr Vector3D s3d::Vector3D< Type >::All ( value_type  value = 1)
staticconstexprnoexcept

Vector3D{ value, value, value } を返します。

Returns
Vector3D{ value, value, value }

◆ angleTo()

template<class Type >
value_type s3d::Vector3D< Type >::angleTo ( Vector3D< Type >  v) const
noexcept

◆ Backward()

template<class Type >
static constexpr Vector3D s3d::Vector3D< Type >::Backward ( value_type  length = 1)
staticconstexprnoexcept

Vector3D{ 0, 0, -length } を返します。

Returns
Vector3D{ 0, 0, -length }

◆ clamp()

template<class Type >
Vector3D& s3d::Vector3D< Type >::clamp ( const Box box)
noexcept

◆ clamped()

template<class Type >
Vector3D s3d::Vector3D< Type >::clamped ( const Box box) const
noexcept

◆ clear()

template<class Type >
constexpr void s3d::Vector3D< Type >::clear ( )
constexprnoexcept

各成分を 0 にセットします。

◆ cross()

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::cross ( Vector3D< Type >  v) const
constexprnoexcept

◆ distanceFrom() [1/2]

template<class Type >
value_type s3d::Vector3D< Type >::distanceFrom ( value_type  _x,
value_type  _y,
value_type  _z 
) const
noexcept

別の位置ベクトルからの距離を返します。

Parameters
_x別の位置ベクトルの X 成分
_y別の位置ベクトルの Y 成分
_z別の位置ベクトルの Z 成分
Returns
別の位置ベクトルからの距離

◆ distanceFrom() [2/2]

template<class Type >
value_type s3d::Vector3D< Type >::distanceFrom ( Vector3D< Type >  v) const
noexcept

別の位置ベクトルからの距離を返します。

Parameters
v別の位置ベクトル
Returns
別の位置ベクトルからの距離

◆ distanceFromSq() [1/2]

template<class Type >
constexpr value_type s3d::Vector3D< Type >::distanceFromSq ( value_type  _x,
value_type  _y,
value_type  _z 
) const
constexprnoexcept

別の位置ベクトルからの距離の二乗を返します。

Parameters
_x別の位置ベクトルの X 成分
_y別の位置ベクトルの Y 成分
_z別の位置ベクトルの Z 成分
Remarks
平方根を計算しないため distanceFrom() より高速です。
Returns
別の位置ベクトルからの距離の二乗

◆ distanceFromSq() [2/2]

template<class Type >
constexpr value_type s3d::Vector3D< Type >::distanceFromSq ( Vector3D< Type >  v) const
constexprnoexcept

別の位置ベクトルからの距離の二乗を返します。

Parameters
v別の位置ベクトル
Remarks
平方根を計算しないため distanceFrom() より高速です。
Returns
別の位置ベクトルからの距離の二乗

◆ dot()

template<class Type >
constexpr value_type s3d::Vector3D< Type >::dot ( Vector3D< Type >  v) const
constexprnoexcept

◆ Down()

template<class Type >
static constexpr Vector3D s3d::Vector3D< Type >::Down ( value_type  length = 1)
staticconstexprnoexcept

Vector3D{ 0, -length, 0 } を返します。

Returns
Vector3D{ 0, -length, 0 }

◆ elem()

template<class Type >
constexpr value_type s3d::Vector3D< Type >::elem ( size_t  index) const
constexprnoexcept

◆ epsilonEquals()

template<class Type >
constexpr bool s3d::Vector3D< Type >::epsilonEquals ( Vector3D< Type >  other,
value_type  epsilon 
) const
constexprnoexcept

◆ Forward()

template<class Type >
static constexpr Vector3D s3d::Vector3D< Type >::Forward ( value_type  length = 1)
staticconstexprnoexcept

Vector3D{ 0, 0, length } を返します。

Returns
Vector3D{ 0, 0, length }

◆ getMidpoint()

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::getMidpoint ( Vector3D< Type >  other) const
constexprnoexcept

◆ getPointer() [1/2]

template<class Type >
const value_type* s3d::Vector3D< Type >::getPointer ( ) const
noexcept

◆ getPointer() [2/2]

template<class Type >
value_type* s3d::Vector3D< Type >::getPointer ( )
noexcept

◆ hash()

template<class Type >
size_t s3d::Vector3D< Type >::hash ( ) const
noexcept

◆ hasNaN()

template<class Type >
bool s3d::Vector3D< Type >::hasNaN ( ) const
noexcept

NaN である成分を持つかを返します。

Returns
NaN である成分を持つ場合 true, それ以外の場合は false

◆ hasOppositeDirection()

template<class Type >
constexpr bool s3d::Vector3D< Type >::hasOppositeDirection ( Vector3D< Type >  other) const
constexprnoexcept

◆ hasSameDirection()

template<class Type >
constexpr bool s3d::Vector3D< Type >::hasSameDirection ( Vector3D< Type >  other) const
constexprnoexcept

◆ invLength()

template<class Type >
value_type s3d::Vector3D< Type >::invLength ( ) const
noexcept

ベクトルの長さの逆数 (1 / length())を返します。

Returns
ベクトルの長さの逆数

◆ isZero()

template<class Type >
constexpr bool s3d::Vector3D< Type >::isZero ( ) const
constexprnoexcept

ゼロベクトルであるかを返します。

Returns
ゼロベクトルである場合 true, それ以外の場合は false

◆ Left()

template<class Type >
static constexpr Vector3D s3d::Vector3D< Type >::Left ( value_type  length = 1)
staticconstexprnoexcept

Vector3D{ -length, 0, 0 } を返します。

Returns
Vector3D{ -length, 0, 0 }

◆ length()

template<class Type >
value_type s3d::Vector3D< Type >::length ( ) const
noexcept

ベクトルの大きさ(長さ)を返します。

Returns
ベクトルの大きさ(長さ)

◆ lengthSq()

template<class Type >
constexpr value_type s3d::Vector3D< Type >::lengthSq ( ) const
constexprnoexcept

ベクトルの大きさ(長さ)の二乗を返します。

Remarks
平方根を計算しないため length() より高速です。
Returns
ベクトルの大きさ(長さ)の二乗

◆ lerp()

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::lerp ( Vector3D< Type >  other,
value_type  f 
) const
constexprnoexcept

◆ limitLength()

template<class Type >
Vector3D s3d::Vector3D< Type >::limitLength ( value_type  maxLength) const
noexcept

向きが同じで大きさ(長さ)を一定の値以下にした新しいベクトルを返します。

Parameters
maxLengthベクトルの最大の大きさ(長さ)
Returns
大きさ(長さ)を一定の値以下にした新しいベクトル

◆ limitLengthSelf()

template<class Type >
Vector3D& s3d::Vector3D< Type >::limitLengthSelf ( value_type  maxLength)
noexcept

ベクトルの向きはそのままで、大きさ(長さ)を一定の値以下にします

Parameters
maxLengthベクトルの最大の大きさ(長さ)
Returns
*this

◆ manhattanDistanceFrom() [1/2]

template<class Type >
constexpr value_type s3d::Vector3D< Type >::manhattanDistanceFrom ( value_type  _x,
value_type  _y,
value_type  _z 
) const
constexprnoexcept

別の位置ベクトルからの 3 次元マンハッタン距離を返します。

Parameters
_x別の位置ベクトルの X 成分
_y別の位置ベクトルの Y 成分
_z別の位置ベクトルの Z 成分
Returns
別の位置ベクトルからの 3 次元マンハッタン距離

◆ manhattanDistanceFrom() [2/2]

template<class Type >
constexpr value_type s3d::Vector3D< Type >::manhattanDistanceFrom ( Vector3D< Type >  v) const
constexprnoexcept

別の位置ベクトルからの 3 次元マンハッタン距離を返します。

Parameters
v別の位置ベクトル
Returns
別の位置ベクトルからの 3 次元マンハッタン距離

◆ manhattanLength()

template<class Type >
constexpr value_type s3d::Vector3D< Type >::manhattanLength ( ) const
constexprnoexcept

原点からこの位置ベクトルまでの 3 次元マンハッタン距離を返します。

Returns
原点からの 3 次元マンハッタン距離

◆ maxComponent()

template<class Type >
constexpr value_type s3d::Vector3D< Type >::maxComponent ( ) const
constexprnoexcept

最大の成分を返します。

Returns
最大の成分

◆ minComponent()

template<class Type >
constexpr value_type s3d::Vector3D< Type >::minComponent ( ) const
constexprnoexcept

最小の成分を返します。

Returns
最小の成分

◆ moveBy() [1/2]

template<class Type >
constexpr Vector3D& s3d::Vector3D< Type >::moveBy ( value_type  _x,
value_type  _y,
value_type  _z 
)
constexprnoexcept

◆ moveBy() [2/2]

template<class Type >
constexpr Vector3D& s3d::Vector3D< Type >::moveBy ( Vector3D< Type >  v)
constexprnoexcept

◆ movedBy() [1/2]

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::movedBy ( value_type  _x,
value_type  _y,
value_type  _z 
) const
constexprnoexcept

◆ movedBy() [2/2]

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::movedBy ( Vector3D< Type >  v) const
constexprnoexcept

◆ normalize()

template<class Type >
Vector3D& s3d::Vector3D< Type >::normalize ( )
noexcept

自身を正規化(大きさを 1 に)します。

Returns
*this

◆ normalized()

template<class Type >
Vector3D s3d::Vector3D< Type >::normalized ( ) const
noexcept

正規化した(大きさを 1 にした)ベクトルを返します。

Returns
正規化した(大きさを 1 にした)ベクトル

◆ One()

template<class Type >
static constexpr Vector3D s3d::Vector3D< Type >::One ( )
staticconstexprnoexcept

Vector3D{ 1, 1, 1 } を返します。

Returns
Vector3D{ 1, 1, 1 }

◆ operator*() [1/2]

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::operator* ( value_type  s) const
constexprnoexcept

◆ operator*() [2/2]

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::operator* ( Vector3D< Type >  v) const
constexprnoexcept

◆ operator*=() [1/2]

template<class Type >
constexpr Vector3D& s3d::Vector3D< Type >::operator*= ( value_type  s)
constexprnoexcept

◆ operator*=() [2/2]

template<class Type >
constexpr Vector3D& s3d::Vector3D< Type >::operator*= ( Vector3D< Type >  v)
constexprnoexcept

◆ operator+() [1/2]

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::operator+ ( ) const
constexprnoexcept

◆ operator+() [2/2]

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::operator+ ( Vector3D< Type >  v) const
constexprnoexcept

◆ operator+=()

template<class Type >
constexpr Vector3D& s3d::Vector3D< Type >::operator+= ( Vector3D< Type >  v)
constexprnoexcept

◆ operator-() [1/2]

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::operator- ( ) const
constexprnoexcept

◆ operator-() [2/2]

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::operator- ( Vector3D< Type >  v) const
constexprnoexcept

◆ operator-=()

template<class Type >
constexpr Vector3D& s3d::Vector3D< Type >::operator-= ( Vector3D< Type >  v)
constexprnoexcept

◆ operator/() [1/2]

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::operator/ ( value_type  s) const
constexprnoexcept

◆ operator/() [2/2]

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::operator/ ( Vector3D< Type >  v) const
constexprnoexcept

◆ operator/=() [1/2]

template<class Type >
constexpr Vector3D& s3d::Vector3D< Type >::operator/= ( value_type  s)
constexprnoexcept

◆ operator/=() [2/2]

template<class Type >
constexpr Vector3D& s3d::Vector3D< Type >::operator/= ( Vector3D< Type >  v)
constexprnoexcept

◆ operator=()

template<class Type >
constexpr Vector3D& s3d::Vector3D< Type >::operator= ( const Vector3D< Type > &  )
constexprdefault

◆ projectOnPlane()

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::projectOnPlane ( Vector3D< Type >  planeNormal) const
constexprnoexcept

◆ projectOnVector()

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::projectOnVector ( Vector3D< Type >  v) const
constexprnoexcept

◆ Right()

template<class Type >
static constexpr Vector3D s3d::Vector3D< Type >::Right ( value_type  length = 1)
staticconstexprnoexcept

Vector3D{ length, 0, 0 } を返します。

Returns
Vector3D{ length, 0, 0 }

◆ set() [1/2]

template<class Type >
constexpr Vector3D& s3d::Vector3D< Type >::set ( value_type  _x,
value_type  _y,
value_type  _z 
)
constexprnoexcept

各成分を変更します。

Parameters
_x新しい X 成分
_y新しい Y 成分
_z新しい Z 成分
Returns
*this

◆ set() [2/2]

template<class Type >
constexpr Vector3D& s3d::Vector3D< Type >::set ( Vector3D< Type >  v)
constexprnoexcept

ベクトルを変更します。

Parameters
v新しいベクトル
Returns
*this

◆ setLength()

template<class Type >
Vector3D& s3d::Vector3D< Type >::setLength ( value_type  _length)
noexcept

ベクトルの向きはそのままで、大きさ(長さ)だけを変更します。

Parameters
_lengthベクトルの大きさ(長さ)
Remarks
自身がゼロベクトルの場合は何もしません。
Returns
*this

◆ UnitX()

template<class Type >
static constexpr Vector3D s3d::Vector3D< Type >::UnitX ( )
staticconstexprnoexcept

Vector3D{ 1, 0, 0 } を返します。

Returns
Vector3D{ 1, 0, 0 }

◆ UnitY()

template<class Type >
static constexpr Vector3D s3d::Vector3D< Type >::UnitY ( )
staticconstexprnoexcept

Vector3D{ 0, 1, 0 } を返します。

Returns
Vector3D{ 0, 1, 0 }

◆ UnitZ()

template<class Type >
static constexpr Vector3D s3d::Vector3D< Type >::UnitZ ( )
staticconstexprnoexcept

Vector3D{ 0, 0, 1 } を返します。

Returns
Vector3D{ 0, 0, 1 }

◆ Up()

template<class Type >
static constexpr Vector3D s3d::Vector3D< Type >::Up ( value_type  length = 1)
staticconstexprnoexcept

Vector3D{ 0, length, 0 } を返します。

Returns
Vector3D{ 0, length, 0 }

◆ withLength()

template<class Type >
Vector3D s3d::Vector3D< Type >::withLength ( value_type  _length) const
noexcept

向きが同じで大きさ(長さ)を変更した新しいベクトルを返します。

Parameters
_lengthベクトルの大きさ(長さ)
Returns
新しいベクトル。自身がゼロベクトルの場合はゼロベクトル

◆ xx()

template<class Type >
constexpr Vector2D<value_type> s3d::Vector3D< Type >::xx ( ) const
constexprnoexcept

◆ xxx()

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::xxx ( ) const
constexprnoexcept

◆ xy()

template<class Type >
constexpr Vector2D<value_type> s3d::Vector3D< Type >::xy ( ) const
constexprnoexcept

◆ xyz()

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::xyz ( ) const
constexprnoexcept

◆ xyz0()

template<class Type >
constexpr Vector4D<Type> s3d::Vector3D< Type >::xyz0 ( ) const
constexprnoexcept

◆ xyz1()

template<class Type >
constexpr Vector4D<Type> s3d::Vector3D< Type >::xyz1 ( ) const
constexprnoexcept

◆ xz()

template<class Type >
constexpr Vector2D<value_type> s3d::Vector3D< Type >::xz ( ) const
constexprnoexcept

◆ xzy()

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::xzy ( ) const
constexprnoexcept

◆ yx()

template<class Type >
constexpr Vector2D<value_type> s3d::Vector3D< Type >::yx ( ) const
constexprnoexcept

◆ yxz()

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::yxz ( ) const
constexprnoexcept

◆ yy()

template<class Type >
constexpr Vector2D<value_type> s3d::Vector3D< Type >::yy ( ) const
constexprnoexcept

◆ yyy()

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::yyy ( ) const
constexprnoexcept

◆ yz()

template<class Type >
constexpr Vector2D<value_type> s3d::Vector3D< Type >::yz ( ) const
constexprnoexcept

◆ yzx()

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::yzx ( ) const
constexprnoexcept

◆ Zero()

template<class Type >
static constexpr Vector3D s3d::Vector3D< Type >::Zero ( )
staticconstexprnoexcept

Vector3D{ 0, 0, 0 } を返します。

Returns
Vector3D{ 0, 0, 0 }

◆ zx()

template<class Type >
constexpr Vector2D<value_type> s3d::Vector3D< Type >::zx ( ) const
constexprnoexcept

◆ zxy()

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::zxy ( ) const
constexprnoexcept

◆ zy()

template<class Type >
constexpr Vector2D<value_type> s3d::Vector3D< Type >::zy ( ) const
constexprnoexcept

◆ zyx()

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::zyx ( ) const
constexprnoexcept

◆ zz()

template<class Type >
constexpr Vector2D<value_type> s3d::Vector3D< Type >::zz ( ) const
constexprnoexcept

◆ zzz()

template<class Type >
constexpr Vector3D s3d::Vector3D< Type >::zzz ( ) const
constexprnoexcept

Friends And Related Function Documentation

◆ Formatter

template<class Type >
void Formatter ( FormatData formatData,
const Vector3D< Type > &  value 
)
friend

◆ operator!=

template<class Type >
constexpr friend bool operator!= ( const Vector3D< Type > &  lhs,
const Vector3D< Type > &  rhs 
)
friend

◆ operator*

template<class Type >
SIV3D_CONCEPT_ARITHMETIC constexpr friend Vector3D operator* ( Arithmetic  s,
const Vector3D< Type > &  v 
)
friend

◆ operator<<

template<class Type >
template<class CharType >
std::basic_ostream<CharType>& operator<< ( std::basic_ostream< CharType > &  output,
const Vector3D< Type > &  value 
)
friend

◆ operator==

template<class Type >
constexpr friend bool operator== ( const Vector3D< Type > &  lhs,
const Vector3D< Type > &  rhs 
)
friend

◆ operator>>

template<class Type >
template<class CharType >
std::basic_istream<CharType>& operator>> ( std::basic_istream< CharType > &  input,
Vector3D< Type > &  value 
)
friend

Member Data Documentation

◆ Dimension

template<class Type >
constexpr size_t s3d::Vector3D< Type >::Dimension = 3
staticconstexpr

ベクトルの次元数

◆ x

template<class Type >
value_type s3d::Vector3D< Type >::x

ベクトルの X 成分

◆ y

template<class Type >
value_type s3d::Vector3D< Type >::y

ベクトルの Y 成分

◆ z

template<class Type >
value_type s3d::Vector3D< Type >::z

ベクトルの Z 成分


The documentation for this struct was generated from the following files: