OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::Quaternion Struct Reference

クォータニオン More...

#include <Quaternion.hpp>

Public Member Functions

SIV3D_NODISCARD_CXX20 Quaternion ()=default
 
SIV3D_NODISCARD_CXX20 Quaternion (const Quaternion &)=default
 
SIV3D_NODISCARD_CXX20 Quaternion (float x, float y, float z, float w) noexcept
 
template<class X , class Y , class Z , class W >
SIV3D_NODISCARD_CXX20 Quaternion (X x, Y y, Z z, W w) noexcept
 
SIV3D_CONCEPT_ARITHMETIC SIV3D_NODISCARD_CXX20 Quaternion (const Float3 &axis, Arithmetic angle) noexcept
 
SIV3D_NODISCARD_CXX20 Quaternion (const Mat4x4 &m) noexcept
 
SIV3D_NODISCARD_CXX20 Quaternion (Float4 _vec) noexcept
 
SIV3D_NODISCARD_CXX20 Quaternion (aligned_float4 _vec) noexcept
 
Quaternionoperator= (const Quaternion &)=default
 
Quaternion &SIV3D_VECTOR_CALL operator= (aligned_float4 other) noexcept
 
Quaternion &SIV3D_VECTOR_CALL operator= (SIMD_Float4 other) noexcept
 
Quaternion SIV3D_VECTOR_CALL operator* (Quaternion q) const noexcept
 
Quaternion &SIV3D_VECTOR_CALL operator*= (Quaternion q) noexcept
 
Float3 SIV3D_VECTOR_CALL operator* (Float3 v) const noexcept
 
SIV3D_VECTOR_CALL operator aligned_float4 () const noexcept
 
Float4 SIV3D_VECTOR_CALL toFloat4 () const noexcept
 
float SIV3D_VECTOR_CALL elem (size_t index) const noexcept
 
float SIV3D_VECTOR_CALL getX () const noexcept
 
float SIV3D_VECTOR_CALL getY () const noexcept
 
float SIV3D_VECTOR_CALL getZ () const noexcept
 
float SIV3D_VECTOR_CALL getW () const noexcept
 
void SIV3D_VECTOR_CALL setX (float x) noexcept
 
void SIV3D_VECTOR_CALL setY (float y) noexcept
 
void SIV3D_VECTOR_CALL setZ (float z) noexcept
 
void SIV3D_VECTOR_CALL setW (float w) noexcept
 
void SIV3D_VECTOR_CALL set (float x, float y, float z, float w) noexcept
 
bool SIV3D_VECTOR_CALL isZero () const noexcept
 
bool SIV3D_VECTOR_CALL isIdentity () const noexcept
 
bool SIV3D_VECTOR_CALL hasNaN () const noexcept
 
bool SIV3D_VECTOR_CALL hasInf () const noexcept
 
Quaternion &SIV3D_VECTOR_CALL normalize () noexcept
 
Quaternion SIV3D_VECTOR_CALL normalized () const noexcept
 
Quaternion &SIV3D_VECTOR_CALL conjugate () noexcept
 
Quaternion SIV3D_VECTOR_CALL conjugated () const noexcept
 
Quaternion SIV3D_VECTOR_CALL inverse () const noexcept
 
SIV3D_CONCEPT_FLOATING_POINT Quaternion SIV3D_VECTOR_CALL slerp (Quaternion q, Float t) const noexcept
 
std::pair< Float3, float > SIV3D_VECTOR_CALL toAxisAngle () const noexcept
 

Static Public Member Functions

static Quaternion SIV3D_VECTOR_CALL Identity () noexcept
 
static Quaternion SIV3D_VECTOR_CALL Zero () noexcept
 
static Quaternion SIV3D_VECTOR_CALL FromUnitVectors (const Vec3 &from, const Vec3 &to) noexcept
 
static Quaternion SIV3D_VECTOR_CALL FromUnitVectorPairs (const std::pair< Vec3, Vec3 > &from, const std::pair< Vec3, Vec3 > &to) noexcept
 
template<class X , class Y , class Z >
static Quaternion SIV3D_VECTOR_CALL RollPitchYaw (X pitch, Y yaw, Z roll) noexcept
 
static SIV3D_CONCEPT_ARITHMETIC Quaternion SIV3D_VECTOR_CALL RotationNormal (Float3 normalAxis, Arithmetic angle) noexcept
 
static SIV3D_CONCEPT_ARITHMETIC Quaternion SIV3D_VECTOR_CALL RotationAxis (Float3 axis, Arithmetic angle) noexcept
 
static SIV3D_CONCEPT_ARITHMETIC Quaternion SIV3D_VECTOR_CALL RotateX (Arithmetic angle) noexcept
 
static SIV3D_CONCEPT_ARITHMETIC Quaternion SIV3D_VECTOR_CALL RotateY (Arithmetic angle) noexcept
 
static SIV3D_CONCEPT_ARITHMETIC Quaternion SIV3D_VECTOR_CALL RotateZ (Arithmetic angle) noexcept
 
static Quaternion SIV3D_VECTOR_CALL Rotate (const Mat4x4 &m) noexcept
 

Public Attributes

SIMD_Float4 value = { 0.0f, 0.0f, 0.0f, 1.0f }
 

Friends

Float3 SIV3D_VECTOR_CALL operator* (Float3 v, Quaternion q) noexcept
 
template<class CharType >
std::basic_ostream< CharType > & operator<< (std::basic_ostream< CharType > &output, const Quaternion &value)
 
template<class CharType >
std::basic_istream< CharType > & operator>> (std::basic_istream< CharType > &input, Quaternion &value)
 
void Formatter (FormatData &formatData, const Quaternion &value)
 

Detailed Description

クォータニオン

Constructor & Destructor Documentation

◆ Quaternion() [1/8]

SIV3D_NODISCARD_CXX20 s3d::Quaternion::Quaternion ( )
default

◆ Quaternion() [2/8]

SIV3D_NODISCARD_CXX20 s3d::Quaternion::Quaternion ( const Quaternion )
default

◆ Quaternion() [3/8]

SIV3D_NODISCARD_CXX20 s3d::Quaternion::Quaternion ( float  x,
float  y,
float  z,
float  w 
)
noexcept

◆ Quaternion() [4/8]

template<class X , class Y , class Z , class W >
SIV3D_NODISCARD_CXX20 s3d::Quaternion::Quaternion ( x,
y,
z,
w 
)
noexcept

◆ Quaternion() [5/8]

SIV3D_CONCEPT_ARITHMETIC SIV3D_NODISCARD_CXX20 s3d::Quaternion::Quaternion ( const Float3 axis,
Arithmetic  angle 
)
noexcept

◆ Quaternion() [6/8]

SIV3D_NODISCARD_CXX20 s3d::Quaternion::Quaternion ( const Mat4x4 m)
explicitnoexcept

◆ Quaternion() [7/8]

SIV3D_NODISCARD_CXX20 s3d::Quaternion::Quaternion ( Float4  _vec)
explicitnoexcept

◆ Quaternion() [8/8]

SIV3D_NODISCARD_CXX20 s3d::Quaternion::Quaternion ( aligned_float4  _vec)
noexcept

Member Function Documentation

◆ conjugate()

Quaternion& SIV3D_VECTOR_CALL s3d::Quaternion::conjugate ( )
noexcept

◆ conjugated()

Quaternion SIV3D_VECTOR_CALL s3d::Quaternion::conjugated ( ) const
noexcept

◆ elem()

float SIV3D_VECTOR_CALL s3d::Quaternion::elem ( size_t  index) const
noexcept

◆ FromUnitVectorPairs()

static Quaternion SIV3D_VECTOR_CALL s3d::Quaternion::FromUnitVectorPairs ( const std::pair< Vec3, Vec3 > &  from,
const std::pair< Vec3, Vec3 > &  to 
)
staticnoexcept

◆ FromUnitVectors()

static Quaternion SIV3D_VECTOR_CALL s3d::Quaternion::FromUnitVectors ( const Vec3 from,
const Vec3 to 
)
staticnoexcept

◆ getW()

float SIV3D_VECTOR_CALL s3d::Quaternion::getW ( ) const
noexcept

◆ getX()

float SIV3D_VECTOR_CALL s3d::Quaternion::getX ( ) const
noexcept

◆ getY()

float SIV3D_VECTOR_CALL s3d::Quaternion::getY ( ) const
noexcept

◆ getZ()

float SIV3D_VECTOR_CALL s3d::Quaternion::getZ ( ) const
noexcept

◆ hasInf()

bool SIV3D_VECTOR_CALL s3d::Quaternion::hasInf ( ) const
noexcept

◆ hasNaN()

bool SIV3D_VECTOR_CALL s3d::Quaternion::hasNaN ( ) const
noexcept

◆ Identity()

static Quaternion SIV3D_VECTOR_CALL s3d::Quaternion::Identity ( )
staticnoexcept

◆ inverse()

Quaternion SIV3D_VECTOR_CALL s3d::Quaternion::inverse ( ) const
noexcept

◆ isIdentity()

bool SIV3D_VECTOR_CALL s3d::Quaternion::isIdentity ( ) const
noexcept

◆ isZero()

bool SIV3D_VECTOR_CALL s3d::Quaternion::isZero ( ) const
noexcept

◆ normalize()

Quaternion& SIV3D_VECTOR_CALL s3d::Quaternion::normalize ( )
noexcept

◆ normalized()

Quaternion SIV3D_VECTOR_CALL s3d::Quaternion::normalized ( ) const
noexcept

◆ operator aligned_float4()

SIV3D_VECTOR_CALL s3d::Quaternion::operator aligned_float4 ( ) const
noexcept

◆ operator*() [1/2]

Float3 SIV3D_VECTOR_CALL s3d::Quaternion::operator* ( Float3  v) const
noexcept

◆ operator*() [2/2]

Quaternion SIV3D_VECTOR_CALL s3d::Quaternion::operator* ( Quaternion  q) const
noexcept

◆ operator*=()

Quaternion& SIV3D_VECTOR_CALL s3d::Quaternion::operator*= ( Quaternion  q)
noexcept

◆ operator=() [1/3]

Quaternion& SIV3D_VECTOR_CALL s3d::Quaternion::operator= ( aligned_float4  other)
noexcept

◆ operator=() [2/3]

Quaternion& s3d::Quaternion::operator= ( const Quaternion )
default

◆ operator=() [3/3]

Quaternion& SIV3D_VECTOR_CALL s3d::Quaternion::operator= ( SIMD_Float4  other)
noexcept

◆ RollPitchYaw()

template<class X , class Y , class Z >
static Quaternion SIV3D_VECTOR_CALL s3d::Quaternion::RollPitchYaw ( pitch,
yaw,
roll 
)
staticnoexcept

◆ Rotate()

static Quaternion SIV3D_VECTOR_CALL s3d::Quaternion::Rotate ( const Mat4x4 m)
staticnoexcept

◆ RotateX()

static SIV3D_CONCEPT_ARITHMETIC Quaternion SIV3D_VECTOR_CALL s3d::Quaternion::RotateX ( Arithmetic  angle)
staticnoexcept

◆ RotateY()

static SIV3D_CONCEPT_ARITHMETIC Quaternion SIV3D_VECTOR_CALL s3d::Quaternion::RotateY ( Arithmetic  angle)
staticnoexcept

◆ RotateZ()

static SIV3D_CONCEPT_ARITHMETIC Quaternion SIV3D_VECTOR_CALL s3d::Quaternion::RotateZ ( Arithmetic  angle)
staticnoexcept

◆ RotationAxis()

static SIV3D_CONCEPT_ARITHMETIC Quaternion SIV3D_VECTOR_CALL s3d::Quaternion::RotationAxis ( Float3  axis,
Arithmetic  angle 
)
staticnoexcept

◆ RotationNormal()

static SIV3D_CONCEPT_ARITHMETIC Quaternion SIV3D_VECTOR_CALL s3d::Quaternion::RotationNormal ( Float3  normalAxis,
Arithmetic  angle 
)
staticnoexcept

◆ set()

void SIV3D_VECTOR_CALL s3d::Quaternion::set ( float  x,
float  y,
float  z,
float  w 
)
noexcept

◆ setW()

void SIV3D_VECTOR_CALL s3d::Quaternion::setW ( float  w)
noexcept

◆ setX()

void SIV3D_VECTOR_CALL s3d::Quaternion::setX ( float  x)
noexcept

◆ setY()

void SIV3D_VECTOR_CALL s3d::Quaternion::setY ( float  y)
noexcept

◆ setZ()

void SIV3D_VECTOR_CALL s3d::Quaternion::setZ ( float  z)
noexcept

◆ slerp()

SIV3D_CONCEPT_FLOATING_POINT Quaternion SIV3D_VECTOR_CALL s3d::Quaternion::slerp ( Quaternion  q,
Float  t 
) const
noexcept

◆ toAxisAngle()

std::pair<Float3, float> SIV3D_VECTOR_CALL s3d::Quaternion::toAxisAngle ( ) const
noexcept

◆ toFloat4()

Float4 SIV3D_VECTOR_CALL s3d::Quaternion::toFloat4 ( ) const
noexcept

◆ Zero()

static Quaternion SIV3D_VECTOR_CALL s3d::Quaternion::Zero ( )
staticnoexcept

Friends And Related Function Documentation

◆ Formatter

void Formatter ( FormatData formatData,
const Quaternion value 
)
friend

◆ operator*

Float3 SIV3D_VECTOR_CALL operator* ( Float3  v,
Quaternion  q 
)
friend

◆ operator<<

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

◆ operator>>

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

Member Data Documentation

◆ value

SIMD_Float4 s3d::Quaternion::value = { 0.0f, 0.0f, 0.0f, 1.0f }

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