struct MAGES::MeshDeformations::Disc

Overview

A disc in 3D space. More…

struct Disc
{
    // fields

    float3 Position;
    float3 Normal;
    float Radius;

    // methods

    Disc(float3 position, float3 normal, float radius);
    bool GetSideOfPoint(float3 point);

    bool LineSegmentIntersection(
        float3 pointA,
        float3 pointB,
        out float3 intersection
    );
};

Detailed Documentation

A disc in 3D space.

Fields

float3 Position

The position of the disc.

float3 Normal

The normal of the disc.

float Radius

The radius of the disc.

Methods

Disc(float3 position, float3 normal, float radius)

Initializes a new instance of the Disc struct.

Parameters:

position

The position of the disc.

normal

The normal of the disc.

radius

The radius of the disc.

bool GetSideOfPoint(float3 point)

Gets the side of the point relative to the disc.

Parameters:

point

The point.

Returns:

true if the point is on the side the normal is facing.

bool LineSegmentIntersection(
    float3 pointA,
    float3 pointB,
    out float3 intersection
)

Gets the intersection point of a line segment with the disc if exists.

Parameters:

pointA

The first point defining the line segment.

pointB

The second point defining the line segment.

intersection

The interpolation factor t of the intersection point. IntersectionPoint = pointA + t*(pointB - pointA)

Returns:

true if an intersection exists.