xcal
基于 C++23 的现代图形渲染引擎
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
Point< T > 模板类 参考final
类 Point< T > 继承关系图:
[图例]
Point< T > 的协作图:
[图例]

Public 成员函数

 Point (T x=T{}, T y=T{})
 
 Point (const vec2 &data)
 
 Point (const Point &o)
 
x () const
 
y () const
 
void setX (T x)
 
void setY (T y)
 
const std::array< T, 2 > & array () const
 
 operator const vec2 & () const
 
- Public 成员函数 继承自 xcmath::vec< _Tp, _length >
constexpr vec ()
 Construct a zero-initialized vector Notw: _Tp must be default constructible
 
template<class _Tp1 , class... _T>
requires (std::is_convertible_v<_Tp1, _Tp> && (std::is_convertible_v<_T, _Tp> && ...))
constexpr vec (const _Tp1 &arg1, const _T &... args)
 Construct from component values
 
template<typename... _Args>
requires ((VecConstructPackSize<_Args...> <= _length && VecConstructPackSize<_Args...> > 1) && ((VecItem<_Args, ItemType> || std::is_convertible_v<_Args, ItemType>) && ...))
constexpr vec (const _Args &... args)
 Construct from mixed scalars and vectors
 
template<class T >
requires (std::is_convertible_v<T, ItemType>)
constexpr vec (const T &fill_value)
 Uniform value constructor
 
constexpr vec (const vec< _Tp, _length > &other)
 Copy constructor
 
constexpr vec (vec< _Tp, _length > &&o)
 Move constructor
 
constexpr vec (const std::initializer_list< ItemType > &list)
 
constexpr const _Tp * begin () const
 Get pointer to the beginning of the data array
 
constexpr const _Tp * end () const
 Get pointer to the end of the data array
 
constexpr _Tp & operator[] (size_t index)
 Access element at specified index
 
constexpr const _Tp & operator[] (size_t index) const
 Access element at specified index (const version)
 
constexpr vec< _Tp, _length > & operator= (const vec< _Tp, _length > &o)
 Copy assignment operator
 
constexpr vec< _Tp, _length > & operator= (vec< _Tp, _length > &&o)
 Move assignment operator
 
template<size_t... idx, class... _Ss>
requires (sizeof...(_Ss) < dim)
constexpr SubVec< sizeof...(idx),(_Ss::length,...)> operator() (Slice< idx... >, _Ss... ns) const
 qualified operator() for slicing and swizzling
 
template<size_t... idx>
constexpr vec< ItemType, sizeof...(idx)> operator() (Slice< idx... > s) const
 qualified operator() for slicing and swizzling (const version)
 
constexpr _Tp & x ()
 Get the item at index 0
 
constexpr _Tp & y ()
 Get the item at index 1
 
constexpr _Tp & z ()
 Get the item at index 2
 
constexpr _Tp & w ()
 Get the item at index 3
 
constexpr const _Tp & x () const
 Get the item at index 0 (const version)
 
constexpr const _Tp & y () const
 Get the item at index 1 (const version)
 
constexpr const _Tp & z () const
 Get the item at index 2 (const version)
 
constexpr const _Tp & w () const
 Get the item at index 3 (const version)
 
constexpr const vec< _Tp, 2 > & xy () const
 
constexpr vec< _Tp, 2 > & xy ()
 
constexpr const vec< _Tp, 2 > & yz () const
 
constexpr vec< _Tp, 2 > & yz ()
 
constexpr const vec< _Tp, 2 > & zw () const
 
constexpr vec< _Tp, 2 > & zw ()
 
constexpr const vec< _Tp, 3 > & xyz () const
 
constexpr vec< _Tp, 3 > & xyz ()
 
constexpr const vec< _Tp, 3 > & yzw () const
 
constexpr vec< _Tp, 3 > & yzw ()
 
constexpr vec< _Tp, 2 > xz () const
 
constexpr vec< _Tp, 2 > xw () const
 
constexpr vec< _Tp, 2 > yw () const
 
constexpr vec< _Tp, _length > cross (const vec< _Tp, _length > &other) const
 Compute 3D cross product
 
constexpr _Tp dot (const vec< _Tp, _length > &other) const
 Compute Euclidean inner product
 
constexpr vec< _Tp, _length > normalize () const
 Create unit vector in same direction
 
constexpr _Tp distance (const vec< _Tp, _length > &other) const
 Compute distance to another vector
 
constexpr _Tp mod () const
 Calculate Euclidean norm (magnitude)
 
constexpr _Tp angle (const vec< _Tp, _length > &other) const
 Compute angle with another vector
 
constexpr bool any () const
 Check if any element satisfies a condition
 
constexpr bool every () const
 Check if all elements satisfy a condition
 
constexpr bool all () const
 Check universal quantification of components
 
template<typename _OTp >
requires (std::is_convertible_v<ItemType, _OTp>)
constexpr operator Self< _OTp > () const
 
auto operator- () const
 Component-wise additive inverse
 
auto operator+ () const
 Unary plus operator
 
auto operator-- ()
 Pre-decrement operator
 
auto & operator-- (int)
 Post-decrement operator
 
auto operator++ ()
 Pre-increment operator
 
auto & operator++ (int)
 Post-increment operator
 

额外继承的成员函数

- Public 类型 继承自 xcmath::vec< _Tp, _length >
using ItemType = _Tp
 Type of elements in the vector
 
using DataType = typename VecInfo< ItemType >::DataType
 Type of data stored in the vector
 
template<size_t __len, size_t... __lens>
using SubVec = __subVecHelper< size_t, __len, __lens... >::Type
 
template<class _T >
using Self = vec< _T, _length >
 
- 静态 Public 属性 继承自 xcmath::vec< _Tp, _length >
static constexpr size_t dim = VecInfo<ItemType>::dim + 1
 
static constexpr auto datatype = TypeName<DataType>
 Name of the data type
 
static constexpr auto itemtype = TypeName<ItemType>
 Name of the item type
 
static constexpr auto length = _length
 Length of the vector
 
- Protected 属性 继承自 xcmath::vec< _Tp, _length >
_Tp data [_length]
 Component storage array
 

详细描述

template<typename T = float>
class Point< T >

在文件 vec.cc260 行定义.

构造及析构函数说明

◆ Point() [1/3]

template<typename T = float>
Point< T >::Point ( x = T{},
y = T{} 
)
inline

在文件 vec.cc264 行定义.

◆ Point() [2/3]

template<typename T = float>
Point< T >::Point ( const vec2 data)
inline

在文件 vec.cc265 行定义.

◆ Point() [3/3]

template<typename T = float>
Point< T >::Point ( const Point< T > &  o)
inline

在文件 vec.cc266 行定义.

成员函数说明

◆ array()

template<typename T = float>
const std::array< T, 2 > & Point< T >::array ( ) const
inline

在文件 vec.cc271 行定义.

◆ operator const vec2 &()

template<typename T = float>
Point< T >::operator const vec2 & ( ) const
inline

在文件 vec.cc272 行定义.

◆ setX()

template<typename T = float>
void Point< T >::setX ( x)
inline

在文件 vec.cc269 行定义.

引用了 xcmath::vec< _Tp, _length >::x() , 以及 Point< T >::x().

◆ setY()

template<typename T = float>
void Point< T >::setY ( y)
inline

在文件 vec.cc270 行定义.

引用了 xcmath::vec< _Tp, _length >::y() , 以及 Point< T >::y().

◆ x()

template<typename T = float>
T Point< T >::x ( ) const
inline

在文件 vec.cc267 行定义.

引用了 xcmath::vec< _Tp, _length >::x().

被这些函数引用 Point< T >::setX().

◆ y()

template<typename T = float>
T Point< T >::y ( ) const
inline

在文件 vec.cc268 行定义.

引用了 xcmath::vec< _Tp, _length >::y().

被这些函数引用 Point< T >::setY().


该类的文档由以下文件生成: