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

panda/src/linmath/lvec3_ops_src.I

Go to the documentation of this file.
00001 // Filename: lvec3_ops_src.I
00002 // Created by:  drose (08Mar00)
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 
00020 ////////////////////////////////////////////////////////////////////
00021 //     Function: scalar * LVecBase3
00022 //  Description:
00023 ////////////////////////////////////////////////////////////////////
00024 INLINE_LINMATH FLOATNAME(LVecBase3)
00025 operator * (FLOATTYPE scalar, const FLOATNAME(LVecBase3) &a) {
00026   return a * scalar;
00027 }
00028 
00029 ////////////////////////////////////////////////////////////////////
00030 //     Function: scalar * LPoint3
00031 //  Description:
00032 ////////////////////////////////////////////////////////////////////
00033 INLINE_LINMATH FLOATNAME(LPoint3)
00034 operator * (FLOATTYPE scalar, const FLOATNAME(LPoint3) &a) {
00035   return a * scalar;
00036 }
00037 
00038 ////////////////////////////////////////////////////////////////////
00039 //     Function: scalar * LVector3
00040 //  Description:
00041 ////////////////////////////////////////////////////////////////////
00042 INLINE_LINMATH FLOATNAME(LVector3)
00043 operator * (FLOATTYPE scalar, const FLOATNAME(LVector3) &a) {
00044   return a * scalar;
00045 }
00046 
00047 ////////////////////////////////////////////////////////////////////
00048 //     Function: dot product of LVecBase3
00049 //  Description:
00050 ////////////////////////////////////////////////////////////////////
00051 
00052 INLINE_LINMATH FLOATTYPE
00053 dot(const FLOATNAME(LVecBase3) &a, const FLOATNAME(LVecBase3) &b) {
00054   return a.dot(b);
00055 }
00056 
00057 ////////////////////////////////////////////////////////////////////
00058 //     Function: cross product of LVecBase3
00059 //  Description:
00060 ////////////////////////////////////////////////////////////////////
00061 
00062 INLINE_LINMATH FLOATNAME(LVecBase3)
00063 cross(const FLOATNAME(LVecBase3) &a, const FLOATNAME(LVecBase3) &b) {
00064   return a.cross(b);
00065 }
00066 
00067 ////////////////////////////////////////////////////////////////////
00068 //     Function: cross product of LVector3
00069 //  Description:
00070 ////////////////////////////////////////////////////////////////////
00071 
00072 INLINE_LINMATH FLOATNAME(LVector3)
00073 cross(const FLOATNAME(LVector3) &a, const FLOATNAME(LVector3) &b) {
00074   return FLOATNAME(LVector3)(a.cross(b));
00075 }
00076 
00077 
00078 ////////////////////////////////////////////////////////////////////
00079 //     Function: length of a vector
00080 //  Description:
00081 ////////////////////////////////////////////////////////////////////
00082 
00083 INLINE_LINMATH FLOATTYPE
00084 length(const FLOATNAME(LVector3) &a) {
00085   return a.length();
00086 }
00087 
00088 
00089 ////////////////////////////////////////////////////////////////////
00090 //     Function: normalize
00091 //  Description: Returns a normalized vector from the given vector.
00092 ////////////////////////////////////////////////////////////////////
00093 
00094 INLINE_LINMATH FLOATNAME(LVector3)
00095 normalize(const FLOATNAME(LVector3) &v) {
00096   FLOATNAME(LVector3) v1 = v;
00097   v1.normalize();
00098   return v1;
00099 }

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