Panda3D
 All Classes Functions Variables Enumerations
rotate_to.h
1 // Filename: rotate_to.h
2 // Created by: drose (04Nov99)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef ROTATE_TO_H
16 #define ROTATE_TO_H
17 
18 ////////////////////////////////////////////////////////////////////
19 //
20 // rotate_to()
21 //
22 // This function computes a suitable rotation matrix to rotate vector
23 // a onto vector b. That is, it computes mat so that a * mat = b.
24 // The rotation axis is chosen to give the smallest possible rotation
25 // angle.
26 //
27 ////////////////////////////////////////////////////////////////////
28 
29 #include <math.h>
30 #include "pandabase.h"
31 #include "luse.h"
32 
33 BEGIN_PUBLISH
34 
35 EXPCL_PANDA_MATHUTIL void rotate_to(LMatrix3f &mat, const LVector3f &a, const LVector3f &b);
36 EXPCL_PANDA_MATHUTIL void rotate_to(LMatrix3d &mat, const LVector3d &a, const LVector3d &b);
37 
38 EXPCL_PANDA_MATHUTIL void rotate_to(LMatrix4f &mat, const LVector3f &a, const LVector3f &b);
39 EXPCL_PANDA_MATHUTIL void rotate_to(LMatrix4d &mat, const LVector3d &a, const LVector3d &b);
40 
41 END_PUBLISH
42 
43 #endif
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:4716
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
This is a 3-by-3 transform matrix.
Definition: lmatrix.h:4375
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:451
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:746
This is a 3-by-3 transform matrix.
Definition: lmatrix.h:110