public float4( float3 _xyz, double _w )
 {
     x = _xyz.x; y = _xyz.y; z = _xyz.z; w = (float) _w;
 }
Exemple #2
0
 public static float4 _float4( float3 _xyz, double _w )
 {
     return new float4( _xyz, _w );
 }
Exemple #3
0
 public float3 normalize( float3 _value )
 {
     float	InvLength = 1.0f / length( _value ); return _value * InvLength;
 }
Exemple #4
0
 public float length( float3 _value )
 {
     return (float) Math.Sqrt( dot( _value, _value ) );
 }
Exemple #5
0
 public float dot( float3 a, float3 b )
 {
     return a.x*b.x + a.y*b.y + a.z*b.z;
 }
Exemple #6
0
 public float3 cross( float3 a, float3 b )
 {
     return new float3(
             a.y * b.z - a.z * b.y,
             a.z * b.x - a.x * b.z,
             a.x * b.y - a.y * b.x
         );
 }