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

Vec4f.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/Vec3f.h"
00018 #include "nvmath/Vecnf.h"
00019 
00020 namespace nvmath
00021 {
00023   class Vec4f : public Vecnf<4>
00024   {
00025     public:
00027 
00028       NVSG_API Vec4f( void );
00029 
00031 
00032       NVSG_API Vec4f( float x   
00033                     , float y   
00034                     , float z   
00035                     , float w   
00036                     );
00037 
00039       NVSG_API Vec4f( const Vec3f &v3 
00040                     , float w         
00041                     );
00042      
00044       NVSG_API Vec4f( const Vecnf<4> &v 
00045                     );
00046 
00048       NVSG_API void set( float x    
00049                        , float y    
00050                        , float z    
00051                        , float w    
00052                        );
00053   };
00054 
00055   // - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
00056   // non-member functions
00057   // - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
00061   inline Vec4f operator*( float f         
00062                         , const Vec4f &v  
00063                         )
00064   {
00065     return( v * f );
00066   }
00067 
00068   // - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
00069   // inlines
00070   // - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
00071   inline Vec4f::Vec4f( void )
00072   {
00073   }
00074 
00075   inline Vec4f::Vec4f( float x, float y, float z, float w )
00076   {
00077     (*this)[0]=x;
00078     (*this)[1]=y;
00079     (*this)[2]=z;
00080     (*this)[3]=w;
00081   }
00082 
00083   inline Vec4f::Vec4f( const Vec3f &v3, float w )
00084   {
00085     (*this)[0] = v3[0];
00086     (*this)[1] = v3[1];
00087     (*this)[2] = v3[2];
00088     (*this)[3] = w;
00089   }
00090 
00091   inline Vec4f::Vec4f( const Vecnf<4> &v )
00092     : Vecnf<4>( v )
00093   {
00094   }
00095 
00096   inline void Vec4f::set( float x, float y, float z, float w )
00097   {
00098     (*this)[0]=x;
00099     (*this)[1]=y;
00100     (*this)[2]=z;
00101     (*this)[3]=w;
00102   }
00103 
00104 } // end namspace nvmath

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