public Box2D IntersectWith(ref Box2D other) { return(new Box2D { MinX = System.Math.Max(MinX, other.MinX), MaxX = System.Math.Min(MaxX, other.MaxX), MinY = System.Math.Max(MinY, other.MinY), MaxY = System.Math.Min(MaxY, other.MaxY), }); }
public Box2D IntersectWith(ref Box2D other) { return new Box2D { MinX = System.Math.Max(MinX, other.MinX), MaxX = System.Math.Min(MaxX, other.MaxX), MinY = System.Math.Max(MinY, other.MinY), MaxY = System.Math.Min(MaxY, other.MaxY), }; }
protected PrimitiveRasterizer( RasterizerStateDescription rasterizerState, int multiSampleCount, ShaderOutputInputBindings outputInputBindings, ref Viewport viewport, Func<int, int, bool> fragmentFilter) { RasterizerState = rasterizerState; MultiSampleCount = multiSampleCount; OutputInputBindings = outputInputBindings; ScreenBounds = new Box2D( viewport.TopLeftX, viewport.TopLeftY, viewport.TopLeftX + viewport.Width, viewport.TopLeftY + viewport.Height); FragmentFilter = fragmentFilter; }
private Fragment CreateFragment(int x, int y, FragmentQuadLocation quadLocation, ref Box2D screenBounds) { return new Fragment( _primitive.Vertices, _primitive.PrimitiveID, _primitive.RenderTargetArrayIndex, x, y, quadLocation, screenBounds.IsPointInside(x, y)); }