/// <summary> /// Constructs a new <see cref="UVRectangle"/> by copying its values from a template. /// </summary> /// <param name="template">The UVRectangle to copy values from</param> public UVRectangle(UVRectangle template) { this.TopLeft = template.TopLeft; this.TopRight = template.TopRight; this.BottomLeft = template.BottomLeft; this.BottomRight = template.BottomRight; }
/// <summary> /// Returns a new <see cref="UVRectangle"/> scaled by multiplying all coordinates with the given scalar. /// </summary> /// <param name="scale">The scalar</param> public UVRectangle ReScaled(float scale) { UVRectangle ret = new UVRectangle(this); ret.ReScale(scale); return(ret); }
/// <summary> /// Returns a new <see cref="UVRectangle"/> rotated by a given angle around a given point. /// </summary> /// <param name="angle">The angle by which to rotate</param> /// <param name="center">The point around which to rotate</param> public UVRectangle Rotated(float angle, Vector2 center) { UVRectangle ret = new UVRectangle(this); ret.Rotate(angle, center); return(ret); }
/// <summary> /// Returns a new <see cref="UVRectangle"/> flipped vertically. /// </summary> public UVRectangle FlippedV() { UVRectangle ret = new UVRectangle(this); ret.FlipV(); return(ret); }
public UVQuadGeometry(IndexedSurface <TVertexData> surface) { this.Size = Vector2.One; this.LineWidth = 1; this.UV = UVRectangle.Default; this.Surface = surface; }
/// <summary> /// Returns a new <see cref="UVRectangle"/> scaled by multiplying all coordinates with the given scalar. /// </summary> /// <param name="scale">The scalar</param> public UVRectangle ReScaled(float scale) { UVRectangle ret = new UVRectangle(this); ret.ReScale(scale); return ret; }
/// <summary> /// Returns a new <see cref="UVRectangle"/> flipped vertically. /// </summary> public UVRectangle FlippedV() { UVRectangle ret = new UVRectangle(this); ret.FlipV(); return ret; }
/// <summary> /// Returns a new <see cref="UVRectangle"/> rotated by a given angle around a given point. /// </summary> /// <param name="angle">The angle by which to rotate</param> /// <param name="center">The point around which to rotate</param> public UVRectangle Rotated(float angle, Vector2 center) { UVRectangle ret = new UVRectangle(this); ret.Rotate(angle, center); return ret; }