osg.Vec4i是OpenSceneGraph中用于表示四维整型向量的类。它是osg::Vec4的子类之一。
以下是osg.Vec4i的构造函数:
Vec4i()
无参构造函数,所有分量都初始化为0。Vec4i(const Vec4i& v)
复制构造函数。Vec4i(const int* ptr)
从指针构造四维整型向量。Vec4i(int x, int y, int z, int w)
根据给定的分量构造四维整型向量。以下是osg.Vec4i的常用成员函数:
void set(int x, int y, int z, int w)
设置四维整型向量的分量值。void set(const int* ptr)
从指针设置四维整型向量的值。const int* ptr() const
返回指向四维整型向量数据的指针。int* ptr()
返回指向四维整型向量数据的指针。int x() const
返回x分量的值。int y() const
返回y分量的值。int z() const
返回z分量的值。int w() const
返回w分量的值。int& x()
返回x分量的引用。int& y()
返回y分量的引用。int& z()
返回z分量的引用。int& w()
返回w分量的引用。int& operator[](int i)
返回指定索引处的分量的引用。int operator[](int i) const
返回指定索引处的分量的值。float length() const
返回四维整型向量的长度。int length2() const
返回四维整型向量的长度的平方。osg.Vec4i支持以下运算符重载:
const Vec4i& operator=(const Vec4i& v)
赋值运算符。bool operator==(const Vec4i& v) const
等于运算符。bool operator!=(const Vec4i& v) const
不等于运算符。const Vec4i operator+(const Vec4i& v) const
加法运算符。const Vec4i operator-(const Vec4i& v) const
减法运算符。const Vec4i operator*(int rhs) const
乘法运算符。const Vec4i operator*(const Vec4i& rhs) const
向量点乘运算符。const Vec4i operator/(int rhs) const
除法运算符。const Vec4i operator/(const Vec4i& rhs) const
向量对应分量相除的运算符。