Class Aabb
Represents an Axis-Aligned Bounding Box (AABB) in 3D space.
Inherited Members
Namespace: Genesis.Physics
Assembly: Genesis.dll
Syntax
public class Aabb
Constructors
Aabb()
Creates a new AABB with default values.
Declaration
public Aabb()
Aabb(Vector3, Vector3)
Creates a new AABB with specified minimum and maximum values.
Declaration
public Aabb(Vector3 min, Vector3 max)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | min | Minimum corner |
Vector3 | max | Maximum corner |
Aabb(GameElement)
Creates an new Aabb for an game element using the elements dimensions
Declaration
public Aabb(GameElement element)
Parameters
Type | Name | Description |
---|---|---|
GameElement | element | The element for the Aabb |
Properties
Max
Gets or sets the maximum corner of the AABB.
Declaration
public Vec3 Max { get; set; }
Property Value
Type | Description |
---|---|
Vec3 |
Min
Gets or sets the minimum corner of the AABB.
Declaration
public Vec3 Min { get; set; }
Property Value
Type | Description |
---|---|
Vec3 |
Methods
Contains(Vec3)
Checks if the AABB contains a specified point.
Declaration
public bool Contains(Vec3 v)
Parameters
Type | Name | Description |
---|---|---|
Vec3 | v | Point to check |
Returns
Type | Description |
---|---|
bool | True if the point is inside the AABB, otherwise false |
FromBulletRigidBody(RigidBody)
Returns the AABB of a Bullet rigid body.
Declaration
public static Aabb FromBulletRigidBody(RigidBody rigidBody)
Parameters
Type | Name | Description |
---|---|---|
RigidBody | rigidBody | Bullet RigidBody |
Returns
Type | Description |
---|---|
Aabb | Aabb representing the bounding box of the rigid body |
IntersectRay(Vec3, Vec3, Vec3, Vec3)
Checks if a ray intersects with the AABB.
Declaration
public static bool IntersectRay(Vec3 rayOrigin, Vec3 rayDirection, Vec3 aabbMin, Vec3 aabbMax)
Parameters
Type | Name | Description |
---|---|---|
Vec3 | rayOrigin | Origin of the ray |
Vec3 | rayDirection | Direction of the ray |
Vec3 | aabbMin | Minimum corner of the AABB |
Vec3 | aabbMax | Maximum corner of the AABB |
Returns
Type | Description |
---|---|
bool | True if the ray intersects with the AABB, otherwise false |