Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Vec2f.h

Go to the documentation of this file.
00001 // Copyright NVIDIA Corporation 2002-2004
00002 // TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
00003 // *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
00004 // OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
00005 // AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS
00006 // BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
00007 // WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
00008 // BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
00009 // ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS
00010 // BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES 
00011 
00012 #pragma once
00013 
00015 #include "nvsgcommon.h"
00016 
00017 #include  "nvmath/Vecnf.h"
00018 
00019 namespace nvmath
00020 {
00022   class Vec2f : public Vecnf<2>
00023   {
00024     public:
00026 
00027       NVSG_API Vec2f( void );
00028 
00030 
00031       NVSG_API Vec2f( float x   
00032                     , float y   
00033                     );
00034 
00036       NVSG_API Vec2f( const Vecnf<2> & v );
00037 
00039       NVSG_API void set( float x    
00040                        , float y    
00041                        );
00042   };
00043 
00044   // - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
00045   // non-member functions
00046   // - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
00050   inline Vec2f operator*( float f         
00051                         , const Vec2f &v  
00052                         )
00053   {
00054     return( v * f );
00055   }
00056 
00057   // - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
00058   // inlines
00059   // - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
00060   inline Vec2f::Vec2f( void )
00061   {
00062   }
00063 
00064   inline Vec2f::Vec2f( float x, float y )
00065   {
00066     (*this)[0] = x;
00067     (*this)[1] = y;
00068   }
00069 
00070   inline Vec2f::Vec2f( const Vecnf<2> &v )
00071     : Vecnf<2>( v )
00072   {
00073   }
00074 
00075   inline void Vec2f::set( float x, float y )
00076   {
00077     (*this)[0]=x;
00078     (*this)[1]=y;
00079   }
00080 
00081 } // end namspace nvmath

Generated on Tue Mar 1 13:19:19 2005 for NVSGSDK by NVIDIA