示例#1
0
 /// <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);
 }
示例#2
0
 /// <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));
 }
示例#3
0
 /// Merge a point.
 public void Merge(vec2 point) => Merge(ref point);
示例#4
0
 /// <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);
 }
示例#5
0
 /// <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)));
 }
示例#6
0
 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);
 }
示例#7
0
 public VertexPosTexNorm(vec3 p, vec2 uv, vec3 n)
 {
     position = p;
     normal   = n;
     texcoord = uv;
 }
示例#8
0
 public VertexPosTex(float px, float py, float pz, float u, float v)
 {
     position = new vec3(px, py, pz);
     texcoord = new vec2(u, v);
 }
示例#9
0
 public VertexPosTex(vec3 p, vec2 uv)
 {
     position = p;
     texcoord = uv;
 }