Panda3D
|
00001 // Filename: rotate_to.h 00002 // Created by: drose (04Nov99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef ROTATE_TO_H 00016 #define ROTATE_TO_H 00017 00018 //////////////////////////////////////////////////////////////////// 00019 // 00020 // rotate_to() 00021 // 00022 // This function computes a suitable rotation matrix to rotate vector 00023 // a onto vector b. That is, it computes mat so that a * mat = b. 00024 // The rotation axis is chosen to give the smallest possible rotation 00025 // angle. 00026 // 00027 //////////////////////////////////////////////////////////////////// 00028 00029 #include <math.h> 00030 #include "pandabase.h" 00031 #include "luse.h" 00032 00033 BEGIN_PUBLISH 00034 00035 EXPCL_PANDA_MATHUTIL void rotate_to(LMatrix3f &mat, const LVector3f &a, const LVector3f &b); 00036 EXPCL_PANDA_MATHUTIL void rotate_to(LMatrix3d &mat, const LVector3d &a, const LVector3d &b); 00037 00038 EXPCL_PANDA_MATHUTIL void rotate_to(LMatrix4f &mat, const LVector3f &a, const LVector3f &b); 00039 EXPCL_PANDA_MATHUTIL void rotate_to(LMatrix4d &mat, const LVector3d &a, const LVector3d &b); 00040 00041 END_PUBLISH 00042 00043 #endif