public override Vector3 GetAdjustedCorner(VertexContext context) { if (context.IsCeiling || context.IsFloor) { return(context.Vertex); } else { float adjustment = ComputeAdjustment(context.Vertex); return(context.Vertex + adjustment * context.Normal); } }
/// <summary> /// Adjust the position of this vertex in the original flat wall. Normally only the x and z values of /// original should be altered: altering y runs the risk of degenerate triangles in the wall mesh, so modify /// with caution. Will only be called on the added vertices: the original floor and ceiling vertices cannot /// be modified. /// </summary> /// <param name="original">The original wall vertex.</param> /// <param name="normal">The direction orthogonal to the wall's corner, pointing outwards away from the wall.</param> /// <param name="floorHeight">The height of the floor at this point.</param> /// <param name="ceilingHeight">The height of the ceiling at this point.</param> /// <returns>The new vertex replacing original in the mesh.</returns> public abstract Vector3 GetAdjustedCorner(VertexContext context);
public override Vector3 GetAdjustedCorner(VertexContext context) { return(context.Vertex); }