00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
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
00057
00061 inline Vec4f operator*( float f
00062 , const Vec4f &v
00063 )
00064 {
00065 return( v * f );
00066 }
00067
00068
00069
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 }