MXVK Vulkan Framework 0.24.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
mxvk::paramLine3D Struct Reference

Parametric 3D line segment represented by a start point, end point, and direction. More...

#include <mxvk/include/mxvk/mxvk_math.h>

Public Member Functions

vec3D ComputePoint (float t) const
 Compute the point p0 + v * t.
vec3D ComputePoint (float t) const
 Compute the point p0 + v * t.
vec3D ComputePoint (float t, vec3D &out) const
 Compute the point p0 + v * t and write it to out.
vec3D ComputePoint (float t, vec3D &out) const
 Compute the point p0 + v * t and write it to out.
void Init (const vec3D &start, const vec3D &end)
 Initialize from endpoints and derive the direction vector.
void Init (const vec3D &start, const vec3D &end)
 Initialize from endpoints and derive the direction vector.
 paramLine3D ()=default
 Construct an uninitialized line segment.
 paramLine3D ()=default
 Construct an uninitialized line segment.
 paramLine3D (const vec3D &start, const vec3D &end, const vec3D &dir)
 Construct from explicit endpoints and direction.
 paramLine3D (const vec3D &start, const vec3D &end, const vec3D &dir)
 Construct from explicit endpoints and direction.
void Set (const vec3D &start, const vec3D &end, const vec3D &dir)
 Set explicit endpoints and direction.
void Set (const vec3D &start, const vec3D &end, const vec3D &dir)
 Set explicit endpoints and direction.

Public Attributes

vec3D p0
 Segment start point.
vec3D p1
 Segment end point.
vec3D v
 Direction vector, commonly p1 - p0.

Detailed Description

Parametric 3D line segment represented by a start point, end point, and direction.

Definition at line 1068 of file mxvk_math.h.

Constructor & Destructor Documentation

◆ paramLine3D() [1/4]

mxvk::paramLine3D::paramLine3D ( )
default

Construct an uninitialized line segment.

◆ paramLine3D() [2/4]

mxvk::paramLine3D::paramLine3D ( const vec3D & start,
const vec3D & end,
const vec3D & dir )
inline

Construct from explicit endpoints and direction.

Definition at line 1082 of file mxvk_math.h.

1082 {
1083 Set(start, end, dir);
1084 }
void Set(const vec3D &start, const vec3D &end, const vec3D &dir)
Set explicit endpoints and direction.
Definition mxvk_math.h:1087

◆ paramLine3D() [3/4]

mxvk::paramLine3D::paramLine3D ( )
default

Construct an uninitialized line segment.

◆ paramLine3D() [4/4]

mxvk::paramLine3D::paramLine3D ( const vec3D & start,
const vec3D & end,
const vec3D & dir )
inline

Construct from explicit endpoints and direction.

Definition at line 1082 of file mxvk_math_eigen.hpp.

1082 {
1083 Set(start, end, dir);
1084 }

Member Function Documentation

◆ ComputePoint() [1/4]

vec3D mxvk::paramLine3D::ComputePoint ( float t) const
inlinenodiscard

Compute the point p0 + v * t.

Definition at line 1101 of file mxvk_math.h.

1101 {
1102 return p0 + v * t;
1103 }
vec3D p0
Segment start point.
Definition mxvk_math.h:1070
vec3D v
Direction vector, commonly p1 - p0.
Definition mxvk_math.h:1076

◆ ComputePoint() [2/4]

vec3D mxvk::paramLine3D::ComputePoint ( float t) const
inlinenodiscard

Compute the point p0 + v * t.

Definition at line 1101 of file mxvk_math_eigen.hpp.

1101 {
1102 return p0 + v * t;
1103 }

◆ ComputePoint() [3/4]

vec3D mxvk::paramLine3D::ComputePoint ( float t,
vec3D & out ) const
inline

Compute the point p0 + v * t and write it to out.

Definition at line 1106 of file mxvk_math.h.

1106 {
1107 out = ComputePoint(t);
1108 return out;
1109 }
vec3D ComputePoint(float t) const
Compute the point p0 + v * t.
Definition mxvk_math.h:1101

◆ ComputePoint() [4/4]

vec3D mxvk::paramLine3D::ComputePoint ( float t,
vec3D & out ) const
inline

Compute the point p0 + v * t and write it to out.

Definition at line 1106 of file mxvk_math_eigen.hpp.

1106 {
1107 out = ComputePoint(t);
1108 return out;
1109 }

◆ Init() [1/2]

void mxvk::paramLine3D::Init ( const vec3D & start,
const vec3D & end )
inline

Initialize from endpoints and derive the direction vector.

Definition at line 1094 of file mxvk_math.h.

1094 {
1095 p0 = start;
1096 p1 = end;
1097 v = end - start;
1098 }
vec3D p1
Segment end point.
Definition mxvk_math.h:1073

◆ Init() [2/2]

void mxvk::paramLine3D::Init ( const vec3D & start,
const vec3D & end )
inline

Initialize from endpoints and derive the direction vector.

Definition at line 1094 of file mxvk_math_eigen.hpp.

1094 {
1095 p0 = start;
1096 p1 = end;
1097 v = end - start;
1098 }

◆ Set() [1/2]

void mxvk::paramLine3D::Set ( const vec3D & start,
const vec3D & end,
const vec3D & dir )
inline

Set explicit endpoints and direction.

Definition at line 1087 of file mxvk_math.h.

1087 {
1088 p0 = start;
1089 p1 = end;
1090 v = dir;
1091 }

◆ Set() [2/2]

void mxvk::paramLine3D::Set ( const vec3D & start,
const vec3D & end,
const vec3D & dir )
inline

Set explicit endpoints and direction.

Definition at line 1087 of file mxvk_math_eigen.hpp.

1087 {
1088 p0 = start;
1089 p1 = end;
1090 v = dir;
1091 }

Member Data Documentation

◆ p0

vec3D mxvk::paramLine3D::p0

Segment start point.

Definition at line 1070 of file mxvk_math.h.

◆ p1

vec3D mxvk::paramLine3D::p1

Segment end point.

Definition at line 1073 of file mxvk_math.h.

◆ v

vec3D mxvk::paramLine3D::v

Direction vector, commonly p1 - p0.

Definition at line 1076 of file mxvk_math.h.


The documentation for this struct was generated from the following files: