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... | |
| class | helios::WarningAggregator |
| Warning message aggregator for reducing console flooding. 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< vec2 > | helios::linspace (const vec2 &start, const vec2 &end, int num) |
| Generate linearly spaced vec2 values between two endpoints. | |
| std::vector< vec3 > | helios::linspace (const vec3 &start, const vec3 &end, int num) |
| Generate linearly spaced vec3 values between two endpoints. | |
| std::vector< vec4 > | helios::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::tryResolvePluginAsset (const std::string &pluginName, const std::string &assetPath) |
| Attempt to resolve a plugin asset path without throwing exceptions. | |
| std::filesystem::path | helios::resolveFilePath (const std::string &filename) |
| Resolve file path using standard Helios resolution hierarchy. | |
| std::filesystem::path | helios::tryResolveFilePath (const std::string &filename) |
| Attempt to resolve a file path without throwing exceptions. | |
| 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. | |
| std::vector< float > | helios::operator+ (const std::vector< float > &vec, float scalar) |
| Add a scalar to each element of a vector. | |
| std::vector< float > | helios::operator+ (float scalar, const std::vector< float > &vec) |
| Add a scalar to each element of a vector (scalar on left) | |
| std::vector< float > | helios::operator- (const std::vector< float > &vec, float scalar) |
| Subtract a scalar from each element of a vector. | |
| std::vector< float > | helios::operator- (float scalar, const std::vector< float > &vec) |
| Subtract each element of a vector from a scalar. | |
| std::vector< float > | helios::operator* (const std::vector< float > &vec, float scalar) |
| Multiply each element of a vector by a scalar. | |
| std::vector< float > | helios::operator* (float scalar, const std::vector< float > &vec) |
| Multiply each element of a vector by a scalar (scalar on left) | |
| std::vector< float > | helios::operator/ (const std::vector< float > &vec, float scalar) |
| Divide each element of a vector by a scalar. | |
| std::vector< float > | helios::operator/ (float scalar, const std::vector< float > &vec) |
| Divide a scalar by each element of a vector. | |
Miscellaneous helper functions.
| 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.
| 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.
| float helios::atan2_2pi | ( | float | y, |
| float | x | ||
| ) |
Four quadrant arc tangent between 0 and 2*pi.
Definition at line 731 of file global.cpp.
Calculate the area of a triangle given its three vertices.
| [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 |
Definition at line 199 of file global.cpp.
| SphericalCoord helios::cart2sphere | ( | const vec3 & | Cartesian | ) |
Convert Cartesian coordinates to spherical coordinates.
| [in] | Cartesian | (x,y,z) Cartesian coordinates |
Definition at line 755 of file global.cpp.
| anytype helios::clamp | ( | anytype | value, |
| anytype | min, | ||
| anytype | max | ||
| ) |
| std::string helios::deblank | ( | const char * | input | ) |
Remove all whitespace from character array.
Definition at line 1138 of file global.cpp.
| std::string helios::deblank | ( | const std::string & | input | ) |
Remove all whitespace from a string.
Definition at line 1149 of file global.cpp.
| float helios::deg2rad | ( | float | deg | ) |
Convert degrees to radians.
| deg | angle in degrees |
Definition at line 723 of file global.cpp.
| 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)
| [in] | startPath | Starting directory for search (defaults to current working directory) |
Definition at line 2773 of file global.cpp.
| std::vector< T > helios::flatten | ( | const std::vector< std::vector< std::vector< std::vector< T > > > > & | vec | ) |
| std::vector< T > helios::flatten | ( | const std::vector< std::vector< std::vector< T > > > & | vec | ) |
| std::vector< T > helios::flatten | ( | const std::vector< std::vector< T > > & | vec | ) |
| int helios::JulianDay | ( | const Date & | date | ) |
Convert calendar day (day,month,year) to Julian day.
| [in] | date | Date vector |
Definition at line 1380 of file global.cpp.
| 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.
Generate linearly spaced vec2 values between two endpoints.
| [in] | start | Starting vec2 value |
| [in] | end | Ending vec2 value |
| [in] | num | Number of uniformly spaced points to generate |
Definition at line 2937 of file global.cpp.
Generate linearly spaced vec3 values between two endpoints.
| [in] | start | Starting vec3 value |
| [in] | end | Ending vec3 value |
| [in] | num | Number of uniformly spaced points to generate |
Definition at line 2958 of file global.cpp.
Generate linearly spaced vec4 values between two endpoints.
| [in] | start | Starting vec4 value |
| [in] | end | Ending vec4 value |
| [in] | num | Number of uniformly spaced points to generate |
Definition at line 2979 of file global.cpp.
| std::vector< float > helios::linspace | ( | float | start, |
| float | end, | ||
| int | num | ||
| ) |
Generate linearly spaced values between two endpoints.
| [in] | start | Starting value |
| [in] | end | Ending value |
| [in] | num | Number of uniformly spaced points to generate |
Definition at line 2916 of file global.cpp.
| 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
| [in] | rotation | Rotation angle about axis in radians. |
| [in] | axis | Axis about which to rotate (one of 'x', 'y', or 'z'). |
| [out] | transform | Transformation matrix in a 1D array |
Definition at line 467 of file global.cpp.
| 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
| [in] | rotation | Rotation angle about axis in radians. |
| [in] | axis | Vector describing axis about which to perform rotation. |
| [out] | transform | Transformation matrix in a 1D array |
Definition at line 517 of file global.cpp.
| 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
| [in] | rotation | Rotation angle about axis in radians. |
| [in] | origin | Cartesian coordinate of the base/origin of rotation axis. |
| [in] | axis | Vector describing axis about which to perform rotation. |
| [out] | transform | Transformation matrix in a 1D array |
Definition at line 541 of file global.cpp.
| 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
| [in] | scale | Scaling factor to apply in x, y, and z directions. |
| [in] | point | Cartesian coordinates of point about which to scale |
| [out] | transform | Transformation matrix in a 1D array |
Definition at line 622 of file global.cpp.
| void helios::makeScaleMatrix | ( | const helios::vec3 & | scale, |
| float(&) | transform[16] | ||
| ) |
Construct matrix to scale about the origin.
4x4 Affine scaling matrix
| [in] | scale | Scaling factor to apply in x, y, and z directions. |
| [out] | transform | Transformation matrix in a 1D array |
Definition at line 603 of file global.cpp.
| void helios::makeTranslationMatrix | ( | const helios::vec3 & | translation, |
| float(&) | transform[16] | ||
| ) |
Construct translation matrix.
4x4 Affine translation matrix
| [in] | translation | Distance to translate in x, y, and z directions. |
| [out] | transform | Transformation matrix in a 1D array |
Definition at line 584 of file global.cpp.
| float helios::max | ( | const std::vector< float > & | vect | ) |
Maximum value of a vector of floats.
| [in] | vect | C++ vector of floats |
Definition at line 1258 of file global.cpp.
| int helios::max | ( | const std::vector< int > & | vect | ) |
Maximum value of a vector of ints.
| [in] | vect | C++ vector of ints |
Definition at line 1266 of file global.cpp.
Maximum value of a vector of vec3's.
| [in] | vect | C++ vector of vec3's |
Definition at line 1274 of file global.cpp.
| float helios::mean | ( | const std::vector< float > & | vect | ) |
Mean value of a vector of floats.
| [in] | vect | C++ vector of floats |
Definition at line 1206 of file global.cpp.
| float helios::median | ( | std::vector< float > | vect | ) |
Median of a vector of floats.
| [in] | vect | C++ vector of floats |
Definition at line 1317 of file global.cpp.
| float helios::min | ( | const std::vector< float > & | vect | ) |
Minimum value of a vector of floats.
| [in] | vect | C++ vector of floats |
Definition at line 1220 of file global.cpp.
| int helios::min | ( | const std::vector< int > & | vect | ) |
Minimum value of a vector of ints.
| [in] | vect | C++ vector of ints |
Definition at line 1228 of file global.cpp.
Minimum value of a vector of vec3's.
| [in] | vect | C++ vector of vec3's |
Definition at line 1236 of file global.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Determine whether point lines within a polygon.
Definition at line 357 of file global.cpp.
| float helios::rad2deg | ( | float | rad | ) |
Convert radians to degrees.
| rad | angle in radians |
Definition at line 727 of file global.cpp.
| float helios::randu | ( | ) |
Random number from a uniform distribution between 0 and 1.
Definition at line 257 of file global.cpp.
| 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.
| 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 | ||
| ) |
| 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 | ||
| ) |
| 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.
| [in] | vec | C++ vector |
| [in] | Nx | Size of vector in x-direction, i.e., vec[0][0][0].size() |
| [in] | Ny | Size of vector in y-direction, i.e., vec[0][0].size() |
| [in] | Nz | Size of vector in y-direction, i.e., vec[0].size() |
| [in] | Nw | Size of vector in y-direction, i.e., vec.size() |
| std::filesystem::path helios::resolveAssetPath | ( | const std::string & | relativePath | ) |
Resolve asset file path using cpplocate, allowing executables to run from any directory.
| [in] | relativePath | Relative path to the asset file (e.g., "plugins/visualizer/shaders/shader.vert") |
Definition at line 2689 of file global.cpp.
| 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:
| [in] | filename | File name with or without path (e.g., "texture.jpg" or "models/texture.jpg") |
Definition at line 2740 of file global.cpp.
| std::filesystem::path helios::resolvePluginAsset | ( | const std::string & | pluginName, |
| const std::string & | assetPath | ||
| ) |
Resolve plugin-specific asset path.
| [in] | pluginName | Name of the plugin (e.g., "visualizer", "plantarchitecture", "radiation") |
| [in] | assetPath | Relative path within the plugin's asset directory |
Definition at line 2700 of file global.cpp.
| std::filesystem::path helios::resolveProjectFile | ( | const std::string & | relativePath | ) |
Resolve file path using project-based resolution strategy.
| [in] | relativePath | Relative path to the file |
| std::runtime_error | if file cannot be found |
Definition at line 2787 of file global.cpp.
| std::filesystem::path helios::resolveSpectraPath | ( | const std::string & | spectraFile | ) |
Resolve spectral data file path.
| [in] | spectraFile | Spectral data filename with or without path (e.g., "camera_spectral_library.xml") |
Definition at line 2763 of file global.cpp.
| vec3 helios::rotatePoint | ( | const vec3 & | position, |
| const SphericalCoord & | rotation | ||
| ) |
Function to rotate a 3D vector given spherical angles elevation and azimuth.
| [in] | position | 3D coordinate of point to be rotated. |
| [in] | rotation | Spherical rotation angles (elevation,azimuth) |
Definition at line 103 of file global.cpp.
Function to rotate a 3D vector given spherical angles elevation and azimuth.
| [in] | position | 3D coordinate of point to be rotated. |
| [in] | theta | elevation angle of rotation. |
| [in] | phi | azimuthal angle of rotation. |
Definition at line 107 of file global.cpp.
| 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.
| [in] | inputstring | String to be separated |
| [in] | delimiter | Delimiter character for separation |
Definition at line 1169 of file global.cpp.
| vec3 helios::sphere2cart | ( | const SphericalCoord & | Spherical | ) |
Convert Spherical coordinates to Cartesian coordinates.
| [in] | Spherical | (radius,elevation,azimuth) SphericalCoord vector |
Definition at line 770 of file global.cpp.
| 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.
| [in] | u | Interpolation 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_start | Vector tangent to spline at starting point. |
| [in] | x_end | (x,y,z) Cartesian coordinate of spline ending point. |
| [in] | tan_end | Vector tangent to spline at ending point. |
Definition at line 2063 of file global.cpp.
| float helios::stdev | ( | const std::vector< float > & | vect | ) |
Standard deviation of a vector of floats.
| [in] | vect | C++ vector of floats |
Definition at line 1296 of file global.cpp.
| int2 helios::string2int2 | ( | const char * | str | ) |
Convert a space-delimited string into an int2 vector.
Definition at line 834 of file global.cpp.
| int3 helios::string2int3 | ( | const char * | str | ) |
Convert a space-delimited string into an int3 vector.
Definition at line 854 of file global.cpp.
| int4 helios::string2int4 | ( | const char * | str | ) |
Convert a space-delimited string into an int4 vector.
Definition at line 874 of file global.cpp.
| RGBAcolor helios::string2RGBcolor | ( | const char * | str | ) |
Convert a space-delimited string into an RGBcolor vector.
Definition at line 894 of file global.cpp.
| vec2 helios::string2vec2 | ( | const char * | str | ) |
Convert a space-delimited string into a vec2 vector.
Definition at line 774 of file global.cpp.
| vec3 helios::string2vec3 | ( | const char * | str | ) |
Convert a space-delimited string into a vec3 vector.
Definition at line 794 of file global.cpp.
| vec4 helios::string2vec4 | ( | const char * | str | ) |
Convert a space-delimited string into a vec4 vector.
Definition at line 814 of file global.cpp.
| float helios::sum | ( | const std::vector< float > & | vect | ) |
Sum of a vector of floats.
| [in] | vect | C++ vector of floats |
Definition at line 1193 of file global.cpp.
| std::string helios::trim_whitespace | ( | const std::string & | input | ) |
Remove leading and trailing whitespace from a string.
Definition at line 1153 of file global.cpp.
| std::filesystem::path helios::tryResolveFilePath | ( | const std::string & | filename | ) |
Attempt to resolve a file path without throwing exceptions.
Similar to resolveFilePath() but returns an empty path instead of throwing on failure. Useful for probing whether a file exists at various locations.
| [in] | filename | File name with or without path (e.g., "texture.jpg" or "models/texture.jpg") |
Definition at line 2706 of file global.cpp.
| std::filesystem::path helios::tryResolvePluginAsset | ( | const std::string & | pluginName, |
| const std::string & | assetPath | ||
| ) |
Attempt to resolve a plugin asset path without throwing exceptions.
Similar to resolvePluginAsset() but returns an empty path instead of throwing on failure. Useful for probing whether a plugin asset exists.
| [in] | pluginName | Name of the plugin (e.g., "plantarchitecture") |
| [in] | assetPath | Path relative to plugin directory (e.g., "assets/textures/leaf.png") |
Definition at line 2695 of file global.cpp.
| bool helios::validateAssetPath | ( | const std::filesystem::path & | assetPath | ) |
Validate that an asset file exists and is readable.
| [in] | assetPath | Path to the asset file to validate |
Definition at line 2769 of file global.cpp.
| void helios::wait | ( | float | seconds | ) |
Wait/sleep for a specified amount of time.
| [in] | seconds | Number of seconds to wait |
Definition at line 462 of file global.cpp.