35 struct xrt_vec3 ret = {l.
x * r.x, l.y * r.y, l.z * r.z};
40 m_vec3_mul_scalar(struct
xrt_vec3 l, float r)
42 struct xrt_vec3 ret = {l.
x * r, l.y * r, l.z * r};
49 struct xrt_vec3 ret = {l.
x + r.x, l.y + r.y, l.z + r.z};
56 struct xrt_vec3 ret = {l.
x - r.x, l.y - r.y, l.z - r.z};
63 struct xrt_vec3 ret = {l.
x / r.x, l.y / r.y, l.z / r.z};
68 m_vec3_div_scalar(struct
xrt_vec3 l, float r)
70 struct xrt_vec3 ret = {l.
x / r, l.y / r, l.z / r};
77 return l.
x * r.
x + l.
y * r.
y + l.
z * r.
z;
83 return m_vec3_dot(l, l);
89 return sqrtf(m_vec3_len_sqrd(l));
95 float len = m_vec3_len(l);
96 if (len <= FLT_EPSILON) {
110 float dot = m_vec3_dot(l, r);
111 float lengths = m_vec3_len_sqrd(l) * m_vec3_len_sqrd(r);
117 return acosf(dot / lengths);
A 3 element vector with single floats.
Definition: xrt_defines.h:133
float z
Definition: xrt_defines.h:137
uint8_t len
Definition: vive_protocol.h:211
float y
Definition: xrt_defines.h:136
Common defines and enums for XRT.
float x
Definition: xrt_defines.h:135