Added summeries to SM.OGL
This commit is contained in:
parent
2aa12f8d25
commit
16366fa015
15 changed files with 363 additions and 27 deletions
|
|
@ -4,21 +4,49 @@ using OpenTK;
|
|||
|
||||
namespace SM.OGL.Mesh
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains information about bounding boxes of meshes
|
||||
/// </summary>
|
||||
public class BoundingBox
|
||||
{
|
||||
public Vector3 Max = Vector3.Zero;
|
||||
/// <summary>
|
||||
/// The minimum corner.
|
||||
/// </summary>
|
||||
public Vector3 Min = Vector3.Zero;
|
||||
/// <summary>
|
||||
/// The maximum corner.
|
||||
/// </summary>
|
||||
public Vector3 Max = Vector3.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// Returns specific configurations of corners
|
||||
/// </summary>
|
||||
/// <param name="x">If true, it takes the X-value of maximum, otherwise the minimum.</param>
|
||||
/// <param name="y">If true, it takes the Y-value of maximum, otherwise the minimum.</param>
|
||||
/// <param name="z">If true, it takes the Z-value of maximum, otherwise the minimum.</param>
|
||||
/// <returns></returns>
|
||||
public Vector3 this[bool x, bool y, bool z] => new Vector3(x ? Max.X : Min.X, y ? Max.Y : Min.Y, z ? Max.Z : Min.Z);
|
||||
|
||||
/// <summary>
|
||||
/// Empty constructor
|
||||
/// </summary>
|
||||
public BoundingBox() {}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the bounding box with predefined min and max values
|
||||
/// </summary>
|
||||
/// <param name="min"></param>
|
||||
/// <param name="max"></param>
|
||||
public BoundingBox(Vector3 min, Vector3 max)
|
||||
{
|
||||
Min = min;
|
||||
Max = max;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the bounding box.
|
||||
/// </summary>
|
||||
/// <param name="vector"></param>
|
||||
public void Update(Vector2 vector)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
|
|
@ -28,6 +56,10 @@ namespace SM.OGL.Mesh
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the bounding box.
|
||||
/// </summary>
|
||||
/// <param name="vector"></param>
|
||||
public void Update(Vector3 vector)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue