1.3.49
 
Loading...
Searching...
No Matches
Utility functions

Miscellaneous helper functions. More...

Data Structures

struct  helios::Timer
 MATLAB-style timer. Call tic() to start timer, call toc() to stop timer and print duration. More...
 
class  helios::ProgressBar
 Simple progress bar for console output. More...
 

Functions

void helios::makeRotationMatrix (float rotation, const char *axis, float(&transform)[16])
 Construct a rotation matrix to perform rotation about the x-, y-, or z-axis.
 
void helios::makeRotationMatrix (float rotation, const helios::vec3 &axis, float(&transform)[16])
 Construct a rotation matrix to perform rotation about an arbitrary axis passing through the origin.
 
void helios::makeRotationMatrix (float rotation, const helios::vec3 &origin, const helios::vec3 &axis, float(&transform)[16])
 Construct a rotation matrix to perform rotation about an arbitrary line (not necessarily passing through the origin).
 
void helios::makeTranslationMatrix (const helios::vec3 &translation, float(&transform)[16])
 Construct translation matrix.
 
void helios::makeScaleMatrix (const helios::vec3 &scale, float(&transform)[16])
 Construct matrix to scale about the origin.
 
void helios::makeScaleMatrix (const helios::vec3 &scale, const helios::vec3 &point, float(&transform)[16])
 Construct matrix to scale about arbitrary point in space.
 
float helios::deg2rad (float deg)
 Convert degrees to radians.
 
float helios::rad2deg (float rad)
 Convert radians to degrees.
 
float helios::atan2_2pi (float y, float x)
 Four quadrant arc tangent between 0 and 2*pi.
 
SphericalCoord helios::cart2sphere (const vec3 &Cartesian)
 Convert Cartesian coordinates to spherical coordinates.
 
vec3 helios::sphere2cart (const SphericalCoord &Spherical)
 Convert Spherical coordinates to Cartesian coordinates.
 
vec2 helios::string2vec2 (const char *str)
 Convert a space-delimited string into a vec2 vector.
 
vec3 helios::string2vec3 (const char *str)
 Convert a space-delimited string into a vec3 vector.
 
vec4 helios::string2vec4 (const char *str)
 Convert a space-delimited string into a vec4 vector.
 
int2 helios::string2int2 (const char *str)
 Convert a space-delimited string into an int2 vector.
 
int3 helios::string2int3 (const char *str)
 Convert a space-delimited string into an int3 vector.
 
int4 helios::string2int4 (const char *str)
 Convert a space-delimited string into an int4 vector.
 
RGBAcolor helios::string2RGBcolor (const char *str)
 Convert a space-delimited string into an RGBcolor vector.
 
std::string helios::deblank (const char *input)
 Remove all whitespace from character array.
 
std::string helios::deblank (const std::string &input)
 Remove all whitespace from a string.
 
std::string helios::trim_whitespace (const std::string &input)
 Remove leading and trailing whitespace from a string.
 
std::vector< std::string > helios::separate_string_by_delimiter (const std::string &inputstring, const std::string &delimiter)
 Separate string by delimiter and store into a vector.
 
template<typename anytype >
anytype helios::clamp (anytype value, anytype min, anytype max)
 Clamp value to be within some specified bounds.
 
float helios::sum (const std::vector< float > &vect)
 Sum of a vector of floats.
 
float helios::mean (const std::vector< float > &vect)
 Mean value of a vector of floats.
 
float helios::min (const std::vector< float > &vect)
 Minimum value of a vector of floats.
 
int helios::min (const std::vector< int > &vect)
 Minimum value of a vector of ints.
 
vec3 helios::min (const std::vector< vec3 > &vect)
 Minimum value of a vector of vec3's.
 
float helios::max (const std::vector< float > &vect)
 Maximum value of a vector of floats.
 
int helios::max (const std::vector< int > &vect)
 Maximum value of a vector of ints.
 
vec3 helios::max (const std::vector< vec3 > &vect)
 Maximum value of a vector of vec3's.
 
float helios::stdev (const std::vector< float > &vect)
 Standard deviation of a vector of floats.
 
float helios::median (std::vector< float > vect)
 Median of a vector of floats.
 
template<typename anytype >
std::enable_if< std::is_default_constructible< anytype >::value >::type helios::resize_vector (std::vector< std::vector< anytype > > &vec, size_t Nx, size_t Ny)
 Resize 2D C++ vector.
 
template<typename anytype >
std::enable_if< std::is_default_constructible< anytype >::value >::type helios::resize_vector (std::vector< std::vector< std::vector< anytype > > > &vec, size_t Nx, size_t Ny, size_t Nz)
 Resize 3D C++ vector.
 
template<typename anytype >
std::enable_if< std::is_default_constructible< anytype >::value >::type helios::resize_vector (std::vector< std::vector< std::vector< std::vector< anytype > > > > &vec, size_t Nx, size_t Ny, size_t Nz, size_t Nw)
 Resize 4D C++ vector.
 
vec3 helios::rotatePoint (const vec3 &position, const SphericalCoord &rotation)
 Function to rotate a 3D vector given spherical angles elevation and azimuth.
 
vec3 helios::rotatePoint (const vec3 &position, float theta, float phi)
 Function to rotate a 3D vector given spherical angles elevation and azimuth.
 
float helios::calculateTriangleArea (const vec3 &v0, const vec3 &v1, const vec3 &v2)
 Calculate the area of a triangle given its three vertices.
 
int helios::JulianDay (const Date &date)
 Convert calendar day (day,month,year) to Julian day.
 
float helios::randu ()
 Random number from a uniform distribution between 0 and 1.
 
int helios::randu (int imin, int imax)
 Random integer from a uniform distribution between imin and imax.
 
float helios::acos_safe (float x)
 arccosine function to handle cases when round-off errors cause an argument <-1 or >1, and thus regular acos() returns NaN
 
float helios::asin_safe (float x)
 arcsine function to handle cases when round-off errors cause an argument <-1 or >1, and thus regular asin() returns NaN
 
bool helios::lineIntersection (const vec2 &p1, const vec2 &q1, const vec2 &p2, const vec2 &q2)
 Determine if two line segments intersect. The lines segments are defined by vertices (p1,q1) and (p2,q2)
 
bool helios::pointInPolygon (const vec2 &point, const std::vector< vec2 > &polygon_verts)
 Determine whether point lines within a polygon.
 
void helios::wait (float seconds)
 Wait/sleep for a specified amount of time.
 
template<typename T >
std::vector< T > helios::flatten (const std::vector< std::vector< T > > &vec)
 Template function to flatten a 2D vector into a 1D vector.
 
template<typename T >
std::vector< T > helios::flatten (const std::vector< std::vector< std::vector< T > > > &vec)
 Template function to flatten a 3D vector into a 1D vector.
 
template<typename T >
std::vector< T > helios::flatten (const std::vector< std::vector< std::vector< std::vector< T > > > > &vec)
 Template function to flatten a 4D vector into a 1D vector.
 
helios::vec3 helios::spline_interp3 (float u, const vec3 &x_start, const vec3 &tan_start, const vec3 &x_end, const vec3 &tan_end)
 Function to perform cubic Hermite spline interpolation.
 
std::vector< float > helios::linspace (float start, float end, int num)
 Generate linearly spaced values between two endpoints.
 
std::vector< vec2helios::linspace (const vec2 &start, const vec2 &end, int num)
 Generate linearly spaced vec2 values between two endpoints.
 
std::vector< vec3helios::linspace (const vec3 &start, const vec3 &end, int num)
 Generate linearly spaced vec3 values between two endpoints.
 
std::vector< vec4helios::linspace (const vec4 &start, const vec4 &end, int num)
 Generate linearly spaced vec4 values between two endpoints.
 
std::filesystem::path helios::resolveAssetPath (const std::string &relativePath)
 Resolve asset file path using cpplocate, allowing executables to run from any directory.
 
std::filesystem::path helios::resolvePluginAsset (const std::string &pluginName, const std::string &assetPath)
 Resolve plugin-specific asset path.
 
std::filesystem::path helios::resolveFilePath (const std::string &filename)
 Resolve file path using standard Helios resolution hierarchy.
 
std::filesystem::path helios::resolveSpectraPath (const std::string &spectraFile)
 Resolve spectral data file path.
 
bool helios::validateAssetPath (const std::filesystem::path &assetPath)
 Validate that an asset file exists and is readable.
 
std::filesystem::path helios::findProjectRoot (const std::filesystem::path &startPath=std::filesystem::current_path())
 Find the project root directory (directory containing top-level CMakeLists.txt)
 
std::filesystem::path helios::resolveProjectFile (const std::string &relativePath)
 Resolve file path using project-based resolution strategy.
 

Detailed Description

Miscellaneous helper functions.

Function Documentation

◆ acos_safe()

float helios::acos_safe ( float  x)

arccosine function to handle cases when round-off errors cause an argument <-1 or >1, and thus regular acos() returns NaN

Definition at line 271 of file global.cpp.

◆ asin_safe()

float helios::asin_safe ( float  x)

arcsine function to handle cases when round-off errors cause an argument <-1 or >1, and thus regular asin() returns NaN

Definition at line 279 of file global.cpp.

◆ atan2_2pi()

float helios::atan2_2pi ( float  y,
float  x 
)

Four quadrant arc tangent between 0 and 2*pi.

Note
atan2_2pi(0,1) = 0, atan2_2pi(1,0) = pi/2, etc.

Definition at line 731 of file global.cpp.

◆ calculateTriangleArea()

float helios::calculateTriangleArea ( const vec3 v0,
const vec3 v1,
const vec3 v2 
)

Calculate the area of a triangle given its three vertices.

Parameters
[in]v0(x,y,z) coordinate of first vertex
[in]v1(x,y,z) coordinate of second vertex
[in]v2(x,y,z) coordinate of third vertex
Returns
One-sided surface area of triangle

Definition at line 199 of file global.cpp.

◆ cart2sphere()

SphericalCoord helios::cart2sphere ( const vec3 Cartesian)

Convert Cartesian coordinates to spherical coordinates.

Parameters
[in]Cartesian(x,y,z) Cartesian coordinates
Returns
SphericalCoord vector.
See also
sphere2cart(), SphericalCoord

Definition at line 755 of file global.cpp.

◆ clamp()

template<typename anytype >
anytype helios::clamp ( anytype  value,
anytype  min,
anytype  max 
)

Clamp value to be within some specified bounds.

Parameters
[in]valueValue to be clamped
[in]minLower bound
[in]maxUpper bound

Definition at line 466 of file global.h.

◆ deblank() [1/2]

std::string helios::deblank ( const char *  input)

Remove all whitespace from character array.

Definition at line 1128 of file global.cpp.

◆ deblank() [2/2]

std::string helios::deblank ( const std::string &  input)

Remove all whitespace from a string.

Definition at line 1139 of file global.cpp.

◆ deg2rad()

float helios::deg2rad ( float  deg)

Convert degrees to radians.

Parameters
degangle in degrees
Returns
angle in radians
See also
rad2deg()

Definition at line 723 of file global.cpp.

◆ findProjectRoot()

std::filesystem::path helios::findProjectRoot ( const std::filesystem::path &  startPath = std::filesystem::current_path())

Find the project root directory (directory containing top-level CMakeLists.txt)

Parameters
[in]startPathStarting directory for search (defaults to current working directory)
Returns
Absolute path to the project root directory, or empty path if not found
Note
Searches upward from startPath for a directory containing CMakeLists.txt

Definition at line 2653 of file global.cpp.

◆ flatten() [1/3]

template<typename T >
std::vector< T > helios::flatten ( const std::vector< std::vector< std::vector< std::vector< T > > > > &  vec)

Template function to flatten a 4D vector into a 1D vector.

Template Parameters
TType of elements in the vector

Definition at line 945 of file global.h.

◆ flatten() [2/3]

template<typename T >
std::vector< T > helios::flatten ( const std::vector< std::vector< std::vector< T > > > &  vec)

Template function to flatten a 3D vector into a 1D vector.

Template Parameters
TType of elements in the vector

Definition at line 929 of file global.h.

◆ flatten() [3/3]

template<typename T >
std::vector< T > helios::flatten ( const std::vector< std::vector< T > > &  vec)

Template function to flatten a 2D vector into a 1D vector.

Template Parameters
TType of elements in the vector

Definition at line 915 of file global.h.

◆ JulianDay()

int helios::JulianDay ( const Date date)

Convert calendar day (day,month,year) to Julian day.

Parameters
[in]dateDate vector
Returns
Julian day of year
See also
CalendarDay()

Definition at line 1370 of file global.cpp.

◆ lineIntersection()

bool helios::lineIntersection ( const vec2 p1,
const vec2 q1,
const vec2 p2,
const vec2 q2 
)

Determine if two line segments intersect. The lines segments are defined by vertices (p1,q1) and (p2,q2)

Definition at line 287 of file global.cpp.

◆ linspace() [1/4]

std::vector< vec2 > helios::linspace ( const vec2 start,
const vec2 end,
int  num 
)

Generate linearly spaced vec2 values between two endpoints.

Parameters
[in]startStarting vec2 value
[in]endEnding vec2 value
[in]numNumber of uniformly spaced points to generate
Returns
Vector of linearly spaced vec2 values

Definition at line 2817 of file global.cpp.

◆ linspace() [2/4]

std::vector< vec3 > helios::linspace ( const vec3 start,
const vec3 end,
int  num 
)

Generate linearly spaced vec3 values between two endpoints.

Parameters
[in]startStarting vec3 value
[in]endEnding vec3 value
[in]numNumber of uniformly spaced points to generate
Returns
Vector of linearly spaced vec3 values

Definition at line 2838 of file global.cpp.

◆ linspace() [3/4]

std::vector< vec4 > helios::linspace ( const vec4 start,
const vec4 end,
int  num 
)

Generate linearly spaced vec4 values between two endpoints.

Parameters
[in]startStarting vec4 value
[in]endEnding vec4 value
[in]numNumber of uniformly spaced points to generate
Returns
Vector of linearly spaced vec4 values

Definition at line 2859 of file global.cpp.

◆ linspace() [4/4]

std::vector< float > helios::linspace ( float  start,
float  end,
int  num 
)

Generate linearly spaced values between two endpoints.

Parameters
[in]startStarting value
[in]endEnding value
[in]numNumber of uniformly spaced points to generate
Returns
Vector of linearly spaced float values

Definition at line 2796 of file global.cpp.

◆ makeRotationMatrix() [1/3]

void helios::makeRotationMatrix ( float  rotation,
const char *  axis,
float(&)  transform[16] 
)

Construct a rotation matrix to perform rotation about the x-, y-, or z-axis.

4x4 Affine rotation matrix

Parameters
[in]rotationRotation angle about axis in radians.
[in]axisAxis about which to rotate (one of 'x', 'y', or 'z').
[out]transformTransformation matrix in a 1D array

Definition at line 467 of file global.cpp.

◆ makeRotationMatrix() [2/3]

void helios::makeRotationMatrix ( float  rotation,
const helios::vec3 axis,
float(&)  transform[16] 
)

Construct a rotation matrix to perform rotation about an arbitrary axis passing through the origin.

4x4 Affine rotation matrix

Parameters
[in]rotationRotation angle about axis in radians.
[in]axisVector describing axis about which to perform rotation.
[out]transformTransformation matrix in a 1D array

Definition at line 517 of file global.cpp.

◆ makeRotationMatrix() [3/3]

void helios::makeRotationMatrix ( float  rotation,
const helios::vec3 origin,
const helios::vec3 axis,
float(&)  transform[16] 
)

Construct a rotation matrix to perform rotation about an arbitrary line (not necessarily passing through the origin).

4x4 Affine rotation matrix

Parameters
[in]rotationRotation angle about axis in radians.
[in]originCartesian coordinate of the base/origin of rotation axis.
[in]axisVector describing axis about which to perform rotation.
[out]transformTransformation matrix in a 1D array

Definition at line 541 of file global.cpp.

◆ makeScaleMatrix() [1/2]

void helios::makeScaleMatrix ( const helios::vec3 scale,
const helios::vec3 point,
float(&)  transform[16] 
)

Construct matrix to scale about arbitrary point in space.

4x4 Affine scaling matrix

Parameters
[in]scaleScaling factor to apply in x, y, and z directions.
[in]pointCartesian coordinates of point about which to scale
[out]transformTransformation matrix in a 1D array

Definition at line 622 of file global.cpp.

◆ makeScaleMatrix() [2/2]

void helios::makeScaleMatrix ( const helios::vec3 scale,
float(&)  transform[16] 
)

Construct matrix to scale about the origin.

4x4 Affine scaling matrix

Parameters
[in]scaleScaling factor to apply in x, y, and z directions.
[out]transformTransformation matrix in a 1D array

Definition at line 603 of file global.cpp.

◆ makeTranslationMatrix()

void helios::makeTranslationMatrix ( const helios::vec3 translation,
float(&)  transform[16] 
)

Construct translation matrix.

4x4 Affine translation matrix

Parameters
[in]translationDistance to translate in x, y, and z directions.
[out]transformTransformation matrix in a 1D array

Definition at line 584 of file global.cpp.

◆ max() [1/3]

float helios::max ( const std::vector< float > &  vect)

Maximum value of a vector of floats.

Parameters
[in]vectC++ vector of floats

Definition at line 1248 of file global.cpp.

◆ max() [2/3]

int helios::max ( const std::vector< int > &  vect)

Maximum value of a vector of ints.

Parameters
[in]vectC++ vector of ints

Definition at line 1256 of file global.cpp.

◆ max() [3/3]

vec3 helios::max ( const std::vector< vec3 > &  vect)

Maximum value of a vector of vec3's.

Parameters
[in]vectC++ vector of vec3's

Definition at line 1264 of file global.cpp.

◆ mean()

float helios::mean ( const std::vector< float > &  vect)

Mean value of a vector of floats.

Parameters
[in]vectC++ vector of floats

Definition at line 1196 of file global.cpp.

◆ median()

float helios::median ( std::vector< float >  vect)

Median of a vector of floats.

Parameters
[in]vectC++ vector of floats

Definition at line 1307 of file global.cpp.

◆ min() [1/3]

float helios::min ( const std::vector< float > &  vect)

Minimum value of a vector of floats.

Parameters
[in]vectC++ vector of floats

Definition at line 1210 of file global.cpp.

◆ min() [2/3]

int helios::min ( const std::vector< int > &  vect)

Minimum value of a vector of ints.

Parameters
[in]vectC++ vector of ints

Definition at line 1218 of file global.cpp.

◆ min() [3/3]

vec3 helios::min ( const std::vector< vec3 > &  vect)

Minimum value of a vector of vec3's.

Parameters
[in]vectC++ vector of vec3's

Definition at line 1226 of file global.cpp.

◆ pointInPolygon()

bool helios::pointInPolygon ( const vec2 point,
const std::vector< vec2 > &  polygon_verts 
)

Determine whether point lines within a polygon.

Definition at line 357 of file global.cpp.

◆ rad2deg()

float helios::rad2deg ( float  rad)

Convert radians to degrees.

Parameters
radangle in radians
Returns
angle in degrees
See also
deg2rad()

Definition at line 727 of file global.cpp.

◆ randu() [1/2]

float helios::randu ( )

Random number from a uniform distribution between 0 and 1.

Definition at line 257 of file global.cpp.

◆ randu() [2/2]

int helios::randu ( int  imin,
int  imax 
)

Random integer from a uniform distribution between imin and imax.

Definition at line 261 of file global.cpp.

◆ resize_vector() [1/3]

template<typename anytype >
std::enable_if< std::is_default_constructible< anytype >::value >::type helios::resize_vector ( std::vector< std::vector< anytype > > &  vec,
size_t  Nx,
size_t  Ny 
)

Resize 2D C++ vector.

Parameters
[in]vecC++ vector
[in]NxSize of vector in x-direction, i.e., vec.at(0).size()
[in]NySize of vector in y-direction, i.e., vec.size()

Definition at line 555 of file global.h.

◆ resize_vector() [2/3]

template<typename anytype >
std::enable_if< std::is_default_constructible< anytype >::value >::type helios::resize_vector ( std::vector< std::vector< std::vector< anytype > > > &  vec,
size_t  Nx,
size_t  Ny,
size_t  Nz 
)

Resize 3D C++ vector.

Parameters
[in]vecC++ vector
[in]NxSize of vector in x-direction, i.e., vec[0][0].size()
[in]NySize of vector in y-direction, i.e., vec[0].size()
[in]NzSize of vector in y-direction, i.e., vec.size()

Definition at line 568 of file global.h.

◆ resize_vector() [3/3]

template<typename anytype >
std::enable_if< std::is_default_constructible< anytype >::value >::type helios::resize_vector ( std::vector< std::vector< std::vector< std::vector< anytype > > > > &  vec,
size_t  Nx,
size_t  Ny,
size_t  Nz,
size_t  Nw 
)

Resize 4D C++ vector.

Parameters
[in]vecC++ vector
[in]NxSize of vector in x-direction, i.e., vec[0][0][0].size()
[in]NySize of vector in y-direction, i.e., vec[0][0].size()
[in]NzSize of vector in y-direction, i.e., vec[0].size()
[in]NwSize of vector in y-direction, i.e., vec.size()

Definition at line 582 of file global.h.

◆ resolveAssetPath()

std::filesystem::path helios::resolveAssetPath ( const std::string &  relativePath)

Resolve asset file path using cpplocate, allowing executables to run from any directory.

Parameters
[in]relativePathRelative path to the asset file (e.g., "plugins/visualizer/shaders/shader.vert")
Returns
Absolute path to the asset file
Note
This function searches for assets in multiple locations: build directory, system install locations, and custom paths

Definition at line 2600 of file global.cpp.

◆ resolveFilePath()

std::filesystem::path helios::resolveFilePath ( const std::string &  filename)

Resolve file path using standard Helios resolution hierarchy.

Resolves file paths using the following fallback sequence:

  1. If absolute path, validates existence and returns canonical path
  2. Checks relative to current working directory first
  3. Falls back to checking relative to HELIOS_BUILD environment variable path
  4. Throws helios_runtime_error if file not found in either location
Parameters
[in]filenameFile name with or without path (e.g., "texture.jpg" or "models/texture.jpg")
Returns
Absolute canonical path to the file

Definition at line 2612 of file global.cpp.

◆ resolvePluginAsset()

std::filesystem::path helios::resolvePluginAsset ( const std::string &  pluginName,
const std::string &  assetPath 
)

Resolve plugin-specific asset path.

Parameters
[in]pluginNameName of the plugin (e.g., "visualizer", "plantarchitecture", "radiation")
[in]assetPathRelative path within the plugin's asset directory
Returns
Absolute path to the plugin asset file

Definition at line 2606 of file global.cpp.

◆ resolveProjectFile()

std::filesystem::path helios::resolveProjectFile ( const std::string &  relativePath)

Resolve file path using project-based resolution strategy.

Parameters
[in]relativePathRelative path to the file
Returns
Absolute path to the file
Note
Resolution order: 1) Current working directory, 2) Project directory, 3) Error
Exceptions
std::runtime_errorif file cannot be found

Definition at line 2667 of file global.cpp.

◆ resolveSpectraPath()

std::filesystem::path helios::resolveSpectraPath ( const std::string &  spectraFile)

Resolve spectral data file path.

Parameters
[in]spectraFileSpectral data filename with or without path (e.g., "camera_spectral_library.xml")
Returns
Absolute path to the spectral data file

Definition at line 2643 of file global.cpp.

◆ rotatePoint() [1/2]

vec3 helios::rotatePoint ( const vec3 position,
const SphericalCoord rotation 
)

Function to rotate a 3D vector given spherical angles elevation and azimuth.

Parameters
[in]position3D coordinate of point to be rotated.
[in]rotationSpherical rotation angles (elevation,azimuth)

Definition at line 103 of file global.cpp.

◆ rotatePoint() [2/2]

vec3 helios::rotatePoint ( const vec3 position,
float  theta,
float  phi 
)

Function to rotate a 3D vector given spherical angles elevation and azimuth.

Parameters
[in]position3D coordinate of point to be rotated.
[in]thetaelevation angle of rotation.
[in]phiazimuthal angle of rotation.

Definition at line 107 of file global.cpp.

◆ separate_string_by_delimiter()

std::vector< std::string > helios::separate_string_by_delimiter ( const std::string &  inputstring,
const std::string &  delimiter 
)

Separate string by delimiter and store into a vector.

Parameters
[in]inputstringString to be separated
[in]delimiterDelimiter character for separation
Returns
Vector of substrings. If inputstring does not contain delimiter, empty vector is returned

Definition at line 1159 of file global.cpp.

◆ sphere2cart()

vec3 helios::sphere2cart ( const SphericalCoord Spherical)

Convert Spherical coordinates to Cartesian coordinates.

Parameters
[in]Spherical(radius,elevation,azimuth) SphericalCoord vector
Returns
vec3 vector of Cartesian coordinates
See also
cart2sphere()

Definition at line 760 of file global.cpp.

◆ spline_interp3()

helios::vec3 helios::spline_interp3 ( float  u,
const vec3 x_start,
const vec3 tan_start,
const vec3 x_end,
const vec3 tan_end 
)

Function to perform cubic Hermite spline interpolation.

Parameters
[in]uInterpolation point as a fraction of the distance between the start and end points (must be between 0 and 1).
[in]x_start(x,y,z) Cartesian coordinate of spline starting point.
[in]tan_startVector tangent to spline at starting point.
[in]x_end(x,y,z) Cartesian coordinate of spline ending point.
[in]tan_endVector tangent to spline at ending point.
Returns
Interpolated (x,y,z) Cartesian point.

Definition at line 2026 of file global.cpp.

◆ stdev()

float helios::stdev ( const std::vector< float > &  vect)

Standard deviation of a vector of floats.

Parameters
[in]vectC++ vector of floats

Definition at line 1286 of file global.cpp.

◆ string2int2()

int2 helios::string2int2 ( const char *  str)

Convert a space-delimited string into an int2 vector.

Definition at line 824 of file global.cpp.

◆ string2int3()

int3 helios::string2int3 ( const char *  str)

Convert a space-delimited string into an int3 vector.

Definition at line 844 of file global.cpp.

◆ string2int4()

int4 helios::string2int4 ( const char *  str)

Convert a space-delimited string into an int4 vector.

Definition at line 864 of file global.cpp.

◆ string2RGBcolor()

RGBAcolor helios::string2RGBcolor ( const char *  str)

Convert a space-delimited string into an RGBcolor vector.

Definition at line 884 of file global.cpp.

◆ string2vec2()

vec2 helios::string2vec2 ( const char *  str)

Convert a space-delimited string into a vec2 vector.

Definition at line 764 of file global.cpp.

◆ string2vec3()

vec3 helios::string2vec3 ( const char *  str)

Convert a space-delimited string into a vec3 vector.

Definition at line 784 of file global.cpp.

◆ string2vec4()

vec4 helios::string2vec4 ( const char *  str)

Convert a space-delimited string into a vec4 vector.

Definition at line 804 of file global.cpp.

◆ sum()

float helios::sum ( const std::vector< float > &  vect)

Sum of a vector of floats.

Parameters
[in]vectC++ vector of floats

Definition at line 1183 of file global.cpp.

◆ trim_whitespace()

std::string helios::trim_whitespace ( const std::string &  input)

Remove leading and trailing whitespace from a string.

Definition at line 1143 of file global.cpp.

◆ validateAssetPath()

bool helios::validateAssetPath ( const std::filesystem::path &  assetPath)

Validate that an asset file exists and is readable.

Parameters
[in]assetPathPath to the asset file to validate
Returns
True if the file exists and is readable, false otherwise

Definition at line 2649 of file global.cpp.

◆ wait()

void helios::wait ( float  seconds)

Wait/sleep for a specified amount of time.

Parameters
[in]secondsNumber of seconds to wait

Definition at line 462 of file global.cpp.