accept quats

This commit is contained in:
David Rose 2002-06-21 22:04:34 +00:00
parent c5f477c043
commit 5bfe55d22f
2 changed files with 16 additions and 2 deletions

View File

@ -135,9 +135,22 @@ add_rotz(double angle) {
////////////////////////////////////////////////////////////////////
void EggTransform3d::
add_rotate(double angle, const LVector3d &axis) {
LVector3d normaxis = normalize(axis);
_components.push_back(Component(CT_rotate, angle));
_components.back()._vector = new LVector3d(axis);
_transform *= LMatrix4d::rotate_mat(angle, axis);
_components.back()._vector = new LVector3d(normaxis);
_transform *= LMatrix4d::rotate_mat(angle, normaxis);
}
////////////////////////////////////////////////////////////////////
// Function: EggTransform3d::add_rotate
// Access: Public
// Description: Appends an arbitrary rotation to the current
// transform, expressed as a quaternion. This is
// converted to axis-angle notation for the egg file.
////////////////////////////////////////////////////////////////////
void EggTransform3d::
add_rotate(const LQuaterniond &quat) {
add_rotate(quat.get_angle(), quat.get_axis());
}
////////////////////////////////////////////////////////////////////

View File

@ -44,6 +44,7 @@ public:
void add_roty(double angle);
void add_rotz(double angle);
void add_rotate(double angle, const LVector3d &axis);
void add_rotate(const LQuaterniond &quat);
void add_scale(const LVecBase3d &scale);
void add_uniform_scale(double scale);
void add_matrix(const LMatrix4d &mat);