/// <summary>Determines whether this rectangle contains a specified Point.</summary> /// <param name="value">The Point to evaluate.</param> /// <param name="result">[OutAttribute] true if the specified Point is contained within this rectangle; false otherwise.</param> public void Contains(ref vec2 value, out bool result) { result = (value.X >= Left && value.X <= Right && value.Y >= Top && value.Y <= Bottom); }
/// <summary> /// Checks, if specified <see cref="vec2"/> is inside <see cref="RectangleF"/>. /// </summary> /// <param name="vector2D">Coordinate <see cref="vec2"/>.</param> /// <returns><c>true</c> if <see cref="vec2"/> is inside <see cref="RectangleF"/>, otherwise <c>false</c>.</returns> public bool Contains(vec2 vector2D) { return(Contains(vector2D.X, vector2D.Y)); }
/// Merge a point. public void Merge(vec2 point) => Merge(ref point);
/// <summary>Changes the position of the rectangle.</summary> /// <param name="amount">The values to adjust the position of the rectangle by.</param> public void Offset(vec2 amount) { Offset(amount.X, amount.Y); }
/// <summary> /// Gets random <see cref="vec2"/> within range. /// </summary> /// <param name="random">Current <see cref="System.Random"/>.</param> /// <param name="min">Minimum.</param> /// <param name="max">Maximum.</param> /// <returns>Random <see cref="vec2"/>.</returns> public static vec2 NextVector2(this Random random, vec2 min, vec2 max) { return(new vec2(random.NextFloat(min.X, max.X), random.NextFloat(min.Y, max.Y))); }
public VertexPosTexNorm(float px, float py, float pz, float nx, float ny, float nz, float u, float v) { position = new vec3(px, py, pz); texcoord = new vec2(u, v); normal = new vec3(nx, ny, nz); }
public VertexPosTexNorm(vec3 p, vec2 uv, vec3 n) { position = p; normal = n; texcoord = uv; }
public VertexPosTex(float px, float py, float pz, float u, float v) { position = new vec3(px, py, pz); texcoord = new vec2(u, v); }
public VertexPosTex(vec3 p, vec2 uv) { position = p; texcoord = uv; }