53 SbVec3us(
const unsigned short v[3]) { vec[0] = v[0]; vec[1] = v[1]; vec[2] = v[2]; }
54 SbVec3us(
unsigned short x,
unsigned short y,
unsigned short z) { vec[0] = x; vec[1] = y; vec[2] = z; }
59 SbVec3us & setValue(
const unsigned short v[3]) { vec[0] = v[0]; vec[1] = v[1]; vec[2] = v[2];
return *
this; }
60 SbVec3us & setValue(
unsigned short x,
unsigned short y,
unsigned short z) { vec[0] = x; vec[1] = y; vec[2] = z;
return *
this; }
65 const unsigned short * getValue(
void)
const {
return vec; }
66 void getValue(
unsigned short & x,
unsigned short & y,
unsigned short & z)
const { x = vec[0]; y = vec[1]; z = vec[2]; }
69 const unsigned short &
operator [] (
int i)
const {
return vec[
i]; }
71 int32_t dot(
const SbVec3us & v)
const {
return vec[0] * v[0] + vec[1] * v[1] + vec[2] * v[2]; }
74 SbVec3us &
operator *= (
int d) { vec[0] = (
unsigned short)(vec[0] * d); vec[1] = (
unsigned short)(vec[1] * d); vec[2] = (
unsigned short)(vec[2] * d);
return *
this; }
76 SbVec3us &
operator /= (
int d) { SbDividerChk(
"SbVec3us::operator/=(int)", d); vec[0] = (
unsigned short)(vec[0] / d); vec[1] = (
unsigned short)(vec[1] / d); vec[2] = (
unsigned short)(vec[2] / d);
return *
this; }
83 unsigned short vec[3];