Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/mathutil/look_at_src.h

Go to the documentation of this file.
00001 // Filename: look_at_src.h
00002 // Created by:  drose (25Sep99)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 // These functions return a matrix that rotates between a coordinate
00020 // system defined with the given forward and up vectors, and the
00021 // standard coordinate system with y-forward and z-up.  They differ
00022 // only in their behavior when the supplied forward and up vectors are
00023 // not perpendicular; in this case, look_at will match the forward
00024 // vector precisely, while heads_up will match the up vector
00025 // precisely.
00026 
00027 // Since these functions only return a rotation matrix, the
00028 // translation component is always zero.  There are flavors of these
00029 // functions that simply return the upper 3x3 part of the matrix, and
00030 // flavors that return the whole 4x4 matrix with a zero bottom row.
00031 
00032 BEGIN_PUBLISH
00033 
00034 EXPCL_PANDA void
00035 heads_up(FLOATNAME(LMatrix3) &mat, const FLOATNAME(LVector3) &fwd,
00036          const FLOATNAME(LVector3) &up = FLOATNAME(LVector3)::up(),
00037          CoordinateSystem cs = CS_default);
00038 EXPCL_PANDA void
00039 look_at(FLOATNAME(LMatrix3) &mat, const FLOATNAME(LVector3) &fwd,
00040         const FLOATNAME(LVector3) &up = FLOATNAME(LVector3)::up(),
00041         CoordinateSystem cs = CS_default);
00042 
00043 INLINE_MATHUTIL void
00044 heads_up(FLOATNAME(LMatrix3) &mat, const FLOATNAME(LVector3) &fwd,
00045          CoordinateSystem cs);
00046 INLINE_MATHUTIL void
00047 look_at(FLOATNAME(LMatrix3) &mat, const FLOATNAME(LVector3) &fwd,
00048         CoordinateSystem cs);
00049 
00050 
00051 INLINE_MATHUTIL void
00052 heads_up(FLOATNAME(LMatrix4) &mat, const FLOATNAME(LVector3) &fwd,
00053          const FLOATNAME(LVector3) &up = FLOATNAME(LVector3)::up(),
00054          CoordinateSystem cs = CS_default);
00055 INLINE_MATHUTIL void
00056 look_at(FLOATNAME(LMatrix4) &mat, const FLOATNAME(LVector3) &fwd,
00057         const FLOATNAME(LVector3) &up = FLOATNAME(LVector3)::up(),
00058         CoordinateSystem cs = CS_default);
00059 
00060 INLINE_MATHUTIL void
00061 heads_up(FLOATNAME(LMatrix4) &mat, const FLOATNAME(LVector3) &fwd,
00062          CoordinateSystem cs);
00063 INLINE_MATHUTIL void
00064 look_at(FLOATNAME(LMatrix4) &mat, const FLOATNAME(LVector3) &fwd,
00065         CoordinateSystem cs);
00066 
00067 
00068 
00069 INLINE_MATHUTIL void
00070 heads_up(FLOATNAME(LQuaternion) &quat, const FLOATNAME(LVector3) &fwd,
00071          const FLOATNAME(LVector3) &up = FLOATNAME(LVector3)::up(),
00072          CoordinateSystem cs = CS_default);
00073 INLINE_MATHUTIL void
00074 look_at(FLOATNAME(LQuaternion) &quat, const FLOATNAME(LVector3) &fwd,
00075         const FLOATNAME(LVector3) &up = FLOATNAME(LVector3)::up(),
00076         CoordinateSystem cs = CS_default);
00077 
00078 INLINE_MATHUTIL void
00079 heads_up(FLOATNAME(LQuaternion) &quat, const FLOATNAME(LVector3) &fwd,
00080          CoordinateSystem cs);
00081 INLINE_MATHUTIL void
00082 look_at(FLOATNAME(LQuaternion) &quat, const FLOATNAME(LVector3) &fwd,
00083         CoordinateSystem cs);
00084 
00085 END_PUBLISH
00086 
00087 #include "look_at_src.I"

Generated on Fri May 2 00:40:29 2003 for Panda by doxygen1.3