MXVK Vulkan Framework 0.35.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 950 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 964 of file mxvk_math.h.

964{ Set(start, end, dir); }
void Set(const vec3D &start, const vec3D &end, const vec3D &dir)
Set explicit endpoints and direction.
Definition mxvk_math.h:967

◆ 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 930 of file mxvk_math_eigen.hpp.

930{ Set(start, end, dir); }

Member Function Documentation

◆ ComputePoint() [1/4]

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

Compute the point p0 + v * t.

Definition at line 981 of file mxvk_math.h.

981{ return p0 + v * t; }
vec3D p0
Segment start point.
Definition mxvk_math.h:952
vec3D v
Direction vector, commonly p1 - p0.
Definition mxvk_math.h:958

◆ ComputePoint() [2/4]

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

Compute the point p0 + v * t.

Definition at line 947 of file mxvk_math_eigen.hpp.

947{ return p0 + v * t; }

◆ 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 984 of file mxvk_math.h.

984 {
985 out = ComputePoint(t);
986 return out;
987 }
vec3D ComputePoint(float t) const
Compute the point p0 + v * t.
Definition mxvk_math.h:981

◆ 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 950 of file mxvk_math_eigen.hpp.

950 {
951 out = ComputePoint(t);
952 return out;
953 }

◆ 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 974 of file mxvk_math.h.

974 {
975 p0 = start;
976 p1 = end;
977 v = end - start;
978 }
vec3D p1
Segment end point.
Definition mxvk_math.h:955

◆ 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 940 of file mxvk_math_eigen.hpp.

940 {
941 p0 = start;
942 p1 = end;
943 v = end - start;
944 }

◆ 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 967 of file mxvk_math.h.

967 {
968 p0 = start;
969 p1 = end;
970 v = dir;
971 }

◆ 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 933 of file mxvk_math_eigen.hpp.

933 {
934 p0 = start;
935 p1 = end;
936 v = dir;
937 }

Member Data Documentation

◆ p0

vec3D mxvk::paramLine3D::p0

Segment start point.

Definition at line 952 of file mxvk_math.h.

◆ p1

vec3D mxvk::paramLine3D::p1

Segment end point.

Definition at line 955 of file mxvk_math.h.

◆ v

vec3D mxvk::paramLine3D::v

Direction vector, commonly p1 - p0.

Definition at line 958 of file mxvk_math.h.


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