예제 #1
0
 public float4(CGUtility.float2 v, float z = 0f, float w = 0f)
 {
     this.x = v.x;
     this.y = v.y;
     this.z = z;
     this.w = w;
 }
예제 #2
0
 private CGUtility.float4 TerrainCoords()
 {
     CGUtility.float2 @float = this.WorldPos.xz;
     if (this.Terrain_Mapping == 1f)
     {
         CGUtility.float2 float2 = this.TransformScale.xz * this.TerrainResolution;
         @float = (@float - (this.TransformPosition.xz - float2 / 2f)) / float2;
     }
     else
     {
         @float = (@float - this.TerrainPosition.xz) / this.TerrainResolution;
     }
     return(new CGUtility.float4(@float, 0f, this.LOD));
 }
예제 #3
0
 protected float distance(CGUtility.float2 a, CGUtility.float2 b)
 {
     return((a - b).magnitude);
 }
예제 #4
0
 protected bool any(CGUtility.float2 v)
 {
     return(v.x != 0f || v.y != 0f);
 }
예제 #5
0
 protected bool all(CGUtility.float2 v)
 {
     return(v.x * v.y != 0f);
 }
예제 #6
0
 public float3(CGUtility.float2 v, float z = 0f)
 {
     this.x = v.x;
     this.y = v.y;
     this.z = z;
 }
예제 #7
0
 protected CGUtility.float2 normalize(CGUtility.float2 v)
 {
     return(v.normalized);
 }
예제 #8
0
 protected float length(CGUtility.float2 v)
 {
     return(v.magnitude);
 }
예제 #9
0
 protected CGUtility.float2 lerp(CGUtility.float2 a, CGUtility.float2 b, float x)
 {
     return(new CGUtility.float2(a.x + (b.x - a.x) * x, a.y + (b.y - a.y) * x));
 }
예제 #10
0
 protected float dot(CGUtility.float2 a, CGUtility.float2 b)
 {
     return(a.x * b.x + a.y * b.y);
 }