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

panda/src/linmath/lvec2_ops_src.I

Go to the documentation of this file.
00001 // Filename: lvec2_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 //     Function: scalar * LVecBase2
00021 //  Description:
00022 ////////////////////////////////////////////////////////////////////
00023 INLINE_LINMATH FLOATNAME(LVecBase2)
00024 operator * (FLOATTYPE scalar, const FLOATNAME(LVecBase2) &a) {
00025   return a * scalar;
00026 }
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //     Function: scalar * LPoint2
00030 //  Description:
00031 ////////////////////////////////////////////////////////////////////
00032 INLINE_LINMATH FLOATNAME(LPoint2)
00033 operator * (FLOATTYPE scalar, const FLOATNAME(LPoint2) &a) {
00034   return a * scalar;
00035 }
00036 
00037 ////////////////////////////////////////////////////////////////////
00038 //     Function: scalar * LVector2
00039 //  Description:
00040 ////////////////////////////////////////////////////////////////////
00041 INLINE_LINMATH FLOATNAME(LVector2)
00042 operator * (FLOATTYPE scalar, const FLOATNAME(LVector2) &a) {
00043   return a * scalar;
00044 }
00045 
00046 ////////////////////////////////////////////////////////////////////
00047 //     Function: dot product of LVecBase2
00048 //  Description:
00049 ////////////////////////////////////////////////////////////////////
00050 INLINE_LINMATH FLOATTYPE
00051 dot(const FLOATNAME(LVecBase2) &a, const FLOATNAME(LVecBase2) &b) {
00052   return a.dot(b);
00053 }
00054 
00055 ////////////////////////////////////////////////////////////////////
00056 //     Function: length of a vector
00057 //  Description:
00058 ////////////////////////////////////////////////////////////////////
00059 INLINE_LINMATH FLOATTYPE
00060 length(const FLOATNAME(LVector2) &a) {
00061   return a.length();
00062 }
00063 
00064 ////////////////////////////////////////////////////////////////////
00065 //     Function: normalize
00066 //  Description: Returns a normalized vector from the given vector.
00067 ////////////////////////////////////////////////////////////////////
00068 INLINE_LINMATH FLOATNAME(LVector2)
00069 normalize(const FLOATNAME(LVector2) &v) {
00070   FLOATNAME(LVector2) v1 = v;
00071   v1.normalize();
00072   return v1;
00073 }

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