Assets/Scripts/MarchingCubesJob.cs
/// <summary>
/// Interpolates the vertex's position 
/// </summary>
/// <param name="p1">The first corner's position</param>
/// <param name="p2">The second corner's position</param>
/// <param name="v1">The first corner's density</param>
/// <param name="v2">The second corner's density</param>
/// <param name="isolevel">The density level where a surface will be created. Densities below this will be inside the surface (solid),
/// and densities above this will be outside the surface (air)</param>
/// <returns>The interpolated vertex's position</returns>
Interpolates the vertex's position
Interpolates the vertex ' s position
[MethodImpl(MethodImplOptions.AggressiveInlining)]
        private float3 VertexInterpolate(float3 p1, float3 p2, float v1, float v2, float isolevel)
        {
            return p1 + (isolevel - v1) * (p2 - p1) / (v2 - v1);
        }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] private float3 VertexInterpolate ( float3 p1 , float3 p2 , float v1 , float v2 , float isolevel ) { return p1 + ( isolevel - v1 ) * ( p2 - p1 ) / ( v2 - v1 ) ; }
Interpolates the vertex's position
Interpolates the vertex ' s position
The interpolated vertex's position
The interpolated vertex ' s position
p1
float3
The first corner's position
The first corner ' s position
p2
float3
The second corner's position
The second corner ' s position
v1
float
The first corner's density
The first corner ' s density
v2
float
The second corner's density
The second corner ' s density
isolevel
float
The density level where a surface will be created. Densities below this will be inside the surface (solid),
and densities above this will be outside the surface (air)
The density level where a surface will be created . Densities below this will be inside the surface ( solid ) and densities above this will be outside the surface ( air )