Struct AABBd
Represents an axis aligned bounding box.
Inherited Members
Namespace: Fusee.Math.Core
Assembly: Fusee.Math.Core.dll
Syntax
public struct AABBd
Constructors
AABBd(double3, double3)
Create a new axis aligned bounding box.
Declaration
public AABBd(double3 min_, double3 max_)
Parameters
Type | Name | Description |
---|---|---|
double3 | min_ | the minimum x y and z values. |
double3 | max_ | the maximum x y and z values. |
AABBd(ReadOnlySpan<double3>)
Create a new axis aligned bounding box.
Declaration
public AABBd(ReadOnlySpan<double3> vertices)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlySpan<double3> | vertices | The list of vertices the bounding box is created for. |
Fields
max
The maximum values of the axis aligned bounding box in x, y and z direction
Declaration
public double3 max
Field Value
Type | Description |
---|---|
double3 |
min
The minimum values of the axis aligned bounding box in x, y and z direction
Declaration
public double3 min
Field Value
Type | Description |
---|---|
double3 |
Properties
Center
Returns the center of the bounding box
Declaration
public readonly double3 Center { get; }
Property Value
Type | Description |
---|---|
double3 |
Size
Returns the with, height and depth of the box in x, y and z
Declaration
public readonly double3 Size { get; }
Property Value
Type | Description |
---|---|
double3 |
Methods
Equals(Object)
Indicates whether this AABBd is equal to another object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object. This method will throw an exception if the object isn't of type AABBd. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetHashCode()
Generates a hash code for this AABBd.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
InsideOrIntersectingFrustum(FrustumD)
Checks if a viewing frustum lies within or intersects this AABB.
Declaration
public bool InsideOrIntersectingFrustum(FrustumD frustum)
Parameters
Type | Name | Description |
---|---|---|
FrustumD | frustum | The frustum to test against. |
Returns
Type | Description |
---|---|
System.Boolean | false if fully outside, true if inside or intersecting. |
InsideOrIntersectingPlane(PlaneD)
Checks if a plane lies within or intersects this AABB.
Declaration
public bool InsideOrIntersectingPlane(PlaneD plane)
Parameters
Type | Name | Description |
---|---|---|
PlaneD | plane | The plane to test against. |
Returns
Type | Description |
---|---|
System.Boolean | false if fully outside, true if inside or intersecting. |
IntersectRay(RayD)
Checks if a given ray originates in, or intersects this AABB.
Declaration
public bool IntersectRay(RayD ray)
Parameters
Type | Name | Description |
---|---|---|
RayD | ray | The ray to test against. |
Returns
Type | Description |
---|---|
System.Boolean |
Intersects(AABBd)
Check if this AABB intersects with another
Declaration
public bool Intersects(AABBd b)
Parameters
Type | Name | Description |
---|---|---|
AABBd | b |
Returns
Type | Description |
---|---|
System.Boolean |
Intersects(AABBd, AABBd)
Check if two AABBs intersect each other
Declaration
public static bool Intersects(AABBd left, AABBd right)
Parameters
Type | Name | Description |
---|---|---|
AABBd | left | |
AABBd | right |
Returns
Type | Description |
---|---|
System.Boolean |
Intersects(AABBd, double3)
Check if a point lies within a AABB
Declaration
public static bool Intersects(AABBd aabb, double3 point)
Parameters
Type | Name | Description |
---|---|---|
AABBd | aabb | |
double3 | point |
Returns
Type | Description |
---|---|
System.Boolean |
Intersects(double3)
Check if point lies in this AABB
Declaration
public bool Intersects(double3 point)
Parameters
Type | Name | Description |
---|---|---|
double3 | point |
Returns
Type | Description |
---|---|
System.Boolean |
Union(AABBd, AABBd)
Calculates the bounding box around two existing bounding boxes.
Declaration
public static AABBd Union(AABBd a, AABBd b)
Parameters
Type | Name | Description |
---|---|---|
AABBd | a | One of the bounding boxes to build the union from |
AABBd | b | The other bounding box to build the union from |
Returns
Type | Description |
---|---|
AABBd | The smallest axis aligned bounding box containing both input boxes |
Union(AABBd, double3)
Calculates the bounding box around an existing bounding box and a single point.
Declaration
public static AABBd Union(AABBd a, double3 p)
Parameters
Type | Name | Description |
---|---|---|
AABBd | a | The bounding boxes to build the union from. |
double3 | p | The point to be enclosed by the resulting bounding box |
Returns
Type | Description |
---|---|
AABBd | The smallest axis aligned bounding box containing the input box and the point. |
Operators
BitwiseOr(AABBd, AABBd)
Calculates the bounding box around two existing bounding boxes.
Declaration
public static AABBd operator |(AABBd a, AABBd b)
Parameters
Type | Name | Description |
---|---|---|
AABBd | a | One of the bounding boxes to build the union from |
AABBd | b | The other bounding box, to build the union from |
Returns
Type | Description |
---|---|
AABBd | The smallest axis aligned bounding box containing both input boxes |
BitwiseOr(AABBd, double3)
Calculates the bounding box around an existing bounding box and a single point.
Declaration
public static AABBd operator |(AABBd a, double3 p)
Parameters
Type | Name | Description |
---|---|---|
AABBd | a | The bounding boxes to build the union from. |
double3 | p | The point to be enclosed by the resulting bounding box |
Returns
Type | Description |
---|---|
AABBd | The smallest axis aligned bounding box containing the input box and the point. |
Examples
Use this operator e.g. to calculate the bounding box for a given list of points.
AABB box = new AABB(pointList.First(), pointList.First());
foreach (double3 p in pointList)
box |= p;
Equality(AABBd, AABBd)
Operator override for equality.
Declaration
public static bool operator ==(AABBd left, AABBd right)
Parameters
Type | Name | Description |
---|---|---|
AABBd | left | The AABBd. |
AABBd | right | The scalar value. |
Returns
Type | Description |
---|---|
System.Boolean |
Inequality(AABBd, AABBd)
Operator override for inequality.
Declaration
public static bool operator !=(AABBd left, AABBd right)
Parameters
Type | Name | Description |
---|---|---|
AABBd | left | The AABBd. |
AABBd | right | The scalar value. |
Returns
Type | Description |
---|---|
System.Boolean |
Multiply(double4x4, AABBd)
Applies a transformation on the bounding box. After the transformation another axis aligned bounding box results. This is done by transforming all eight vertices of the box and re-aligning to the axes afterwards.
Declaration
public static AABBd operator *(double4x4 m, AABBd box)
Parameters
Type | Name | Description |
---|---|---|
double4x4 | m | The transformation matrix. |
AABBd | box | the box to transform. |
Returns
Type | Description |
---|---|
AABBd | A new axis aligned bounding box. |