vector3 scene_nodes_translation_data::get_shift(vector3 const& new_plane_point) { if (!is_plain_point_valid()) { set_plain_point(new_plane_point); return vector3_zero(); } vector3 shift = new_plane_point - m_plain_point; set_plain_point(new_plane_point); return reduce_shift_vector(shift); }
/** * @brief Multiply a vector by a matrix, returns a vector * * @param self The vector being multiplied * @param mT The matrix used to do the multiplication */ HYPAPI vector3 * vector3_multiplym4(vector3 *self, const matrix4 *mT) { vector3 vR; vector3_zero(&vR); vR.x = self->x * mT->c00 + self->y * mT->c01 + self->z * mT->c02 + mT->c03; vR.y = self->x * mT->c10 + self->y * mT->c11 + self->z * mT->c12 + mT->c13; vR.z = self->x * mT->c20 + self->y * mT->c21 + self->z * mT->c22 + mT->c23; vector3_set(self, &vR); return self; }