Panda3D
rotate_to.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file rotate_to.h
10  * @author drose
11  * @date 1999-11-04
12  */
13 
14 #ifndef ROTATE_TO_H
15 #define ROTATE_TO_H
16 
17 /*
18  * rotate_to() This function computes a suitable rotation matrix to rotate
19  * vector a onto vector b. That is, it computes mat so that a * mat = b. The
20  * rotation axis is chosen to give the smallest possible rotation angle.
21  */
22 
23 #include <math.h>
24 #include "pandabase.h"
25 #include "luse.h"
26 
27 BEGIN_PUBLISH
28 
29 EXPCL_PANDA_MATHUTIL void rotate_to(LMatrix3f &mat, const LVector3f &a, const LVector3f &b);
30 EXPCL_PANDA_MATHUTIL void rotate_to(LMatrix3d &mat, const LVector3d &a, const LVector3d &b);
31 
32 EXPCL_PANDA_MATHUTIL void rotate_to(LMatrix4f &mat, const LVector3f &a, const LVector3f &b);
33 EXPCL_PANDA_MATHUTIL void rotate_to(LMatrix4d &mat, const LVector3d &a, const LVector3d &b);
34 
35 END_PUBLISH
36 
37 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.