26 template<
class V,
class M>
27 inline V
mul_pos(
const V& src,
const M& m)
29 const auto a = src[0] * m.x[0][0] + src[1] * m.x[1][0] + src[2] * m.x[2][0] + m.x[3][0];
30 const auto b = src[0] * m.x[0][1] + src[1] * m.x[1][1] + src[2] * m.x[2][1] + m.x[3][1];
31 const auto c = src[0] * m.x[0][2] + src[1] * m.x[1][2] + src[2] * m.x[2][2] + m.x[3][2];
37 template<
class V,
class M>
38 inline V
mul_dir(
const V& src,
const M& m)
40 const auto a = src[0] * m.x[0][0] + src[1] * m.x[1][0] + src[2] * m.x[2][0];
41 const auto b = src[0] * m.x[0][1] + src[1] * m.x[1][1] + src[2] * m.x[2][1];
42 const auto c = src[0] * m.x[0][2] + src[1] * m.x[1][2] + src[2] * m.x[2][2];
127 bool negate_normal =
false 232 const std::function<
void(uint32_t first, uint32_t last)>&
function Definition: ImathBox.h:71
MAQUINA_EXPORT std::string base64_encode(const uint8_t *data, size_t size)
Encode a bunch of binary data in a base64 text.
MAQUINA_EXPORT std::wstring file_name(const wchar_t *file)
Return a file name.
V mul_dir(const V &src, const M &m)
A faster alternative to multiply a direction by a 4x4 matrix, ignoring the homogeneous normalization...
Definition: Utils.h:38
MAQUINA_EXPORT std::vector< uint8_t > inflate(const uint8_t *data, size_t size)
Uncompress a bunch of binary data with zlib.
MAQUINA_EXPORT std::vector< uint8_t > deflate(const uint8_t *data, size_t size)
Compress a bunch of binary data with zlib.
Definition: ImathFrame.h:42
MAQUINA_EXPORT bool list_directory_files(const wchar_t *directory, std::vector< std::wstring > &files)
Definition: ImathFrame.h:43
MAQUINA_EXPORT Imath::V3f closest_point_segment_to_segment(const Imath::V3f *s1, const Imath::V3f *s2)
MAQUINA_EXPORT void ik_3_joints(const Imath::V3d &p0, const Imath::V3d &p1, const Imath::V3d &p2, const Imath::V3d &goal, const Imath::V3d &normal, Imath::Quatd &r0, double &a1, Imath::V3d &axis1, bool negate_normal=false)
MAQUINA_EXPORT std::wstring project_directory()
Return the project directory.
MAQUINA_EXPORT std::string system_path_local(const wchar_t *path)
Expand a document file path in a file system path.
MAQUINA_EXPORT int solve_cubic(float a, float b, float c, float d, float *roots)
Solve a cubic equation.
MAQUINA_EXPORT std::string wstring_to_local(const wchar_t *str)
Convert a std::wstring into a string in the default system charset.
MAQUINA_EXPORT std::wstring system_path(const wchar_t *path)
Expand a document file path in a file system path.
V mul_pos(const V &src, const M &m)
A faster alternative to multiply a position by a 4x4 matrix, ignoring the homogeneous normalization...
Definition: Utils.h:27
MAQUINA_EXPORT bool file_exists(const wchar_t *file)
Return true if a file exist.
MAQUINA_EXPORT std::pair< bool, std::string > drm_status()
Return the drm status.
MAQUINA_EXPORT Imath::Box3f compute_aabb(const gsl::span< const Imath::V3f > &points)
Compute points bounding box.
This version of the SDK is unstable, i-e, it may change with no warning.
Definition: AddCurveAction.h:20
MAQUINA_EXPORT std::string to_log(const std::wstring &s)
Convert a wide string in string to use in the logger functions.
MAQUINA_EXPORT void set_setting(const char *path, const Value &value)
Set a setting value.
MAQUINA_EXPORT void parallel_for(uint32_t first, uint32_t last, uint32_t batch_size, const std::function< void(uint32_t first, uint32_t last)> &function)
Perform a for loop using threads.
MAQUINA_EXPORT int intersect_ray_sphere(const Imath::V3d &o, const Imath::V3d &d, const Imath::V3d &c, float r, float &t0, float &t1)
Compute the intersections between an infinit ray and a sphere.
MAQUINA_EXPORT std::wstring parent_path(const wchar_t *file)
Return a file parent path.
MAQUINA_EXPORT std::string drm_hostid()
Return the system host id.
Definition: ImathQuat.h:71
#define MAQUINA_EXPORT
Definition: Export.h:31
bool is_identity(const Imath::Matrix44< T > &m)
Returns true if the matrix is the identity.
Definition: Utils.h:49
MAQUINA_EXPORT std::wstring project_path(const wchar_t *system_path)
Reduce a file system path to a project file path.
MAQUINA_EXPORT const std::vector< std::pair< std::string, std::wstring > > & path_variables()
Return the currently registered path variables.
MAQUINA_EXPORT void set_project_directory(const wchar_t *path)
Set the project directory.
MAQUINA_EXPORT Imath::M44f blend_to_identity(const Imath::M44f &a, float w)
Blend a matrix to identity.
MAQUINA_EXPORT Imath::V3d closest_point_to_line(const Imath::V3d &o, const Imath::V3d &d, const Imath::V3d &p)
Compute the closest point to p on a line.
MAQUINA_EXPORT std::wstring utf8_to_wstring(const char *uft8)
Convert an utf-8 string into a std::wstring.
MAQUINA_EXPORT std::string file_extension(const wchar_t *file)
Return a file extension.
MAQUINA_EXPORT void set_path_variables(const std::vector< std::pair< std::string, std::wstring >> &path_vars)
Register the path variables.
MAQUINA_EXPORT void closest_point_between_lines(const Imath::V3f &o0, const Imath::V3f &d0, const Imath::V3f &o1, const Imath::V3f &d1, float &t0, float &t1)
Compute the closest point between two lines.
MAQUINA_EXPORT Imath::V3f closest_point_on_triangle(const Imath::V3f *triangle, const Imath::V3f &p, float *s_out=nullptr, float *t_out=nullptr)
MAQUINA_EXPORT std::string wstring_to_utf8(const wchar_t *str)
Convert a std::wstring into an utf-8 string.
MAQUINA_EXPORT std::wstring getenv_w(const char *name)
Return the content of an environment variable.
MAQUINA_EXPORT void get_orthogonal_vectors(const Imath::V3d &fx, Imath::V3d &fy, Imath::V3d &fz)
MAQUINA_EXPORT std::vector< uint8_t > base64_decode(const char *text, size_t size)
Decode a bunch of binary data from a base64 text.
MAQUINA_EXPORT void drm_init(const std::wstring &path, const std::string &license_server)
Initialize the drm.
MAQUINA_EXPORT Value setting(const char *path)
Get a setting value.
MAQUINA_EXPORT void drm_release()
Release the drm.
MAQUINA_EXPORT Imath::M44d lerp(const Imath::M44d &a, const Imath::M44d &b, double w)
Interplate two matrices.
MAQUINA_EXPORT std::wstring local_to_wstring(const char *str)
Convert a string in the default system charset into a std::wstring.
T x[4][4]
Definition: ImathMatrix.h:404
MAQUINA_EXPORT bool has_tag(const std::string &tags, const char *tag)
Check a tag exist in a comma separate tag list.