API Functions Lua

Abs Function

Vec4 Abs(Vec4 v)
Vec3 Abs(Vec3 v)
number Abs(number v)
integer Abs(integer v)

Return the absolute value of the function input. For vectors, the absolute value is applied to each component individually and the resulting vector is returned.

AddAssetsFolder Function

boolean AddAssetsFolder(string path)

Mount a local filesystem folder as an assets source.

See Resources & Assets.

AddAssetsPackage Function

boolean AddAssetsPackage(string path)

Mount an archive stored on the local filesystem as an assets source.

See Resources & Assets.

AlphaScale Function

Color AlphaScale(Color color, number k)

Scale the alpha component of the input color.

ApplyBloom Function

integer ApplyBloom(integer view_id, IntRect rect, Texture input, FrameBufferHandle output, Bloom bloom, number threshold, number smoothness, number intensity)

Process input texture and generate a bloom overlay on top of output, input and output must be of the same size.

Use CreateBloomFromFile/CreateBloomFromAssets to create a Bloom object and DestroyBloom to destroy its internal resources after usage.

ARGB32 Function

integer ARGB32(integer r, integer g, integer b)
integer ARGB32(integer r, integer g, integer b, integer a)

Create a 32 bit integer ARGB color.

ARGB32ToRGBA32 Function

integer ARGB32ToRGBA32(integer argb)

Convert a 32 bit integer ARGB color to RGBA.

AudioInit Function

boolean AudioInit()

Initialize the audio system.

AudioShutdown Function

nil AudioShutdown()

Shutdown the audio system.

BaseToEuler Function

Vec3 BaseToEuler(Vec3 z)
Vec3 BaseToEuler(Vec3 z, Vec3 y)

Compute the Euler angles triplet for the provided z direction. The up-vector y can be provided to improve coherency of the returned values over time.

BeginProfilerSection Function

integer BeginProfilerSection(string name)
integer BeginProfilerSection(string name, string section_details)

Begin a named profiler section. Call EndProfilerSection to end the section.

CaptureProfilerFrame Function

ProfilerFrame CaptureProfilerFrame()

Capture the current profiler frame but do not end it. See EndProfilerFrame to capture and end the current profiler frame.

See PrintProfilerFrame to print a profiler frame to the console.

CaptureTexture Function

integer, integer CaptureTexture(integer view_id, PipelineResources resources, TextureRef tex, Texture read_back, Picture pic)

Capture a texture content to a Picture. Return the frame counter at which the capture will be complete.

A Picture object can be accessed by the CPU.

This function is asynchronous and its result will not be available until the returned frame counter is equal or greater to the frame counter returned by Frame.

Cast_Pipeline_To_ForwardPipeline Function

ForwardPipeline Cast_Pipeline_To_ForwardPipeline(Pipeline o)

Ceil Function

Vec3 Ceil(Vec3 v)

Returns a vector whose elements are equal to the nearest integer greater than or equal to the vector elements.

ChromaScale Function

Color ChromaScale(Color color, number k)

Return a copy of the color with its saturation scaled as specified.

Clamp Function

Vec3 Clamp(Vec3 v, number min, number max)
Vec3 Clamp(Vec3 v, Vec3 min, Vec3 max)
number Clamp(number v, number min, number max)
integer Clamp(integer v, integer min, integer max)
Color Clamp(Color color, number min, number max)
Color Clamp(Color color, Color min, Color max)

Return a vector whose elements are equal to the vector elements clipped to the specified interval.

ClampLen Function

Vec3 ClampLen(Vec3 v, number min, number max)

Returns a vector in the same direction as the specified vector, but with its length clipped by the specified interval.

ClassifyLine Function

boolean, Vec3, Vec3 ClassifyLine(MinMax minmax, Vec3 position, Vec3 direction)

Return true if the provided line intersect the bounding volume, false otherwise.

ClassifySegment Function

boolean, Vec3, Vec3 ClassifySegment(MinMax minmax, Vec3 p0, Vec3 p1)

Return true if the provided segment intersect the bounding volume, false otherwise.

CleanPath Function

string CleanPath(string path)

Cleanup a local filesystem path according to the host platform conventions.

  • Remove redundant folder separators.
  • Remove redundant . and .. folder entries.
  • Ensure forward slash (/) folder separators on Unix and back slash (\) folder separators on Windows.

ClipSpaceToScreenSpace Function

Vec3 ClipSpaceToScreenSpace(Vec3 clip, Vec2 resolution)

Convert a 3d position in clip space (homogeneous space) to a 2d position on screen.

Close Function

boolean Close(File file)

Close a file handle.

Cm Function

number Cm(number cm)

Convert a value in centimeters to the Harfang internal unit system.

See Coordinates and Units System.

ColorFromABGR32 Function

Color ColorFromABGR32(integer rgba32)

Create a color from a 32 bit ABGR integer.

ColorFromRGBA32 Function

Color ColorFromRGBA32(integer rgba32)

Create a color from a 32 bit RGBA integer.

ColorFromVector3 Function

Color ColorFromVector3(Vec3 v)

Create a color from a 3d vector, alpha defaults to 1.

ColorFromVector4 Function

Color ColorFromVector4(Vec4 v)

Return a 4-dimensional vector as a color.

ColorI Function

Color ColorI(integer r, integer g, integer b)
Color ColorI(integer r, integer g, integer b, integer a)

Create a color from integer values in the [0;255] range.

ColorToABGR32 Function

integer ColorToABGR32(Color color)

Return a 32 bit ABGR integer from a color.

ColorToGrayscale Function

number ColorToGrayscale(Color color)

Return the grayscale representation of a color. A weighted average is used to account for human perception of colors.

ColorToRGBA32 Function

integer ColorToRGBA32(Color color)

Return a 32 bit RGBA integer from a color.

Compute2DProjectionMatrix Function

Mat44 Compute2DProjectionMatrix(number znear, number zfar, number res_x, number res_y, boolean y_up)

Returns a projection matrix from a 2D space to the 3D world, as required by SetViewTransform for example.

ComputeAspectRatioX Function

Vec2 ComputeAspectRatioX(number width, number height)

Compute the aspect ratio factor for the provided viewport dimensions. Use this method to compute aspect ratio for landscape display.

See ComputeAspectRatioY.

ComputeAspectRatioY Function

Vec2 ComputeAspectRatioY(number width, number height)

Compute the aspect ratio factor for the provided viewport dimensions. Use this method to compute aspect ratio for portrait display.

See ComputeAspectRatioX.

ComputeMinMaxBoundingSphere Function

Vec3, number ComputeMinMaxBoundingSphere(MinMax minmax)

Compute the bounding sphere for the provided axis-aligned bounding box.

ComputeOrthographicProjectionMatrix Function

Mat44 ComputeOrthographicProjectionMatrix(number znear, number zfar, number size, Vec2 aspect_ratio)
Mat44 ComputeOrthographicProjectionMatrix(number znear, number zfar, number size, Vec2 aspect_ratio, Vec2 offset)

Compute an orthographic projection matrix.

An orthographic projection has no perspective and all lines parrallel in 3d space will still appear parrallel on screen after projection using the returned matrix.

The size parameter controls the extends of the projected view. When projecting a 3d world this parameter is expressed in meters. Use the aspect_ratio parameter to prevent distortion from induced by non-square viewport.

See ComputeAspectRatioX or ComputeAspectRatioY to compute an aspect ratio factor in paysage or portrait mode.

ComputeOrthographicViewState Function

ViewState ComputeOrthographicViewState(Mat4 world, number size, number znear, number zfar, Vec2 aspect_ratio)

Compute an orthographic view state.

The size parameter controls the extends of the projected view. When projecting a 3d world this parameter is expressed in meters. Use the aspect_ratio parameter to prevent distortion from induced by non-square viewport.

See ComputeOrthographicProjectionMatrix, ComputeAspectRatioX and ComputeAspectRatioY.

ComputePerspectiveProjectionMatrix Function

Mat44 ComputePerspectiveProjectionMatrix(number znear, number zfar, number zoom_factor, Vec2 aspect_ratio)
Mat44 ComputePerspectiveProjectionMatrix(number znear, number zfar, number zoom_factor, Vec2 aspect_ratio, Vec2 offset)

Compute a perspective projection matrix, , fov is the field of view angle, see Deg and Rad.

See ZoomFactorToFov, FovToZoomFactor, ComputeAspectRatioX and ComputeAspectRatioY.

ComputePerspectiveViewState Function

ViewState ComputePerspectiveViewState(Mat4 world, number fov, number znear, number zfar, Vec2 aspect_ratio)

ComputeRenderState Function

RenderState ComputeRenderState(BlendMode blend)
RenderState ComputeRenderState(BlendMode blend, DepthTest depth_test)
RenderState ComputeRenderState(BlendMode blend, DepthTest depth_test, FaceCulling culling)
RenderState ComputeRenderState(BlendMode blend, DepthTest depth_test, FaceCulling culling, boolean write_z)
RenderState ComputeRenderState(BlendMode blend, DepthTest depth_test, FaceCulling culling, boolean write_z, boolean write_r)
RenderState ComputeRenderState(BlendMode blend, DepthTest depth_test, FaceCulling culling, boolean write_z, boolean write_r, boolean write_g)
RenderState ComputeRenderState(BlendMode blend, DepthTest depth_test, FaceCulling culling, boolean write_z, boolean write_r, boolean write_g, boolean write_b)
RenderState ComputeRenderState(BlendMode blend, DepthTest depth_test, FaceCulling culling, boolean write_z, boolean write_r, boolean write_g, boolean write_b, boolean write_a)
RenderState ComputeRenderState(BlendMode blend, boolean write_z)
RenderState ComputeRenderState(BlendMode blend, boolean write_z, boolean write_r)
RenderState ComputeRenderState(BlendMode blend, boolean write_z, boolean write_r, boolean write_g)
RenderState ComputeRenderState(BlendMode blend, boolean write_z, boolean write_r, boolean write_g, boolean write_b)
RenderState ComputeRenderState(BlendMode blend, boolean write_z, boolean write_r, boolean write_g, boolean write_b, boolean write_a)

Compute a render state to control subsequent render calls culling mode, blending mode, Z mask, etc... The same render state can be used by different render calls.

See DrawLines, DrawTriangles and DrawModel.

ComputeSAO Function

nil ComputeSAO(integer view_id, IntRect rect, Texture attr0, Texture attr1, Texture noise, FrameBufferHandle output, SAO sao, Mat44 projection, number bias, number radius, integer sample_count, number sharpness)

ComputeSortKey Function

integer ComputeSortKey(number view_depth)

Compute a sorting key to control the rendering order of a display list, view_depth is expected in view space.

ComputeSortKeyFromWorld Function

integer ComputeSortKeyFromWorld(Vec3 T, Mat4 view)
integer ComputeSortKeyFromWorld(Vec3 T, Mat4 view, Mat4 model)

Compute a sorting key to control the rendering order of a display list.

ComputeTextHeight Function

number ComputeTextHeight(Font font, string text)

Compute the height of a text string.

ComputeTextRect Function

Rect ComputeTextRect(Font font, string text)
Rect ComputeTextRect(Font font, string text, number xpos)
Rect ComputeTextRect(Font font, string text, number xpos, number ypos)

Compute the width and height of a text string.

ConfigureCrowdAgent Function

CrowdAgentParams ConfigureCrowdAgent(number radius, number height, number max_acceleration, number max_speed, number collision_query_range, number path_optimization_range, number separation_weight)

Create a parameter structure for a crowd agent to be used with a Crowd object.

Contains Function

boolean Contains(MinMax minmax, Vec3 position)

Return true if the provided position is inside the bounding volume, false otherwise.

CopyDir Function

boolean CopyDir(string src, string dst)

Copy a directory on the local filesystem, this function does not recurse through subdirectories.

See CopyDirRecursive.

CopyDirRecursive Function

boolean CopyDirRecursive(string src, string dst)

Copy a directory on the local filesystem, recurse through subdirectories.

CopyFile Function

boolean CopyFile(string src, string dst)

Copy a file on the local filesystem.

CosineInterpolate Function

number CosineInterpolate(number y0, number y1, number t)

Compute the cosine interpolated value between y0 and y1 at t.

See LinearInterpolate, CubicInterpolate and HermiteInterpolate.

CreateBloomFromAssets Function

Bloom CreateBloomFromAssets(string path, BackbufferRatio ratio)

CreateBloomFromFile Function

Bloom CreateBloomFromFile(string path, BackbufferRatio ratio)

CreateCamera Function

Node CreateCamera(Scene scene, Mat4 mtx, number znear, number zfar)
Node CreateCamera(Scene scene, Mat4 mtx, number znear, number zfar, number fov)

Create a new Node with a Transform and Camera components.

CreateCapsuleModel Function

Model CreateCapsuleModel(VertexLayout decl, number radius, number height, integer subdiv_x, integer subdiv_y)

CreateConeModel Function

Model CreateConeModel(VertexLayout decl, number radius, number height, integer subdiv_x)

CreateCubeModel Function

Model CreateCubeModel(VertexLayout decl, number x, number y, number z)

CreateCylinderModel Function

Model CreateCylinderModel(VertexLayout decl, number radius, number height, integer subdiv_x)

CreateForwardPipeline Function

ForwardPipeline CreateForwardPipeline()
ForwardPipeline CreateForwardPipeline(integer shadow_map_resolution)
ForwardPipeline CreateForwardPipeline(integer shadow_map_resolution, boolean spot_16bit_shadow_map)

Create a forward pipeline and its resources.

See DestroyForwardPipeline.

CreateForwardPipelineAAAFromAssets Function

ForwardPipelineAAA CreateForwardPipelineAAAFromAssets(string path, ForwardPipelineAAAConfig config)
ForwardPipelineAAA CreateForwardPipelineAAAFromAssets(string path, ForwardPipelineAAAConfig config, BackbufferRatio ssgi_ratio)
ForwardPipelineAAA CreateForwardPipelineAAAFromAssets(string path, ForwardPipelineAAAConfig config, BackbufferRatio ssgi_ratio, BackbufferRatio ssr_ratio)

CreateForwardPipelineAAAFromFile Function

ForwardPipelineAAA CreateForwardPipelineAAAFromFile(string path, ForwardPipelineAAAConfig config)
ForwardPipelineAAA CreateForwardPipelineAAAFromFile(string path, ForwardPipelineAAAConfig config, BackbufferRatio ssgi_ratio)
ForwardPipelineAAA CreateForwardPipelineAAAFromFile(string path, ForwardPipelineAAAConfig config, BackbufferRatio ssgi_ratio, BackbufferRatio ssr_ratio)

CreateFrameBuffer Function

FrameBuffer CreateFrameBuffer(Texture color, Texture depth, string name)
FrameBuffer CreateFrameBuffer(TextureFormat color_format, TextureFormat depth_format, integer aa, string name)
FrameBuffer CreateFrameBuffer(integer width, integer height, TextureFormat color_format, TextureFormat depth_format, integer aa, string name)

Create a framebuffer and its texture attachments.

See DestroyFrameBuffer.

CreateInstanceFromAssets Function

Node, boolean CreateInstanceFromAssets(Scene scene, Mat4 mtx, string name, PipelineResources resources, PipelineInfo pipeline)
Node, boolean CreateInstanceFromAssets(Scene scene, Mat4 mtx, string name, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)

Helper function to create a Node with a Transform and an Instance component.

The instance component will be setup and its resources loaded from the assets system.

See Resources & Assets.

CreateInstanceFromFile Function

Node, boolean CreateInstanceFromFile(Scene scene, Mat4 mtx, string name, PipelineResources resources, PipelineInfo pipeline)
Node, boolean CreateInstanceFromFile(Scene scene, Mat4 mtx, string name, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)

Helper function to create a Node with a Transform and an Instance component.

The instance component will be setup and its resources loaded from the local filesystem.

See Resources & Assets.

CreateLinearLight Function

Node CreateLinearLight(Scene scene, Mat4 mtx)
Node CreateLinearLight(Scene scene, Mat4 mtx, Color diffuse)
Node CreateLinearLight(Scene scene, Mat4 mtx, Color diffuse, Color specular)
Node CreateLinearLight(Scene scene, Mat4 mtx, Color diffuse, Color specular, number priority)
Node CreateLinearLight(Scene scene, Mat4 mtx, Color diffuse, Color specular, number priority, LightShadowType shadow_type)
Node CreateLinearLight(Scene scene, Mat4 mtx, Color diffuse, Color specular, number priority, LightShadowType shadow_type, number shadow_bias, Vec4 pssm_split)
Node CreateLinearLight(Scene scene, Mat4 mtx, Color diffuse, number diffuse_intensity)
Node CreateLinearLight(Scene scene, Mat4 mtx, Color diffuse, number diffuse_intensity, Color specular)
Node CreateLinearLight(Scene scene, Mat4 mtx, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity)
Node CreateLinearLight(Scene scene, Mat4 mtx, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority)
Node CreateLinearLight(Scene scene, Mat4 mtx, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority, LightShadowType shadow_type)
Node CreateLinearLight(Scene scene, Mat4 mtx, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority, LightShadowType shadow_type, number shadow_bias, Vec4 pssm_split)

Helper function to create a Node with a Transform and a Light component.

CreateMaterial Function

Material CreateMaterial(PipelineProgramRef prg)
Material CreateMaterial(PipelineProgramRef prg, string value_name, Vec4 value)
Material CreateMaterial(PipelineProgramRef prg, string value_name_0, Vec4 value_0, string value_name_1, Vec4 value_1)

Helper function to create a material.

See SetMaterialProgram, SetMaterialValue and SetMaterialTexture.

CreateMissingMaterialProgramValuesFromAssets Function

nil CreateMissingMaterialProgramValuesFromAssets(Material mat, PipelineResources resources)

This function scans the material program uniforms and creates a corresponding entry in the material if missing.

Resources are loaded from the asset system if a default uniform value requires it.

See Resources & Assets.

CreateMissingMaterialProgramValuesFromFile Function

nil CreateMissingMaterialProgramValuesFromFile(Material mat, PipelineResources resources)

This function scans the material program uniforms and creates a corresponding entry in the material if missing.

Resources are loaded from the local filesystem if a default uniform value requires it.

CreateNavMeshQuery Function

NavMeshQuery CreateNavMeshQuery(NavMesh mesh)

Create a navigation mesh query from a navigation mesh.

See FindNavigationPathTo to perform an actual query.

CreateObject Function

Node CreateObject(Scene scene, Mat4 mtx, ModelRef model, MaterialList materials)

Create a Node with a Transform and Object components.

CreateOrthographicCamera Function

Node CreateOrthographicCamera(Scene scene, Mat4 mtx, number znear, number zfar)
Node CreateOrthographicCamera(Scene scene, Mat4 mtx, number znear, number zfar, number size)

Create a Node with a Transform and a Camera component.

CreatePhysicCube Function

Node CreatePhysicCube(Scene scene, Vec3 size, Mat4 mtx, ModelRef model_ref, MaterialList materials)
Node CreatePhysicCube(Scene scene, Vec3 size, Mat4 mtx, ModelRef model_ref, MaterialList materials, number mass)

Create a Node with a Transform, Object and RigidBody components.

CreatePhysicSphere Function

Node CreatePhysicSphere(Scene scene, number radius, Mat4 mtx, ModelRef model_ref, MaterialList materials)
Node CreatePhysicSphere(Scene scene, number radius, Mat4 mtx, ModelRef model_ref, MaterialList materials, number mass)

Create a Node with a Transform, Object and RigidBody components.

CreatePlaneModel Function

Model CreatePlaneModel(VertexLayout decl, number width, number length, integer subdiv_x, integer subdiv_z)

Create a plane render model.

CreatePointLight Function

Node CreatePointLight(Scene scene, Mat4 mtx, number radius)
Node CreatePointLight(Scene scene, Mat4 mtx, number radius, Color diffuse)
Node CreatePointLight(Scene scene, Mat4 mtx, number radius, Color diffuse, Color specular)
Node CreatePointLight(Scene scene, Mat4 mtx, number radius, Color diffuse, Color specular, number priority)
Node CreatePointLight(Scene scene, Mat4 mtx, number radius, Color diffuse, Color specular, number priority, LightShadowType shadow_type)
Node CreatePointLight(Scene scene, Mat4 mtx, number radius, Color diffuse, Color specular, number priority, LightShadowType shadow_type, number shadow_bias)
Node CreatePointLight(Scene scene, Mat4 mtx, number radius, Color diffuse, number diffuse_intensity)
Node CreatePointLight(Scene scene, Mat4 mtx, number radius, Color diffuse, number diffuse_intensity, Color specular)
Node CreatePointLight(Scene scene, Mat4 mtx, number radius, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity)
Node CreatePointLight(Scene scene, Mat4 mtx, number radius, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority)
Node CreatePointLight(Scene scene, Mat4 mtx, number radius, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority, LightShadowType shadow_type)
Node CreatePointLight(Scene scene, Mat4 mtx, number radius, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority, LightShadowType shadow_type, number shadow_bias)

Create a Node with a Transform and a Light component.

CreateSAOFromAssets Function

SAO CreateSAOFromAssets(string path, BackbufferRatio ratio)

CreateSAOFromFile Function

SAO CreateSAOFromFile(string path, BackbufferRatio ratio)

CreateSceneRootNode Function

Node CreateSceneRootNode(Scene scene, string name, Mat4 mtx)

Helper function to create a Node with a Transform component then parent all root nodes in the scene to it.

CreateScript Function

Node CreateScript(Scene scene)
Node CreateScript(Scene scene, string path)

Helper function to create a Node with a Script component.

CreateSphereModel Function

Model CreateSphereModel(VertexLayout decl, number radius, integer subdiv_x, integer subdiv_y)

CreateSpotLight Function

Node CreateSpotLight(Scene scene, Mat4 mtx, number radius, number inner_angle, number outer_angle)
Node CreateSpotLight(Scene scene, Mat4 mtx, number radius, number inner_angle, number outer_angle, Color diffuse)
Node CreateSpotLight(Scene scene, Mat4 mtx, number radius, number inner_angle, number outer_angle, Color diffuse, Color specular)
Node CreateSpotLight(Scene scene, Mat4 mtx, number radius, number inner_angle, number outer_angle, Color diffuse, Color specular, number priority)
Node CreateSpotLight(Scene scene, Mat4 mtx, number radius, number inner_angle, number outer_angle, Color diffuse, Color specular, number priority, LightShadowType shadow_type)
Node CreateSpotLight(Scene scene, Mat4 mtx, number radius, number inner_angle, number outer_angle, Color diffuse, Color specular, number priority, LightShadowType shadow_type, number shadow_bias)
Node CreateSpotLight(Scene scene, Mat4 mtx, number radius, number inner_angle, number outer_angle, Color diffuse, Color specular, number priority, LightShadowType shadow_type, number shadow_bias, number shadow_near)
Node CreateSpotLight(Scene scene, Mat4 mtx, number radius, number inner_angle, number outer_angle, Color diffuse, Color specular, number priority, LightShadowType shadow_type, number shadow_bias, number shadow_near, number shadow_far)
Node CreateSpotLight(Scene scene, Mat4 mtx, number radius, number inner_angle, number outer_angle, Color diffuse, number diffuse_intensity)
Node CreateSpotLight(Scene scene, Mat4 mtx, number radius, number inner_angle, number outer_angle, Color diffuse, number diffuse_intensity, Color specular)
Node CreateSpotLight(Scene scene, Mat4 mtx, number radius, number inner_angle, number outer_angle, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity)
Node CreateSpotLight(Scene scene, Mat4 mtx, number radius, number inner_angle, number outer_angle, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority)
Node CreateSpotLight(Scene scene, Mat4 mtx, number radius, number inner_angle, number outer_angle, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority, LightShadowType shadow_type)
Node CreateSpotLight(Scene scene, Mat4 mtx, number radius, number inner_angle, number outer_angle, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority, LightShadowType shadow_type, number shadow_bias)
Node CreateSpotLight(Scene scene, Mat4 mtx, number radius, number inner_angle, number outer_angle, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority, LightShadowType shadow_type, number shadow_bias, number shadow_near)
Node CreateSpotLight(Scene scene, Mat4 mtx, number radius, number inner_angle, number outer_angle, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority, LightShadowType shadow_type, number shadow_bias, number shadow_near, number shadow_far)

Create a Node with a Transform and a Light component.

CreateTexture Function

Texture CreateTexture(integer width, integer height, string name, TextureFlags flags)
Texture CreateTexture(integer width, integer height, string name, TextureFlags flags, TextureFormat format)

Create an empty texture.

See CreateTextureFromPicture and UpdateTextureFromPicture.

CreateTextureFromPicture Function

Texture CreateTextureFromPicture(Picture pic, string name, TextureFlags flags)
Texture CreateTextureFromPicture(Picture pic, string name, TextureFlags flags, TextureFormat format)

Create a texture from a picture.

See Picture, CreateTexture and UpdateTextureFromPicture.

Crop Function

Rect Crop(Rect rect, number left, number top, number right, number bottom)
IntRect Crop(IntRect rect, integer left, integer top, integer right, integer bottom)

Crop a rectangle. Remove the specified amount of units on each side of the rectangle.

See Grow.

Cross Function

Vec3 Cross(Vec3 a, Vec3 b)

Return the cross product of two vectors.

CrossProductMat3 Function

Mat3 CrossProductMat3(Vec3 V)

Creates a matrix M so that Mv = p⨯v.

Simply put, multiplying this matrix to any vector v is equivalent to compute the cross product between p and v.

CubicInterpolate Function

number CubicInterpolate(number y0, number y1, number y2, number y3, number t)
Vec3 CubicInterpolate(Vec3 v0, Vec3 v1, Vec3 v2, Vec3 v3, number t)

Perform a cubic interpolation across four values with t in the [0;1] range between y1 and y2.

See LinearInterpolate, CosineInterpolate and HermiteInterpolate.

CutFileExtension Function

string CutFileExtension(string path)

Return a file path with its extension stripped.

See CutFilePath and CutFileName.

CutFileName Function

string CutFileName(string path)

Return the name part of a file path. All folder navigation and extension are stripped.

See CutFileExtension and CutFilePath.

CutFilePath Function

string CutFilePath(string path)

Return the folder navigation part of a file path. The file name and its extension are stripped.

See CutFileExtension and CutFileName.

Debug Function

nil Debug(string msg)
nil Debug(string msg, string details)

DebugSceneExplorer Function

nil DebugSceneExplorer(Scene scene, string name)

Decompose Function

Vec3, Vec3, Vec3 Decompose(Mat4 m)
Vec3, Vec3, Vec3 Decompose(Mat4 m, RotationOrder rotation_order)

Decompose a transformation matrix into its translation, scaling and rotation components.

Deg Function

number Deg(number degrees)

Convert an angle in degrees to the engine unit system.

See Coordinates and Units System.

Deg3 Function

Vec3 Deg3(number x, number y, number z)

Convert a triplet of angles in degrees to the engine unit system.

See Coordinates and Units System.

DegreeToRadian Function

number DegreeToRadian(number degrees)

Convert an angle in degrees to radians.

DestroyBloom Function

nil DestroyBloom(Bloom bloom)

Destroy a bloom post process object and all associated resources.

DestroyForwardPipeline Function

nil DestroyForwardPipeline(ForwardPipeline pipeline)

Destroy a forward pipeline object.

DestroyForwardPipelineAAA Function

nil DestroyForwardPipelineAAA(ForwardPipelineAAA pipeline)

DestroyFrameBuffer Function

nil DestroyFrameBuffer(FrameBuffer frameBuffer)

Destroy a frame buffer and its resources.

DestroyNavMesh Function

nil DestroyNavMesh(NavMesh mesh)

Destroy a navigation mesh object.

DestroyNavMeshQuery Function

nil DestroyNavMeshQuery(NavMeshQuery mesh)

Destroy a navigation mesh query object.

DestroyProgram Function

nil DestroyProgram(ProgramHandle h)

Destroy a shader program.

DestroySAO Function

nil DestroySAO(SAO sao)

Destroy an ambient occlusion post process object and its resources.

DestroyTexture Function

nil DestroyTexture(Texture tex)

Destroy a texture object.

DestroyWindow Function

boolean DestroyWindow(Window window)

Destroy a window object.

Det Function

number Det(Mat3 m)

Return the determinant of a matrix.

DisableCursor Function

nil DisableCursor()

Dist Function

number Dist(Vec2 a, Vec2 b)
integer Dist(iVec2 a, iVec2 b)
number Dist(Quaternion a, Quaternion b)
number Dist(Vec3 a, Vec3 b)

Return the Euclidean distance between two vectors.

Dist2 Function

number Dist2(Vec2 a, Vec2 b)
integer Dist2(iVec2 a, iVec2 b)
number Dist2(Vec3 a, Vec3 b)

Return the squared Euclidean distance between two vectors.

DistanceToPlane Function

number DistanceToPlane(Vec4 plane, Vec3 p)

Return the signed distance from point p to a plane.

  • Distance is positive if p is in front of the plane, meaning that the plane normal is pointing towards p.
  • Distance is negative if p is behind the plane, meaning that the plane normal is pointing away from p.
  • Distance is 0.0 if p is lying on the plane.

Dot Function

number Dot(Vec2 a, Vec2 b)
integer Dot(iVec2 a, iVec2 b)
number Dot(Vec3 a, Vec3 b)

Return the dot product of two vectors.

DrawLines Function

nil DrawLines(integer view_id, Vertices vtx, ProgramHandle prg)
nil DrawLines(integer view_id, Vertices vtx, ProgramHandle prg, RenderState render_state)
nil DrawLines(integer view_id, Vertices vtx, ProgramHandle prg, RenderState render_state, integer depth)
nil DrawLines(integer view_id, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures)
nil DrawLines(integer view_id, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState render_state)
nil DrawLines(integer view_id, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState render_state, integer depth)
nil DrawLines(integer view_id, UInt16List idx, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures)
nil DrawLines(integer view_id, UInt16List idx, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState render_state)
nil DrawLines(integer view_id, UInt16List idx, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState render_state, integer depth)

Draw a list of lines to the specified view.

Use UniformSetValueList and UniformSetTextureList to pass uniform values to the shader program.

DrawModel Function

nil DrawModel(integer view_id, Model mdl, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, Mat4 matrix)
nil DrawModel(integer view_id, Model mdl, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, Mat4 matrix, RenderState render_state)
nil DrawModel(integer view_id, Model mdl, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, Mat4 matrix, RenderState render_state, integer depth)
nil DrawModel(integer view_id, Model mdl, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, Mat4List matrices)
nil DrawModel(integer view_id, Model mdl, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, Mat4List matrices, RenderState render_state)
nil DrawModel(integer view_id, Model mdl, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, Mat4List matrices, RenderState render_state, integer depth)

Draw a model to the specified view.

Use UniformSetValueList and UniformSetTextureList to pass uniform values to the shader program.

DrawNavMesh Function

nil DrawNavMesh(NavMesh mesh, integer view_id, VertexLayout vtx_decl, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState state)

Draw a navigation mesh to the specified view. This is function is for debugging purpose.

Use UniformSetValueList and UniformSetTextureList to pass uniform values to the shader program.

DrawSprites Function

nil DrawSprites(integer view_id, Mat3 inv_view_R, VertexLayout vtx_layout, Vec3List pos, Vec2 size, ProgramHandle prg)
nil DrawSprites(integer view_id, Mat3 inv_view_R, VertexLayout vtx_layout, Vec3List pos, Vec2 size, ProgramHandle prg, RenderState state)
nil DrawSprites(integer view_id, Mat3 inv_view_R, VertexLayout vtx_layout, Vec3List pos, Vec2 size, ProgramHandle prg, RenderState state, integer depth)
nil DrawSprites(integer view_id, Mat3 inv_view_R, VertexLayout vtx_layout, Vec3List pos, Vec2 size, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures)
nil DrawSprites(integer view_id, Mat3 inv_view_R, VertexLayout vtx_layout, Vec3List pos, Vec2 size, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState state)
nil DrawSprites(integer view_id, Mat3 inv_view_R, VertexLayout vtx_layout, Vec3List pos, Vec2 size, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState state, integer depth)

Draw a list of sprites to the specified view.

Use UniformSetValueList and UniformSetTextureList to pass uniform values to the shader program.

Note: This function prepares the sprite on the CPU before submitting them all to the GPU as a single draw call.

DrawText Function

nil DrawText(integer view_id, Font font, string text, ProgramHandle prg, string page_uniform, integer page_stage, Mat4 mtx)
nil DrawText(integer view_id, Font font, string text, ProgramHandle prg, string page_uniform, integer page_stage, Mat4 mtx, Vec3 pos)
nil DrawText(integer view_id, Font font, string text, ProgramHandle prg, string page_uniform, integer page_stage, Mat4 mtx, Vec3 pos, DrawTextHAlign halign, DrawTextVAlign valign)
nil DrawText(integer view_id, Font font, string text, ProgramHandle prg, string page_uniform, integer page_stage, Mat4 mtx, Vec3 pos, DrawTextHAlign halign, DrawTextVAlign valign, UniformSetValueList values, UniformSetTextureList textures)
nil DrawText(integer view_id, Font font, string text, ProgramHandle prg, string page_uniform, integer page_stage, Mat4 mtx, Vec3 pos, DrawTextHAlign halign, DrawTextVAlign valign, UniformSetValueList values, UniformSetTextureList textures, RenderState state)
nil DrawText(integer view_id, Font font, string text, ProgramHandle prg, string page_uniform, integer page_stage, Mat4 mtx, Vec3 pos, DrawTextHAlign halign, DrawTextVAlign valign, UniformSetValueList values, UniformSetTextureList textures, RenderState state, integer depth)

Write text to the specified view using the provided shader program and uniform values.

DrawTriangles Function

nil DrawTriangles(integer view_id, Vertices vtx, ProgramHandle prg)
nil DrawTriangles(integer view_id, Vertices vtx, ProgramHandle prg, RenderState state)
nil DrawTriangles(integer view_id, Vertices vtx, ProgramHandle prg, RenderState state, integer depth)
nil DrawTriangles(integer view_id, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures)
nil DrawTriangles(integer view_id, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState state)
nil DrawTriangles(integer view_id, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState state, integer depth)
nil DrawTriangles(integer view_id, UInt16List idx, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures)
nil DrawTriangles(integer view_id, UInt16List idx, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState state)
nil DrawTriangles(integer view_id, UInt16List idx, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState state, integer depth)

Draw a list of triangles to the specified view.

Use UniformSetValueList and UniformSetTextureList to pass uniform values to the shader program.

DuplicateNodeAndChildrenFromAssets Function

NodeList DuplicateNodeAndChildrenFromAssets(Scene scene, Node node, PipelineResources resources, PipelineInfo pipeline)

Duplicate a node and its child hierarchy. Resources will be loaded from the assets system.

See Resources & Assets.

DuplicateNodeAndChildrenFromFile Function

NodeList DuplicateNodeAndChildrenFromFile(Scene scene, Node node, PipelineResources resources, PipelineInfo pipeline)

Duplicate a node and its child hierarchy. Resources will be loaded from the local filesystem.

See Resources & Assets.

DuplicateNodeFromAssets Function

Node DuplicateNodeFromAssets(Scene scene, Node node, PipelineResources resources, PipelineInfo pipeline)

Duplicate a node. Resources will be loaded from the assets system.

See Resources & Assets.

DuplicateNodeFromFile Function

Node DuplicateNodeFromFile(Scene scene, Node node, PipelineResources resources, PipelineInfo pipeline)

Duplicate a node. Resources will be loaded from the local filesystem.

See Resources & Assets.

DuplicateNodesAndChildrenFromAssets Function

NodeList DuplicateNodesAndChildrenFromAssets(Scene scene, NodeList nodes, PipelineResources resources, PipelineInfo pipeline)

Duplicate each node and children hierarchy of a list. Resources will be loaded from the assets system.

See Resources & Assets.

DuplicateNodesAndChildrenFromFile Function

NodeList DuplicateNodesAndChildrenFromFile(Scene scene, NodeList nodes, PipelineResources resources, PipelineInfo pipeline)

Duplicate each node and children hierarchy of a list. Resources will be loaded from the local filesystem.

See Resources & Assets.

DuplicateNodesFromAssets Function

NodeList DuplicateNodesFromAssets(Scene scene, NodeList nodes, PipelineResources resources, PipelineInfo pipeline)

Duplicate each node of a list. Resources will be loaded from the assets system.

DuplicateNodesFromFile Function

NodeList DuplicateNodesFromFile(Scene scene, NodeList nodes, PipelineResources resources, PipelineInfo pipeline)

Duplicate each node of a list. Resources will be loaded from the local filesystem.

See Resources & Assets.

EndProfilerFrame Function

ProfilerFrame EndProfilerFrame()

End a profiler frame and return it.

See PrintProfilerFrame to print a profiler frame to the console.

EndProfilerSection Function

nil EndProfilerSection(integer section_idx)

End a named profiler section. Call BeginProfilerSection to begin a new section.

Error Function

nil Error(string msg)
nil Error(string msg, string details)

Exists Function

boolean Exists(string path)

Return true if a file exists on the local filesystem, false otherwise.

ExtractZoomFactorFromProjectionMatrix Function

number ExtractZoomFactorFromProjectionMatrix(Mat44 m, Vec2 aspect_ratio)

Extract zoom factor from a projection matrix.

See ZoomFactorToFov.

ExtractZRangeFromOrthographicProjectionMatrix Function

number, number ExtractZRangeFromOrthographicProjectionMatrix(Mat44 m)

ExtractZRangeFromPerspectiveProjectionMatrix Function

number, number ExtractZRangeFromPerspectiveProjectionMatrix(Mat44 m)

ExtractZRangeFromProjectionMatrix Function

number, number ExtractZRangeFromProjectionMatrix(Mat44 m)

Extract z near and z far clipping range from a projection matrix.

FaceForward Function

Vec3 FaceForward(Vec3 v, Vec3 d)

Return the provided vector facing toward the provided direction. If the angle between v and d is less than 90° then v is returned unchanged, v will be returned reversed otherwise.

FactorizePath Function

string FactorizePath(string path)

Return the input path with all redundant navigation entries stripped (folder separator, .. and . entries).

FileToString Function

string FileToString(string path)

Return the content of a local filesystem as a string.

FindNavigationPathTo Function

Vec3List FindNavigationPathTo(NavMeshQuery query, Vec3 from, Vec3 to)

Return the navigation path between from and to as a list of Vec3 world positions.

See CreateNavMeshQuery.

FitsInside Function

boolean FitsInside(Rect a, Rect b)
boolean FitsInside(IntRect a, IntRect b)

Return wether a fits in b.

Floor Function

Vec3 Floor(Vec3 v)

Returns a vector whose elements are equal to the nearest integer less than or equal to the vector elements.

FovToZoomFactor Function

number FovToZoomFactor(number fov)

Convert from a fov value in radian to a zoom factor value in meters.

FpsController Function

nil FpsController(boolean key_up, boolean key_down, boolean key_left, boolean key_right, boolean btn, number dx, number dy, Vec3 pos, Vec3 rot, number speed, integer dt_t)
nil FpsController(Keyboard keyboard, Mouse mouse, Vec3 pos, Vec3 rot, number speed, integer dt)

Implement a first-person-shooter like controller.

The input position and rotation parameters are returned modified according to the state of the control keys.

This function is usually used by passing the current camera position and rotation then updating the camera transformation with the returned values.

Frame Function

integer Frame()

Advance the rendering backend to the next frame, execute all queued rendering commands. This function returns the backend current frame.

The frame counter is used by asynchronous functions such as CaptureTexture. You must wait for the frame counter to reach or exceed the value returned by an asynchronous function before accessing its result.

FRand Function

number FRand()
number FRand(number range)

Return a random floating point value in the provided range, default range is [0;1].

See Rand to generate a random integer value.

FromHLS Function

Color FromHLS(Color color)

Convert input hue/luminance/saturation color to RGBA, alpha channel is left unmodified.

FRRand Function

number FRRand()
number FRRand(number range_start)
number FRRand(number range_start, number range_end)

Return a random floating point value in the provided range, default range is [-1;1].

GaussianBlurIsoSurface Function

IsoSurface GaussianBlurIsoSurface(IsoSurface surface, integer width, integer height, integer depth)

Apply a Gaussian blur to an iso-surface.

GetArea Function

number GetArea(MinMax minmax)

Return the area of the volume.

GetCenter Function

Vec3 GetCenter(MinMax minmax)

Return the center position of the volume.

GetClock Function

integer GetClock()

Return the current clock since the last call to TickClock or ResetClock.

See time_to_sec_f to convert the returned time to second.

GetClockDt Function

integer GetClockDt()

Return the elapsed time recorded during the last call to TickClock.

GetColorTexture Function

Texture GetColorTexture(FrameBuffer frameBuffer)

Retrieves color texture attachment.

GetColumn Function

Vec3 GetColumn(Mat3 m, integer n)
Vec3 GetColumn(Mat4 m, integer n)
Vec4 GetColumn(Mat44 m, integer idx)

Returns the nth column.

GetCurrentWorkingDirectory Function

string GetCurrentWorkingDirectory()

Return the system current working directory.

GetDepthTexture Function

Texture GetDepthTexture(FrameBuffer frameBuffer)

Retrieves depth texture attachment.

GetFileExtension Function

string GetFileExtension(string path)

Return the extension part of a file path.

GetFileName Function

string GetFileName(string path)

Return the name part of a file path (including its extension).

GetFilePath Function

string GetFilePath(string path)

Return the path part of a file path (excluding file name and extension).

GetForwardPipelineInfo Function

PipelineInfo GetForwardPipelineInfo()

Return the pipeline info object for the forward pipeline.

GetGamepadNames Function

StringList GetGamepadNames()

Return a list of names for all supported gamepad devices on the system.

See ReadGamepad.

GetHandJointAngularVelocity Function

Vec3 GetHandJointAngularVelocity(HandsSide hand, XrHandJoint handJoint)

GetHandJointLinearVelocity Function

Vec3 GetHandJointLinearVelocity(HandsSide hand, XrHandJoint handJoint)

GetHandJointPose Function

Mat4 GetHandJointPose(HandsSide hand, XrHandJoint handJoint)

GetHandJointRadius Function

number GetHandJointRadius(HandsSide hand, XrHandJoint handJoint)

GetHeight Function

number GetHeight(Rect rect)
integer GetHeight(IntRect rect)

Return the height of a rectangle.

GetJoystickDeviceNames Function

StringList GetJoystickDeviceNames()

GetJoystickNames Function

StringList GetJoystickNames()

GetJsonBool Function

boolean, boolean GetJsonBool(JSON js, string key)

Return the value of a boolean JSON key.

GetJsonFloat Function

boolean, number GetJsonFloat(JSON js, string key)

Return the value of a float JSON key.

GetJsonInt Function

boolean, integer GetJsonInt(JSON js, string key)

Return the value of an integer JSON key.

GetJsonString Function

boolean, string GetJsonString(JSON js, string key)

Return the value of a string JSON key.

GetKeyboardNames Function

StringList GetKeyboardNames()

Return a list of names for all supported keyboard devices on the system.

See ReadKeyboard.

GetKeyName Function

string GetKeyName(Key key)
string GetKeyName(Key key, string name)

Return the name for a keyboard key.

GetMaterialAlphaCut Function

boolean GetMaterialAlphaCut(Material mat)

GetMaterialAmbientUsesUV1 Function

boolean GetMaterialAmbientUsesUV1(Material mat)

GetMaterialBlendMode Function

BlendMode GetMaterialBlendMode(Material mat)

Return a material blending mode.

GetMaterialDepthTest Function

DepthTest GetMaterialDepthTest(Material mat)

Return a material depth test function.

GetMaterialDiffuseUsesUV1 Function

boolean GetMaterialDiffuseUsesUV1(Material mat)

GetMaterialFaceCulling Function

FaceCulling GetMaterialFaceCulling(Material mat)

Return a material culling mode.

GetMaterialNormalMapInWorldSpace Function

boolean GetMaterialNormalMapInWorldSpace(Material mat)

GetMaterialSkinning Function

boolean GetMaterialSkinning(Material mat)

GetMaterialSpecularUsesUV1 Function

boolean GetMaterialSpecularUsesUV1(Material mat)

GetMaterialTexture Function

TextureRef GetMaterialTexture(Material mat, string name)

Return the texture reference assigned to a material named uniform.

GetMaterialTextures Function

StringList GetMaterialTextures(Material mat)

Return the list of names of a material texture uniforms.

GetMaterialValues Function

StringList GetMaterialValues(Material mat)

Return the list of names of a material value uniforms.

GetMaterialWriteRGBA Function

boolean, boolean, boolean, boolean GetMaterialWriteRGBA(Material mat)

Return the material color mask.

GetMaterialWriteZ Function

boolean GetMaterialWriteZ(Material mat)

Return the material depth write mask.

GetMonitorModes Function

boolean, MonitorModeList GetMonitorModes(Monitor monitor)

Return the list of supported monitor modes.

GetMonitorName Function

string GetMonitorName(Monitor monitor)

Return the monitor name.

GetMonitorRect Function

IntRect GetMonitorRect(Monitor monitor)

Returns a rectangle going from the position, in screen coordinates, of the upper-left corner of the specified monitor to the position of the lower-right corner.

GetMonitors Function

MonitorList GetMonitors()

Return a list of monitors connected to the system.

GetMonitorSizeMM Function

iVec2 GetMonitorSizeMM(Monitor monitor)

Returns the size, in millimetres, of the display area of the specified monitor.

GetMouseNames Function

StringList GetMouseNames()

Return a list of names for all supported mouse devices on the system.

See ReadKeyboard.

GetNodePairContacts Function

ContactList GetNodePairContacts(Node first, Node second, NodePairContacts node_pair_contacts)

GetNodesInContact Function

NodeList GetNodesInContact(Scene scene, Node with, NodePairContacts node_pair_contacts)

GetR Function

Vec3 GetR(Mat4 m)
Vec3 GetR(Mat4 m, RotationOrder rotation_order)

GetRMatrix Function

Mat3 GetRMatrix(Mat4 m)

GetRotation Function

Vec3 GetRotation(Mat4 m)
Vec3 GetRotation(Mat4 m, RotationOrder rotation_order)

Return the rotation component of a transformation matrix as a Euler triplet.

GetRotationMatrix Function

Mat3 GetRotationMatrix(Mat4 m)

Return the rotation component of a transformation matrix as a Mat3 rotation matrix.

GetRow Function

Vec3 GetRow(Mat3 m, integer n)
Vec4 GetRow(Mat4 m, integer n)
Vec4 GetRow(Mat44 m, integer idx)

Returns the nth row of a matrix.

GetS Function

Vec3 GetS(Mat4 m)

GetScale Function

Vec3 GetScale(Mat3 m)
Vec3 GetScale(Mat4 m)

Return the scale component of a matrix a scale vector.

GetSceneForwardPipelineFog Function

ForwardPipelineFog GetSceneForwardPipelineFog(Scene scene)

GetSceneForwardPipelineLights Function

ForwardPipelineLightList GetSceneForwardPipelineLights(Scene scene)

Filter through the scene lights and return a list of pipeline lights to be used by the scene forward pipeline.

GetSceneForwardPipelinePassViewId Function

integer GetSceneForwardPipelinePassViewId(SceneForwardPipelinePassViewId views, SceneForwardPipelinePass pass)

Return the view id for a scene forward pipeline pass id.

GetScenePhysicsBackendName Function

string GetScenePhysicsBackendName()

GetSize Function

integer GetSize(File file)
Vec2 GetSize(Rect rect)
iVec2 GetSize(IntRect rect)

Return the size in bytes of a local file.

GetSourceDuration Function

integer GetSourceDuration(SourceRef source)

Return the duration of an audio source.

GetSourceState Function

SourceState GetSourceState(SourceRef source)

Return the state of an audio source.

GetSourceTimecode Function

integer GetSourceTimecode(SourceRef source)

Return the current timecode of a playing audio source.

GetT Function

Vec3 GetT(Mat4 m)

GetTextures Function

Texture, Texture GetTextures(FrameBuffer framebuffer)

Returns color and depth texture attachments.

GetTranslation Function

Vec3 GetTranslation(Mat3 m)
Vec3 GetTranslation(Mat4 m)

Return the translation part of a tranformation matrix as a translation vector.

GetUserFolder Function

string GetUserFolder()

Return the system user folder for the current user.

GetVRControllerNames Function

StringList GetVRControllerNames()

Return a list of names for all supported VR controller devices on the system.

See ReadVRController.

GetVRGenericTrackerNames Function

StringList GetVRGenericTrackerNames()

Return a list of names for all supported VR tracker devices on the system.

GetWidth Function

number GetWidth(Rect rect)
integer GetWidth(IntRect rect)

Return the width of a rectangle.

GetWindowClientSize Function

boolean, integer, integer GetWindowClientSize(Window window)

Return a window client rectangle. The client area of a window does not include its decorations.

GetWindowContentScale Function

Vec2 GetWindowContentScale(Window window)

GetWindowHandle Function

VoidPointer GetWindowHandle(Window window)

Return the system native window handle.

GetWindowInFocus Function

Window GetWindowInFocus()

Return the system window with input focus.

GetWindowPos Function

iVec2 GetWindowPos(Window window)

Return a window position on screen.

GetWindowTitle Function

boolean, string GetWindowTitle(Window window)

Return a window title.

GetX Function

Vec3 GetX(Mat3 m)
Vec3 GetX(Mat4 m)
number GetX(Rect rect)
integer GetX(IntRect rect)

Return the scaled X axis of a transformation matrix.

GetY Function

Vec3 GetY(Mat3 m)
Vec3 GetY(Mat4 m)
number GetY(Rect rect)
integer GetY(IntRect rect)

Return the scaled Y axis of a transformation matrix.

GetZ Function

Vec3 GetZ(Mat3 m)
Vec3 GetZ(Mat4 m)

Return the scaled Z axis of a transformation matrix.

Grow Function

Rect Grow(Rect rect, number border)
IntRect Grow(IntRect rect, integer border)

Grow a rectangle by the specified amount of units.

See Crop.

HasFileExtension Function

boolean HasFileExtension(string path)

Test the extension of a file path.

HermiteInterpolate Function

number HermiteInterpolate(number y0, number y1, number y2, number y3, number t, number tension, number bias)

Perform a Hermite interpolation across four values with t in the [0;1] range between y1 and y2. The tension and bias parameters can be used to control the shape of underlying interpolation curve.

See LinearInterpolate, CosineInterpolate and CubicInterpolate.

HideCursor Function

nil HideCursor()

Hide the system mouse cursor.

See ShowCursor.

ImGuiAlignTextToFramePadding Function

nil ImGuiAlignTextToFramePadding()

Vertically align upcoming text baseline to FramePadding y coordinate so that it will align properly to regularly framed items.

ImGuiBegin Function

boolean ImGuiBegin(string name)
boolean, boolean ImGuiBegin(string name, boolean open, ImGuiWindowFlags flags)

Start a new window.

ImGuiBeginChild Function

boolean ImGuiBeginChild(string id)
boolean ImGuiBeginChild(string id, Vec2 size)
boolean ImGuiBeginChild(string id, Vec2 size, boolean border)
boolean ImGuiBeginChild(string id, Vec2 size, boolean border, ImGuiWindowFlags flags)

Begin a scrolling region.

ImGuiBeginCombo Function

boolean ImGuiBeginCombo(string label, string preview_value)
boolean ImGuiBeginCombo(string label, string preview_value, ImGuiComboFlags flags)

Begin a ImGui Combo Box.

ImGuiBeginFrame Function

nil ImGuiBeginFrame(integer width, integer height, integer dt_clock, MouseState mouse, KeyboardState keyboard)
nil ImGuiBeginFrame(DearImguiContext ctx, integer width, integer height, integer dt_clock, MouseState mouse, KeyboardState keyboard)

Begin an ImGui frame. This function must be called once per frame before any other ImGui call.

When using multiple contexts, it must be called for each context you intend to use during the current frame.

See ImGuiEndFrame.

ImGuiBeginGroup Function

nil ImGuiBeginGroup()

Lock horizontal starting position. Once closing a group it is seen as a single item (so you can use ImGuiIsItemHovered on a group, ImGuiSameLine between groups, etc...).

ImGuiBeginMainMenuBar Function

boolean ImGuiBeginMainMenuBar()

Create and append to a full screen menu-bar.

Note: Only call ImGuiEndMainMenuBar if this returns true.

ImGuiBeginMenu Function

boolean ImGuiBeginMenu(string label)
boolean ImGuiBeginMenu(string label, boolean enabled)

Create a sub-menu entry.

Note: Only call ImGuiEndMenu if this returns true.

ImGuiBeginMenuBar Function

boolean ImGuiBeginMenuBar()

Start append to the menu-bar of the current window (requires the WindowFlags_MenuBar flag).

Note: Only call ImGuiEndMenuBar if this returns true.

ImGuiBeginPopup Function

boolean ImGuiBeginPopup(string id)

Return true if popup is opened and starts outputting to it.

Note: Only call ImGuiEndPopup if this returns true.

ImGuiBeginPopupContextItem Function

boolean ImGuiBeginPopupContextItem(string id)
boolean ImGuiBeginPopupContextItem(string id, integer mouse_button)

ImGui helper to open and begin popup when clicked on last item.

ImGuiBeginPopupContextVoid Function

boolean ImGuiBeginPopupContextVoid()
boolean ImGuiBeginPopupContextVoid(string id)
boolean ImGuiBeginPopupContextVoid(string id, integer mouse_button)

ImGui helper to open and begin popup when clicked in void (where there are no ImGui windows)

ImGuiBeginPopupContextWindow Function

boolean ImGuiBeginPopupContextWindow()
boolean ImGuiBeginPopupContextWindow(string id)
boolean ImGuiBeginPopupContextWindow(string id, ImGuiPopupFlags flags)

ImGui helper to open and begin popup when clicked on current window.

ImGuiBeginPopupModal Function

boolean ImGuiBeginPopupModal(string name)
boolean ImGuiBeginPopupModal(string name, boolean open)
boolean ImGuiBeginPopupModal(string name, boolean open, ImGuiWindowFlags flags)

Begin an ImGui modal dialog.

ImGuiBeginTooltip Function

nil ImGuiBeginTooltip()

Used to create full-featured tooltip windows that aren't just text.

ImGuiBullet Function

nil ImGuiBullet()

Draw a small circle and keep the cursor on the same line. Advances by the same distance as an empty ImGuiTreeNode call.

ImGuiBulletText Function

nil ImGuiBulletText(string label)

Draw a bullet followed by a static text.

ImGuiButton Function

boolean ImGuiButton(string label)
boolean ImGuiButton(string label, Vec2 size)

Button widget returning True if the button was pressed.

ImGuiCalcItemWidth Function

number ImGuiCalcItemWidth()

Returns the width of item given pushed settings and current cursor position.

Note: This is not necessarily the width of last item.

ImGuiCalcTextSize Function

Vec2 ImGuiCalcTextSize(string text)
Vec2 ImGuiCalcTextSize(string text, boolean hide_text_after_double_dash)
Vec2 ImGuiCalcTextSize(string text, boolean hide_text_after_double_dash, number wrap_width)

Compute the bounding rectangle for the provided text.

ImGuiCaptureKeyboardFromApp Function

nil ImGuiCaptureKeyboardFromApp(boolean capture)

Force capture keyboard when your widget is being hovered.

ImGuiCaptureMouseFromApp Function

nil ImGuiCaptureMouseFromApp(boolean capture)

Force capture mouse when your widget is being hovered.

ImGuiCheckbox Function

boolean, boolean ImGuiCheckbox(string label, boolean value)

Display a checkbox widget. Returns an interaction flag (user interacted with the widget) and the current widget state (checked or not after user interaction).

was_clicked, my_value = gs.ImGuiCheckBox('My value', my_value)

ImGuiClearInputBuffer Function

nil ImGuiClearInputBuffer()

Force a reset of the ImGui input buffer.

ImGuiCloseCurrentPopup Function

nil ImGuiCloseCurrentPopup()

Close the popup we have begin-ed into. Clicking on a menu item or selectable automatically closes the current popup.

ImGuiCollapsingHeader Function

boolean ImGuiCollapsingHeader(string label)
boolean ImGuiCollapsingHeader(string label, ImGuiTreeNodeFlags flags)
boolean, boolean ImGuiCollapsingHeader(string label, boolean p_open)
boolean, boolean ImGuiCollapsingHeader(string label, boolean p_open, ImGuiTreeNodeFlags flags)

Draw a collapsing header, returns False if the header is collapsed so that you may skip drawing the header content.

ImGuiColorButton Function

boolean ImGuiColorButton(string id, Color color)
boolean ImGuiColorButton(string id, Color color, ImGuiColorEditFlags flags)
boolean ImGuiColorButton(string id, Color color, ImGuiColorEditFlags flags, Vec2 size)

Color button widget, display a small colored rectangle.

ImGuiColorEdit Function

boolean, Color ImGuiColorEdit(string label, Color color)
boolean, Color ImGuiColorEdit(string label, Color color, ImGuiColorEditFlags flags)

Color editor, returns the widget current color.

ImGuiColumns Function

nil ImGuiColumns()
nil ImGuiColumns(integer count)
nil ImGuiColumns(integer count, string id)
nil ImGuiColumns(integer count, string id, boolean with_border)

Begin a column layout section.

To move to the next column use ImGuiNextColumn. To end a column layout section pass 1 to this function.

Note: Current implementation supports a maximum of 64 columns.

ImGuiCombo Function

boolean, integer ImGuiCombo(string label, integer current_item, StringList items)
boolean, integer ImGuiCombo(string label, integer current_item, StringList items, integer height_in_items)

Combo box widget, return the current selection index. Combo items are passed as an array of string.

ImGuiDragFloat Function

boolean, number ImGuiDragFloat(string label, number v)
boolean, number ImGuiDragFloat(string label, number v, number v_speed)
boolean, number ImGuiDragFloat(string label, number v, number v_speed, number v_min, number v_max)

Declare a widget to edit a float value. The widget can be dragged over to modify the underlying value.

ImGuiDragIntVec2 Function

boolean, iVec2 ImGuiDragIntVec2(string label, iVec2 v)
boolean, iVec2 ImGuiDragIntVec2(string label, iVec2 v, number v_speed)
boolean, iVec2 ImGuiDragIntVec2(string label, iVec2 v, number v_speed, integer v_min, integer v_max)

Declare a widget to edit an iVec2 value. The widget can be dragged over to modify the underlying value.

ImGuiDragVec2 Function

boolean, Vec2 ImGuiDragVec2(string label, Vec2 v)
boolean, Vec2 ImGuiDragVec2(string label, Vec2 v, number v_speed)
boolean, Vec2 ImGuiDragVec2(string label, Vec2 v, number v_speed, number v_min, number v_max)

Declare a float edit widget that can be dragged over to modify its value.

ImGuiDragVec3 Function

boolean, Vec3 ImGuiDragVec3(string label, Vec3 v)
boolean, Vec3 ImGuiDragVec3(string label, Vec3 v, number v_speed)
boolean, Vec3 ImGuiDragVec3(string label, Vec3 v, number v_speed, number v_min, number v_max)

Declare a widget to edit a Vec3 value. The widget can be dragged over to modify the underlying value.

ImGuiDragVec4 Function

boolean, Vec4 ImGuiDragVec4(string label, Vec4 v)
boolean, Vec4 ImGuiDragVec4(string label, Vec4 v, number v_speed)
boolean, Vec4 ImGuiDragVec4(string label, Vec4 v, number v_speed, number v_min, number v_max)

Declare a widget to edit a Vec4 value. The widget can be dragged over to modify the underlying value.

ImGuiDummy Function

nil ImGuiDummy(Vec2 size)

Add a dummy item of given size.

ImGuiEnd Function

nil ImGuiEnd()

End the current window.

ImGuiEndChild Function

nil ImGuiEndChild()

End a scrolling region.

ImGuiEndCombo Function

nil ImGuiEndCombo()

End a combo widget.

ImGuiEndFrame Function

nil ImGuiEndFrame(DearImguiContext ctx)
nil ImGuiEndFrame(DearImguiContext ctx, integer view_id)
nil ImGuiEndFrame()
nil ImGuiEndFrame(integer view_id)

End the current ImGui frame.

All ImGui rendering is sent to the specified view. If no view is specified, view 255 is used.

See Drawing to Views.

ImGuiEndGroup Function

nil ImGuiEndGroup()

End the current group.

ImGuiEndMainMenuBar Function

nil ImGuiEndMainMenuBar()

End the main menu bar.

See ImGuiBeginMainMenuBar.

ImGuiEndMenu Function

nil ImGuiEndMenu()

End the current sub-menu entry.

ImGuiEndMenuBar Function

nil ImGuiEndMenuBar()

End the current menu bar.

ImGuiEndPopup Function

nil ImGuiEndPopup()

End the current popup.

ImGuiEndTooltip Function

nil ImGuiEndTooltip()

End the current tooltip window.

See ImGuiBeginTooltip.

ImGuiGetColorU32 Function

integer ImGuiGetColorU32(ImGuiCol idx)
integer ImGuiGetColorU32(ImGuiCol idx, number alpha_multiplier)
integer ImGuiGetColorU32(Color color)

Return a style color component as a 32 bit unsigned integer.

See ImGuiPushStyleColor.

ImGuiGetColumnIndex Function

integer ImGuiGetColumnIndex()

Returns the index of the current column.

ImGuiGetColumnOffset Function

number ImGuiGetColumnOffset()
number ImGuiGetColumnOffset(integer column_index)

Returns the current column offset in pixels, from the left side of the content region.

ImGuiGetColumnsCount Function

integer ImGuiGetColumnsCount()

Return the number of columns in the current layout section.

See ImGuiColumns.

ImGuiGetColumnWidth Function

number ImGuiGetColumnWidth()
number ImGuiGetColumnWidth(integer column_index)

Returns the current column width in pixels.

ImGuiGetContentRegionAvail Function

Vec2 ImGuiGetContentRegionAvail()

Get available space for content in the current layout.

ImGuiGetContentRegionAvailWidth Function

number ImGuiGetContentRegionAvailWidth()

Helper function to return the available width of current content region.

See ImGuiGetContentRegionAvail.

ImGuiGetContentRegionMax Function

Vec2 ImGuiGetContentRegionMax()

Return the available content space including window decorations and scrollbar.

ImGuiGetCursorPos Function

Vec2 ImGuiGetCursorPos()

Return the layout cursor position in window space. Next widget declaration will take place at the cursor position.

See ImGuiSetCursorPos and ImGuiSameLine.

ImGuiGetCursorPosX Function

number ImGuiGetCursorPosX()

Helper for ImGuiGetCursorPos.

ImGuiGetCursorPosY Function

number ImGuiGetCursorPosY()

Helper for ImGuiGetCursorPos.

ImGuiGetCursorScreenPos Function

Vec2 ImGuiGetCursorScreenPos()

Return the current layout cursor position in screen space.

ImGuiGetCursorStartPos Function

Vec2 ImGuiGetCursorStartPos()

Return the current layout "line" starting position.

See ImGuiSameLine.

ImGuiGetFont Function

ImFont ImGuiGetFont()

Return the current ImGui font.

ImGuiGetFontSize Function

number ImGuiGetFontSize()

Return the font size (height in pixels) of the current ImGui font with the current scale applied.

ImGuiGetFontTexUvWhitePixel Function

Vec2 ImGuiGetFontTexUvWhitePixel()

Get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API.

ImGuiGetFrameCount Function

integer ImGuiGetFrameCount()

Return the ImGui frame counter.

See ImGuiBeginFrame and ImGuiEndFrame.

ImGuiGetFrameHeightWithSpacing Function

number ImGuiGetFrameHeightWithSpacing()

Return the following value: FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets)

ImGuiGetID Function

integer ImGuiGetID(string id)

Return a unique ImGui ID.

ImGuiGetItemRectMax Function

Vec2 ImGuiGetItemRectMax()

Get bounding rect maximum of last item in screen space.

ImGuiGetItemRectMin Function

Vec2 ImGuiGetItemRectMin()

Get bounding rect minimum of last item in screen space.

ImGuiGetItemRectSize Function

Vec2 ImGuiGetItemRectSize()

Get bounding rect size of last item in screen space.

ImGuiGetMouseDragDelta Function

Vec2 ImGuiGetMouseDragDelta()
Vec2 ImGuiGetMouseDragDelta(ImGuiMouseButton button)
Vec2 ImGuiGetMouseDragDelta(ImGuiMouseButton button, number lock_threshold)

Return the distance covered by the mouse cursor since the last button press.

ImGuiGetMousePos Function

Vec2 ImGuiGetMousePos()

Return the mouse cursor coordinates in screen space.

ImGuiGetMousePosOnOpeningCurrentPopup Function

Vec2 ImGuiGetMousePosOnOpeningCurrentPopup()

Retrieve a backup of the mouse position at the time of opening the current popup.

See ImGuiBeginPopup.

ImGuiGetScrollMaxX Function

number ImGuiGetScrollMaxX()

Get maximum scrolling amount on the horizontal axis.

ImGuiGetScrollMaxY Function

number ImGuiGetScrollMaxY()

Get maximum scrolling amount on the vertical axis.

ImGuiGetScrollX Function

number ImGuiGetScrollX()

Get scrolling amount on the horizontal axis.

ImGuiGetScrollY Function

number ImGuiGetScrollY()

Get scrolling amount on the vertical axis.

ImGuiGetTextLineHeight Function

number ImGuiGetTextLineHeight()

Return the height of a text line using the current font.

See ImGuiPushFont.

ImGuiGetTextLineHeightWithSpacing Function

number ImGuiGetTextLineHeightWithSpacing()

Return the height of a text line using the current font plus vertical spacing between two layout lines.

See ImGuiGetTextLineHeight.

ImGuiGetTime Function

number ImGuiGetTime()

Return the current ImGui time in seconds.

ImGuiGetTreeNodeToLabelSpacing Function

number ImGuiGetTreeNodeToLabelSpacing()

Return the horizontal distance preceding label when using ImGuiTreeNode or ImGuiBullet.

The value g.FontSize + style.FramePadding.x * 2 is returned for a regular unframed TreeNode.

ImGuiGetWindowContentRegionMax Function

Vec2 ImGuiGetWindowContentRegionMax()

Return the content boundaries max (roughly (0,0)+Size-Scroll) where Size can be override with ImGuiSetNextWindowContentSize, in window space.

ImGuiGetWindowContentRegionMin Function

Vec2 ImGuiGetWindowContentRegionMin()

Content boundaries min (roughly (0,0)-Scroll), in window space.

ImGuiGetWindowContentRegionWidth Function

number ImGuiGetWindowContentRegionWidth()

Return the width of the content region.

ImGuiGetWindowDrawList Function

ImDrawList ImGuiGetWindowDrawList()

Get the draw list associated to the current window, to append your own drawing primitives.

ImGuiGetWindowHeight Function

number ImGuiGetWindowHeight()

Return the current window height.

ImGuiGetWindowPos Function

Vec2 ImGuiGetWindowPos()

Return the current window position in screen space.

See ImGuiSetWindowPos.

ImGuiGetWindowSize Function

Vec2 ImGuiGetWindowSize()

Return the current window size.

See ImGuiSetWindowSize.

ImGuiGetWindowWidth Function

number ImGuiGetWindowWidth()

Return the current window width.

ImGuiImage Function

nil ImGuiImage(Texture tex, Vec2 size)
nil ImGuiImage(Texture tex, Vec2 size, Vec2 uv0)
nil ImGuiImage(Texture tex, Vec2 size, Vec2 uv0, Vec2 uv1)
nil ImGuiImage(Texture tex, Vec2 size, Vec2 uv0, Vec2 uv1, Color tint_col)
nil ImGuiImage(Texture tex, Vec2 size, Vec2 uv0, Vec2 uv1, Color tint_col, Color border_col)

Display a texture as an image widget.

See ImGuiImageButton.

ImGuiImageButton Function

boolean ImGuiImageButton(Texture tex, Vec2 size)
boolean ImGuiImageButton(Texture tex, Vec2 size, Vec2 uv0)
boolean ImGuiImageButton(Texture tex, Vec2 size, Vec2 uv0, Vec2 uv1)
boolean ImGuiImageButton(Texture tex, Vec2 size, Vec2 uv0, Vec2 uv1, integer frame_padding)
boolean ImGuiImageButton(Texture tex, Vec2 size, Vec2 uv0, Vec2 uv1, integer frame_padding, Color bg_col)
boolean ImGuiImageButton(Texture tex, Vec2 size, Vec2 uv0, Vec2 uv1, integer frame_padding, Color bg_col, Color tint_col)

Declare an image button displaying the provided texture.

See ImGuiImage.

ImGuiIndent Function

nil ImGuiIndent()
nil ImGuiIndent(number width)

Move content position toward the right.

ImGuiInit Function

nil ImGuiInit(number font_size, ProgramHandle imgui_program, ProgramHandle imgui_image_program)

Initialize the global ImGui context. This function must be called once before any other ImGui function using the global context.

See ImGuiInitContext.

ImGuiInitContext Function

DearImguiContext ImGuiInitContext(number font_size, ProgramHandle imgui_program, ProgramHandle imgui_image_program)

Initialize an ImGui context. This function must be called once before any other ImGui function using the context.

See ImGuiInit.

ImGuiInputFloat Function

boolean, number ImGuiInputFloat(string label, number v)
boolean, number ImGuiInputFloat(string label, number v, number step, number step_fast)
boolean, number ImGuiInputFloat(string label, number v, number step, number step_fast, integer decimal_precision)
boolean, number ImGuiInputFloat(string label, number v, number step, number step_fast, integer decimal_precision, ImGuiInputTextFlags flags)

Float field widget.

ImGuiInputInt Function

boolean, integer ImGuiInputInt(string label, integer v)
boolean, integer ImGuiInputInt(string label, integer v, integer step, integer step_fast)
boolean, integer ImGuiInputInt(string label, integer v, integer step, integer step_fast, ImGuiInputTextFlags flags)

Integer field widget.

ImGuiInputIntVec2 Function

boolean, iVec2 ImGuiInputIntVec2(string label, iVec2 v)
boolean, iVec2 ImGuiInputIntVec2(string label, iVec2 v, ImGuiInputTextFlags flags)

ImGuiInputText Function

boolean, string ImGuiInputText(string label, string text, integer max_size)
boolean, string ImGuiInputText(string label, string text, integer max_size, ImGuiInputTextFlags flags)

Text input widget, returns the current widget buffer content.

ImGuiInputVec2 Function

boolean, Vec2 ImGuiInputVec2(string label, Vec2 v)
boolean, Vec2 ImGuiInputVec2(string label, Vec2 v, integer decimal_precision)
boolean, Vec2 ImGuiInputVec2(string label, Vec2 v, integer decimal_precision, ImGuiInputTextFlags flags)

Vec2 field widget.

ImGuiInputVec3 Function

boolean, Vec3 ImGuiInputVec3(string label, Vec3 v)
boolean, Vec3 ImGuiInputVec3(string label, Vec3 v, integer decimal_precision)
boolean, Vec3 ImGuiInputVec3(string label, Vec3 v, integer decimal_precision, ImGuiInputTextFlags flags)

Vec3 field widget.

ImGuiInputVec4 Function

boolean, Vec4 ImGuiInputVec4(string label, Vec4 v)
boolean, Vec4 ImGuiInputVec4(string label, Vec4 v, integer decimal_precision)
boolean, Vec4 ImGuiInputVec4(string label, Vec4 v, integer decimal_precision, ImGuiInputTextFlags flags)

Vec4 field widget.

ImGuiInvisibleButton Function

boolean ImGuiInvisibleButton(string text, Vec2 size)

Invisible button widget, return True if the button was pressed.

ImGuiIsAnyItemActive Function

boolean ImGuiIsAnyItemActive()

Return true if any item is active, false otherwise.

ImGuiIsAnyItemHovered Function

boolean ImGuiIsAnyItemHovered()

Return true if any item is hovered by the mouse cursor, false otherwise.

ImGuiIsItemActive Function

boolean ImGuiIsItemActive()

Was the last item active.

e.g. button being held, text field being edited - items that do not interact will always return false.

ImGuiIsItemClicked Function

boolean ImGuiIsItemClicked()
boolean ImGuiIsItemClicked(integer mouse_button)

Was the last item clicked.

ImGuiIsItemHovered Function

boolean ImGuiIsItemHovered()
boolean ImGuiIsItemHovered(ImGuiHoveredFlags flags)

Was the last item hovered by mouse.

ImGuiIsItemVisible Function

boolean ImGuiIsItemVisible()

Was the last item visible and not out of sight due to clipping/scrolling.

ImGuiIsKeyDown Function

boolean ImGuiIsKeyDown(integer key_index)

Was the specified key down during the last frame?

ImGuiIsKeyPressed Function

boolean ImGuiIsKeyPressed(integer key_index)
boolean ImGuiIsKeyPressed(integer key_index, boolean repeat)

Was the specified key pressed? A key press implies that the key was down and is currently released.

ImGuiIsKeyReleased Function

boolean ImGuiIsKeyReleased(integer key_index)

Was the specified key released during the last frame?

ImGuiIsMouseClicked Function

boolean ImGuiIsMouseClicked(integer button)
boolean ImGuiIsMouseClicked(integer button, boolean repeat)

Was the specified mouse button clicked during the last frame? A mouse click implies that the button pressed earlier and released during the last frame.

ImGuiIsMouseDoubleClicked Function

boolean ImGuiIsMouseDoubleClicked(integer button)

Was the specified mouse button double-clicked during the last frame? A double-click implies two rapid successive clicks of the same button with the mouse cursor staying in the same position.

ImGuiIsMouseDown Function

boolean ImGuiIsMouseDown(integer button)

Was the specified mouse button down during the last frame?

ImGuiIsMouseDragging Function

boolean ImGuiIsMouseDragging(ImGuiMouseButton button)
boolean ImGuiIsMouseDragging(ImGuiMouseButton button, number lock_threshold)

Is mouse dragging?

ImGuiIsMouseHoveringRect Function

boolean ImGuiIsMouseHoveringRect(Vec2 rect_min, Vec2 rect_max)
boolean ImGuiIsMouseHoveringRect(Vec2 rect_min, Vec2 rect_max, boolean clip)

Test whether the mouse cursor is hovering the specified rectangle.

ImGuiIsMouseReleased Function

boolean ImGuiIsMouseReleased(integer button)

Was the specified mouse button released during the last frame?

ImGuiIsRectVisible Function

boolean ImGuiIsRectVisible(Vec2 size)
boolean ImGuiIsRectVisible(Vec2 rect_min, Vec2 rect_max)

Test if a rectangle of the specified size starting from cursor position is visible/not clipped. Or test if a rectangle in screen space is visible/not clipped.

ImGuiIsWindowCollapsed Function

boolean ImGuiIsWindowCollapsed()

Is the current window collapsed.

ImGuiIsWindowFocused Function

boolean ImGuiIsWindowFocused()
boolean ImGuiIsWindowFocused(ImGuiFocusedFlags flags)

Is the current window focused.

ImGuiIsWindowHovered Function

boolean ImGuiIsWindowHovered()
boolean ImGuiIsWindowHovered(ImGuiHoveredFlags flags)

Is the current window hovered and hoverable (not blocked by a popup), differentiates child windows from each others.

ImGuiLabelText Function

nil ImGuiLabelText(string label, string text)

Display text+label aligned the same way as value+label widgets.

ImGuiListBox Function

boolean, integer ImGuiListBox(string label, integer current_item, StringList items)
boolean, integer ImGuiListBox(string label, integer current_item, StringList items, integer height_in_items)

List widget.

ImGuiMenuItem Function

boolean ImGuiMenuItem(string label)
boolean ImGuiMenuItem(string label, string shortcut)
boolean ImGuiMenuItem(string label, string shortcut, boolean selected)
boolean ImGuiMenuItem(string label, string shortcut, boolean selected, boolean enabled)

Return true when activated. Shortcuts are displayed for convenience but not processed at the moment.

ImGuiMouseDrawCursor Function

nil ImGuiMouseDrawCursor(boolean draw_cursor)

Enable/disable the ImGui software mouse cursor.

ImGuiNewFrame Function

nil ImGuiNewFrame()

ImGuiNewLine Function

nil ImGuiNewLine()

Undo a ImGuiSameLine call or force a new line when in an horizontal layout.

ImGuiNextColumn Function

nil ImGuiNextColumn()

Start the next column in multi-column layout.

See ImGuiColumns.

ImGuiOpenPopup Function

nil ImGuiOpenPopup(string id)

Mark a named popup as open.

Popup windows are closed when the user:

Popup identifiers are relative to the current ID stack so ImGuiOpenPopup and ImGuiBeginPopup need to be at the same level of the ID stack.

ImGuiPopAllowKeyboardFocus Function

nil ImGuiPopAllowKeyboardFocus()

Undo the last call to ImGuiPushAllowKeyboardFocus.

ImGuiPopButtonRepeat Function

nil ImGuiPopButtonRepeat()

Undo the last call to ImGuiPushButtonRepeat.

ImGuiPopClipRect Function

nil ImGuiPopClipRect()

Undo the last call to ImGuiPushClipRect.

ImGuiPopFont Function

nil ImGuiPopFont()

Undo the last call to ImGuiPushFont.

ImGuiPopID Function

nil ImGuiPopID()

Undo the last call to ImGuiPushID.

ImGuiPopItemWidth Function

nil ImGuiPopItemWidth()

Undo the last call to ImGuiPushItemWidth.

ImGuiPopStyleColor Function

nil ImGuiPopStyleColor()
nil ImGuiPopStyleColor(integer count)

Undo the last call to ImGuiPushStyleColor.

ImGuiPopStyleVar Function

nil ImGuiPopStyleVar()
nil ImGuiPopStyleVar(integer count)

Undo the last call to ImGuiPushStyleVar.

ImGuiPopTextWrapPos Function

nil ImGuiPopTextWrapPos()

Undo the last call to ImGuiPushTextWrapPos.

ImGuiProgressBar Function

nil ImGuiProgressBar(number fraction)
nil ImGuiProgressBar(number fraction, Vec2 size)
nil ImGuiProgressBar(number fraction, Vec2 size, string overlay)

Draw a progress bar, fraction must be between 0.0 and 1.0.

ImGuiPushAllowKeyboardFocus Function

nil ImGuiPushAllowKeyboardFocus(boolean v)

Allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets.

ImGuiPushButtonRepeat Function

nil ImGuiPushButtonRepeat(boolean repeat)

In repeat mode, ButtonXXX functions return repeated true in a typematic manner.

Note that you can call ImGuiIsItemActive after any Button to tell if the button is held in the current frame.

ImGuiPushClipRect Function

nil ImGuiPushClipRect(Vec2 clip_rect_min, Vec2 clip_rect_max, boolean intersect_with_current_clip_rect)

Push a new clip rectangle onto the clipping stack.

ImGuiPushFont Function

nil ImGuiPushFont(ImFont font)

Push a font on top of the font stack and make it current for subsequent text rendering operations.

ImGuiPushID Function

nil ImGuiPushID(string id)
nil ImGuiPushID(integer id)

Push a string into the ID stack.

ImGuiPushItemWidth Function

nil ImGuiPushItemWidth(number item_width)

Set the width of items for common large item+label widgets.

  • >0: width in pixels
  • <0: align x pixels to the right of window (so -1 always align width to the right side)
  • =0: default to ~2/3 of the window width

See ImGuiPopItemWidth.

ImGuiPushStyleColor Function

nil ImGuiPushStyleColor(ImGuiCol idx, Color color)

Push a value on the style stack for the specified style color.

See ImGuiPopStyleColor.

ImGuiPushStyleVar Function

nil ImGuiPushStyleVar(ImGuiStyleVar idx, number value)
nil ImGuiPushStyleVar(ImGuiStyleVar idx, Vec2 value)

Push a value on the style stack for the specified style variable.

See ImGuiPopStyleVar.

ImGuiPushTextWrapPos Function

nil ImGuiPushTextWrapPos()
nil ImGuiPushTextWrapPos(number wrap_pos_x)

Push word-wrapping position for text commands.

  • <0: No wrapping.
  • =0: Wrap to the end of the window or column.
  • >0: Wrap at wrap_pos_x position in window local space.

See ImGuiPopTextWrapPos.

ImGuiRadioButton Function

boolean ImGuiRadioButton(string label, boolean active)
boolean, integer ImGuiRadioButton(string label, integer v, integer v_button)

Radio button widget, return the button state.

ImGuiRender Function

nil ImGuiRender()

ImGuiResetMouseDragDelta Function

nil ImGuiResetMouseDragDelta()
nil ImGuiResetMouseDragDelta(ImGuiMouseButton button)

ImGuiSameLine Function

nil ImGuiSameLine()
nil ImGuiSameLine(number pos_x)
nil ImGuiSameLine(number pos_x, number spacing_w)

Call between widgets or groups to layout them horizontally.

ImGuiSelectable Function

boolean ImGuiSelectable(string label)
boolean ImGuiSelectable(string label, boolean selected)
boolean ImGuiSelectable(string label, boolean selected, ImGuiSelectableFlags flags)
boolean ImGuiSelectable(string label, boolean selected, ImGuiSelectableFlags flags, Vec2 size)

Selectable item.

The following width values are possible:

  • = 0.0: Use remaining width.
  • > 0.0: Specific width.

The following height values are possible:

  • = 0.0: Use label height.
  • > 0.0: Specific height.

ImGuiSeparator Function

nil ImGuiSeparator()

Output an horizontal line to separate two distinct UI sections.

ImGuiSetColumnOffset Function

nil ImGuiSetColumnOffset(integer column_index, number offset_x)

Set the position of a column line in pixels, from the left side of the contents region.

ImGuiSetColumnWidth Function

nil ImGuiSetColumnWidth(integer column_index, number width)

Set the column width in pixels.

ImGuiSetCursorPos Function

nil ImGuiSetCursorPos(Vec2 local_pos)

Set the current widget output cursor position in window space.

ImGuiSetCursorPosX Function

nil ImGuiSetCursorPosX(number x)

ImGuiSetCursorPosY Function

nil ImGuiSetCursorPosY(number y)

ImGuiSetCursorScreenPos Function

nil ImGuiSetCursorScreenPos(Vec2 pos)

Set the widget cursor output position in screen space.

ImGuiSetItemAllowOverlap Function

nil ImGuiSetItemAllowOverlap()

Allow the last item to be overlapped by a subsequent item. Sometimes useful with invisible buttons, selectables, etc... to catch unused areas.

ImGuiSetItemDefaultFocus Function

nil ImGuiSetItemDefaultFocus()

Make the last item the default focused item of a window.

ImGuiSetKeyboardFocusHere Function

nil ImGuiSetKeyboardFocusHere()
nil ImGuiSetKeyboardFocusHere(integer offset)

Focus keyboard on the next widget.

Use positive offset value to access sub components of a multiple component widget. Use -1 to access the previous widget.

ImGuiSetNextItemOpen Function

nil ImGuiSetNextItemOpen(boolean is_open)
nil ImGuiSetNextItemOpen(boolean is_open, ImGuiCond condition)

Set next item open state.

ImGuiSetNextWindowCollapsed Function

nil ImGuiSetNextWindowCollapsed(boolean collapsed, ImGuiCond condition)

Set next window collapsed state, call before ImGuiBegin.

ImGuiSetNextWindowContentSize Function

nil ImGuiSetNextWindowContentSize(Vec2 size)

Set the size of the content area of the next declared window. Call before ImGuiBegin.

ImGuiSetNextWindowContentWidth Function

nil ImGuiSetNextWindowContentWidth(number width)

ImGuiSetNextWindowFocus Function

nil ImGuiSetNextWindowFocus()

Set the next window to be focused/top-most. Call before ImGuiBegin.

ImGuiSetNextWindowPos Function

nil ImGuiSetNextWindowPos(Vec2 pos)
nil ImGuiSetNextWindowPos(Vec2 pos, ImGuiCond condition)

Set next window position, call before ImGuiBegin.

ImGuiSetNextWindowPosCenter Function

nil ImGuiSetNextWindowPosCenter()
nil ImGuiSetNextWindowPosCenter(ImGuiCond condition)

Set next window position to be centered on screen, call before ImGuiBegin.

ImGuiSetNextWindowSize Function

nil ImGuiSetNextWindowSize(Vec2 size)
nil ImGuiSetNextWindowSize(Vec2 size, ImGuiCond condition)

Set next window size, call before ImGuiBegin. A value of 0 for an axis will auto-fit it.

ImGuiSetNextWindowSizeConstraints Function

nil ImGuiSetNextWindowSizeConstraints(Vec2 size_min, Vec2 size_max)

Set the next window size limits.

Use -1,-1 on either X/Y axis to preserve the current size. Sizes will be rounded down.

ImGuiSetScrollFromPosY Function

nil ImGuiSetScrollFromPosY(number pos_y)
nil ImGuiSetScrollFromPosY(number pos_y, number center_y_ratio)

Adjust scrolling amount to make a given position visible. Generally ImGuiGetCursorStartPos + offset to compute a valid position.

ImGuiSetScrollHereY Function

nil ImGuiSetScrollHereY()
nil ImGuiSetScrollHereY(number center_y_ratio)

Adjust scrolling amount to make current cursor position visible.

  • 0: Top.
  • 0.5: Center.
  • 1: Bottom.

When using to make a default/current item visible, consider using ImGuiSetItemDefaultFocus instead.

ImGuiSetScrollX Function

nil ImGuiSetScrollX(number scroll_x)

Set scrolling amount between [0;ImGuiGetScrollMaxX].

ImGuiSetScrollY Function

nil ImGuiSetScrollY(number scroll_y)

Set scrolling amount between [0;ImGuiGetScrollMaxY].

ImGuiSetTooltip Function

nil ImGuiSetTooltip(string text)

Set tooltip under mouse-cursor, typically used with ImGuiIsItemHovered/ImGuiIsAnyItemHovered. Last call wins.

ImGuiSetWindowCollapsed Function

nil ImGuiSetWindowCollapsed(string name, boolean collapsed)
nil ImGuiSetWindowCollapsed(string name, boolean collapsed, ImGuiCond condition)

Set named window collapsed state, prefer using ImGuiSetNextWindowCollapsed.

ImGuiSetWindowFocus Function

nil ImGuiSetWindowFocus(string name)

Set named window to be focused/top-most.

ImGuiSetWindowFontScale Function

nil ImGuiSetWindowFontScale(number scale)

Per-window font scale.

ImGuiSetWindowPos Function

nil ImGuiSetWindowPos(string name, Vec2 pos)
nil ImGuiSetWindowPos(string name, Vec2 pos, ImGuiCond condition)

Set named window position.

ImGuiSetWindowSize Function

nil ImGuiSetWindowSize(string name, Vec2 size)
nil ImGuiSetWindowSize(string name, Vec2 size, ImGuiCond condition)

Set named window size.

ImGuiShutdown Function

nil ImGuiShutdown()

Shutdown the global ImGui context.

ImGuiSliderFloat Function

boolean, number ImGuiSliderFloat(string label, number v, number v_min, number v_max)
boolean, number ImGuiSliderFloat(string label, number v, number v_min, number v_max, string format)

Float slider widget.

ImGuiSliderInt Function

boolean, integer ImGuiSliderInt(string label, integer v, integer v_min, integer v_max)
boolean, integer ImGuiSliderInt(string label, integer v, integer v_min, integer v_max, string format)

Integer slider widget.

ImGuiSliderIntVec2 Function

boolean, iVec2 ImGuiSliderIntVec2(string label, iVec2 v, integer v_min, integer v_max)
boolean, iVec2 ImGuiSliderIntVec2(string label, iVec2 v, integer v_min, integer v_max, string format)

ImGuiSliderVec2 Function

boolean, Vec2 ImGuiSliderVec2(string label, Vec2 v, number v_min, number v_max)
boolean, Vec2 ImGuiSliderVec2(string label, Vec2 v, number v_min, number v_max, string format)

Vec2 slider widget.

ImGuiSliderVec3 Function

boolean, Vec3 ImGuiSliderVec3(string label, Vec3 v, number v_min, number v_max)
boolean, Vec3 ImGuiSliderVec3(string label, Vec3 v, number v_min, number v_max, string format)

Vec3 slider widget.

ImGuiSliderVec4 Function

boolean, Vec4 ImGuiSliderVec4(string label, Vec4 v, number v_min, number v_max)
boolean, Vec4 ImGuiSliderVec4(string label, Vec4 v, number v_min, number v_max, string format)

Vec4 slider widget.

ImGuiSmallButton Function

boolean ImGuiSmallButton(string label)

Small button widget fitting the height of a text line, return True if the button was pressed.

ImGuiSpacing Function

nil ImGuiSpacing()

Add spacing.

ImGuiText Function

nil ImGuiText(string text)

Static text.

ImGuiTextColored Function

nil ImGuiTextColored(Color color, string text)

Colored static text.

ImGuiTextDisabled Function

nil ImGuiTextDisabled(string text)

Disabled static text.

ImGuiTextUnformatted Function

nil ImGuiTextUnformatted(string text)

Raw text without formatting. Roughly equivalent to ImGuiText but faster, recommended for long chunks of text.

ImGuiTextWrapped Function

nil ImGuiTextWrapped(string text)

Wrapped static text.

Note that this won't work on an auto-resizing window if there's no other widgets to extend the window width, you may need to set a size using ImGuiSetNextWindowSize.

ImGuiTreeNode Function

boolean ImGuiTreeNode(string label)

If returning true the node is open and the user is responsible for calling ImGuiTreePop.

ImGuiTreeNodeEx Function

boolean ImGuiTreeNodeEx(string label, ImGuiTreeNodeFlags flags)

ImGuiTreePop Function

nil ImGuiTreePop()

Pop the current tree node.

ImGuiTreePush Function

nil ImGuiTreePush(string id)

Already called by ImGuiTreeNode, but you can call ImGuiTreePush/ImGuiTreePop yourself for layouting purpose.

ImGuiUnindent Function

nil ImGuiUnindent()
nil ImGuiUnindent(number width)

Move content position back to the left (cancel ImGuiIndent).

ImGuiWantCaptureMouse Function

boolean ImGuiWantCaptureMouse()

ImGui wants mouse capture. Use this function to determine when to pause mouse processing from other parts of your program.

Inch Function

number Inch(number inch)

Convert a value in inches to the Harfang internal unit system.

See Coordinates and Units System.

InputInit Function

nil InputInit()

Initialize the Input system. Must be invoked before any call to WindowSystemInit to work properly.

hg.InputInit()
hg.WindowSystemInit()

InputShutdown Function

nil InputShutdown()

Shutdown the Input system.

Inside Function

boolean Inside(Rect rect, iVec2 v)
boolean Inside(Rect rect, Vec2 v)
boolean Inside(Rect rect, Vec3 v)
boolean Inside(Rect rect, Vec4 v)
boolean Inside(IntRect rect, iVec2 v)
boolean Inside(IntRect rect, Vec2 v)
boolean Inside(IntRect rect, Vec3 v)
boolean Inside(IntRect rect, Vec4 v)

Test if a value is inside a containing volume.

int_to_VoidPointer Function

VoidPointer int_to_VoidPointer(integer ptr)

Cast an integer to a void pointer.

This function is only used to provide access to low-level structures and should not be needed most of the time.

Intersection Function

Rect Intersection(Rect a, Rect b)
IntRect Intersection(IntRect a, IntRect b)

Return the intersection of two rectangles.

IntersectRay Function

boolean, number, number IntersectRay(MinMax minmax, Vec3 origin, Vec3 direction)

Intersect an infinite ray with an axis-aligned bounding box, if the first returned value is true it is followed by the near and far intersection points.

Intersects Function

boolean Intersects(Rect a, Rect b)
boolean Intersects(IntRect a, IntRect b)

Return true if rect a intersects rect b.

Inverse Function

boolean, Mat3 Inverse(Mat3 m)
boolean, Mat4 Inverse(Mat4 m)
Mat44, boolean Inverse(Mat44 m)
Vec3 Inverse(Vec3 v)

Return the inverse of a matrix, vector or quaternion.

InverseFast Function

Mat4 InverseFast(Mat4 m)

Compute the inverse of an orthonormal transformation matrix. This function is faster than the generic Inverse function but can only deal with a specific set of matrices.

See Inverse.

IsAssetFile Function

boolean IsAssetFile(string name)

Test if an asset file exists in the assets system.

See Resources & Assets.

IsDir Function

boolean IsDir(string path)

Returns true if path is a directory on the local filesystem, false otherwise.

IsEOF Function

boolean IsEOF(File file)

Returns true if the cursor is at the end of the file, false otherwise.

IsFile Function

boolean IsFile(string path)

Test if a file exists on the local filesystem.

IsFinite Function

boolean IsFinite(number v)

Test if a floating point value is finite.

IsHandJointActive Function

boolean IsHandJointActive(HandsSide hand)

IsMonitorConnected Function

boolean IsMonitorConnected(Monitor monitor)

Test if the specified monitor is connected to the host device.

IsoSurfaceSphere Function

nil IsoSurfaceSphere(IsoSurface surface, integer width, integer height, integer depth, number x, number y, number z, number radius)
nil IsoSurfaceSphere(IsoSurface surface, integer width, integer height, integer depth, number x, number y, number z, number radius, number value)
nil IsoSurfaceSphere(IsoSurface surface, integer width, integer height, integer depth, number x, number y, number z, number radius, number value, number exponent)

Output a sphere to an iso-surface.

IsoSurfaceToModel Function

boolean IsoSurfaceToModel(ModelBuilder builder, IsoSurface surface, integer width, integer height, integer depth)
boolean IsoSurfaceToModel(ModelBuilder builder, IsoSurface surface, integer width, integer height, integer depth, integer material)
boolean IsoSurfaceToModel(ModelBuilder builder, IsoSurface surface, integer width, integer height, integer depth, integer material, number isolevel)
boolean IsoSurfaceToModel(ModelBuilder builder, IsoSurface surface, integer width, integer height, integer depth, integer material, number isolevel, number scale_x, number scale_y, number scale_z)

Convert an iso-surface to a render model, this function is geared toward efficiency and meant for realtime.

IsPathAbsolute Function

boolean IsPathAbsolute(string path)

Test if the provided path is an absolute or relative path.

IsPrimaryMonitor Function

boolean IsPrimaryMonitor(Monitor monitor)

Return true if the monitor is the primary host device monitor, false otherwise.

IsValid Function

boolean IsValid(File file)
boolean IsValid(Texture t)
boolean IsValid(FrameBuffer fb)
boolean IsValid(ForwardPipelineAAA pipeline)
boolean IsValid(IAudioStreamer streamer)
boolean IsValid(IVideoStreamer streamer)

Test if a resource if valid.

IsWindowOpen Function

boolean IsWindowOpen(Window window)

Return true if the window is open, false otherwise.

Km Function

number Km(number km)

Convert a value in kilometers to the Harfang internal unit system.

See Coordinates and Units System.

Len Function

number Len(Vec2 v)
integer Len(iVec2 v)
number Len(Quaternion q)
number Len(Vec3 v)

Return the length of the vector.

Len2 Function

number Len2(Vec2 v)
integer Len2(iVec2 v)
number Len2(Quaternion q)
number Len2(Vec3 v)

Return the length of the vector squared.

Lerp Function

integer Lerp(integer a, integer b, number t)
number Lerp(number a, number b, number t)
Vec3 Lerp(Vec3 a, Vec3 b, number t)
Vec4 Lerp(Vec4 a, Vec4 b, number t)

LerpAsOrthonormalBase Function

Mat4 LerpAsOrthonormalBase(Mat4 from, Mat4 to, number k)
Mat4 LerpAsOrthonormalBase(Mat4 from, Mat4 to, number k, boolean fast)

Linear interpolate between two transformation matrices on the [0;1] interval.

LinearInterpolate Function

number LinearInterpolate(number y0, number y1, number t)

Linear interpolate between two values on the [0;1] interval.

See CosineInterpolate, CubicInterpolate and HermiteInterpolate.

ListDir Function

DirEntryList ListDir(string path, DirEntryType type)

Get the content of a directory on the local filesystem, this function does not recurse into subfolders.

See ListDirRecursive.

ListDirRecursive Function

DirEntryList ListDirRecursive(string path, DirEntryType type)

Get the content of a directory on the local filesystem, this function recurses into subfolders.

See ListDir.

LoadBMP Function

boolean LoadBMP(Picture pict, string path)

Load a Picture in BMP file format.

LoadDataFromFile Function

boolean LoadDataFromFile(string path, Data data)

LoadFontFromAssets Function

Font LoadFontFromAssets(string name)
Font LoadFontFromAssets(string name, number size)
Font LoadFontFromAssets(string name, number size, integer resolution)
Font LoadFontFromAssets(string name, number size, integer resolution, integer padding)
Font LoadFontFromAssets(string name, number size, integer resolution, integer padding, string glyphs)

Load a TrueType (TTF) font from the assets system.

See Resources & Assets.

LoadFontFromFile Function

Font LoadFontFromFile(string path)
Font LoadFontFromFile(string path, number size)
Font LoadFontFromFile(string path, number size, integer resolution)
Font LoadFontFromFile(string path, number size, integer resolution, integer padding)
Font LoadFontFromFile(string path, number size, integer resolution, integer padding, string glyphs)

Load a TrueType (TTF) font from the local filesystem.

See Resources & Assets.

LoadForwardPipelineAAAConfigFromAssets Function

boolean LoadForwardPipelineAAAConfigFromAssets(string path, ForwardPipelineAAAConfig config)

LoadForwardPipelineAAAConfigFromFile Function

boolean LoadForwardPipelineAAAConfigFromFile(string path, ForwardPipelineAAAConfig config)

LoadGIF Function

boolean LoadGIF(Picture pict, string path)

Load a Picture in GIF file format.

LoadJPG Function

boolean LoadJPG(Picture pict, string path)

Load a Picture in JPEG file format.

LoadJsonFromAssets Function

JSON LoadJsonFromAssets(string name)

Load a JSON from the assets system.

See Resources & Assets.

LoadJsonFromFile Function

JSON LoadJsonFromFile(string path)

Load a JSON from the local filesystem.

LoadLPCMSound Function

SoundRef LoadLPCMSound(integer ptr, integer size, AudioFrameFormat format)

Load a sound from a decoded raw LPCM memory block and return a reference to it.

The input pointer is borrowed only for the duration of the call. The audio data is copied to the audio backend before the function returns.

LoadModelFromAssets Function

Model LoadModelFromAssets(string name)

Load a render model from the assets system.

See DrawModel and Resources & Assets.

LoadModelFromFile Function

Model LoadModelFromFile(string path)

Load a render model from the local filesystem.

LoadNavMeshFromAssets Function

NavMesh LoadNavMeshFromAssets(string name)

Load a navigation mesh from the assets system.

See Resources & Assets.

LoadNavMeshFromFile Function

NavMesh LoadNavMeshFromFile(string path)

Load a navigation mesh from the local filesystem.

LoadOGGSoundAsset Function

SoundRef LoadOGGSoundAsset(string name)

LoadOGGSoundFile Function

SoundRef LoadOGGSoundFile(string path)

LoadPicture Function

boolean LoadPicture(Picture pict, string path)

Load a Picture content from the filesystem.

LoadPipelineProgramFromAssets Function

PipelineProgram LoadPipelineProgramFromAssets(string name, PipelineResources resources, PipelineInfo pipeline)

Load a pipeline shader program from the assets system.

See Resources & Assets.

LoadPipelineProgramFromFile Function

PipelineProgram LoadPipelineProgramFromFile(string path, PipelineResources resources, PipelineInfo pipeline)

Load a pipeline shader program from the local filesystem.

LoadPipelineProgramRefFromAssets Function

PipelineProgramRef LoadPipelineProgramRefFromAssets(string name, PipelineResources resources, PipelineInfo pipeline)

LoadPipelineProgramRefFromFile Function

PipelineProgramRef LoadPipelineProgramRefFromFile(string path, PipelineResources resources, PipelineInfo pipeline)

LoadPNG Function

boolean LoadPNG(Picture pict, string path)

Load a Picture in PNG file format.

LoadProgramFromAssets Function

ProgramHandle LoadProgramFromAssets(string name)
ProgramHandle LoadProgramFromAssets(string vertex_shader_name, string fragment_shader_name)

Load a shader program from the assets system.

See Resources & Assets.

LoadProgramFromFile Function

ProgramHandle LoadProgramFromFile(string path)
ProgramHandle LoadProgramFromFile(string vertex_shader_path, string fragment_shader_path)

Load a shader program from the local filesystem.

LoadPSD Function

boolean LoadPSD(Picture pict, string path)

Load a Picture in PSD file format.

LoadSceneBinaryFromAssets Function

boolean LoadSceneBinaryFromAssets(string name, Scene scene, PipelineResources resources, PipelineInfo pipeline)
boolean LoadSceneBinaryFromAssets(string name, Scene scene, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)

Load a scene in binary format from the assets system. Loaded content is added to the existing scene content.

See Resources & Assets.

LoadSceneBinaryFromDataAndAssets Function

boolean LoadSceneBinaryFromDataAndAssets(Data data, string name, Scene scene, PipelineResources resources, PipelineInfo pipeline)
boolean LoadSceneBinaryFromDataAndAssets(Data data, string name, Scene scene, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)

LoadSceneBinaryFromDataAndFile Function

boolean LoadSceneBinaryFromDataAndFile(Data data, string name, Scene scene, PipelineResources resources, PipelineInfo pipeline)
boolean LoadSceneBinaryFromDataAndFile(Data data, string name, Scene scene, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)

LoadSceneBinaryFromFile Function

boolean LoadSceneBinaryFromFile(string path, Scene scene, PipelineResources resources, PipelineInfo pipeline)
boolean LoadSceneBinaryFromFile(string path, Scene scene, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)

Load a scene in binary format from the local filesystem. Loaded content is added to the existing scene content.

LoadSceneFromAssets Function

boolean LoadSceneFromAssets(string name, Scene scene, PipelineResources resources, PipelineInfo pipeline)
boolean LoadSceneFromAssets(string name, Scene scene, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)

LoadSceneFromFile Function

boolean LoadSceneFromFile(string path, Scene scene, PipelineResources resources, PipelineInfo pipeline)
boolean LoadSceneFromFile(string path, Scene scene, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)

LoadSceneJsonFromAssets Function

boolean LoadSceneJsonFromAssets(string name, Scene scene, PipelineResources resources, PipelineInfo pipeline)
boolean LoadSceneJsonFromAssets(string name, Scene scene, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)

Load a scene in JSON format from the assets system. Loaded content is added to the existing scene content.

See Resources & Assets.

LoadSceneJsonFromFile Function

boolean LoadSceneJsonFromFile(string path, Scene scene, PipelineResources resources, PipelineInfo pipeline)
boolean LoadSceneJsonFromFile(string path, Scene scene, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)

Load a scene in JSON format from the local filesystem. Loaded content is added to the existing scene content.

LoadTextureFlagsFromAssets Function

TextureFlags LoadTextureFlagsFromAssets(string name)

Load texture flags in the texture metafile from the assets system.

See Resources & Assets.

LoadTextureFlagsFromFile Function

TextureFlags LoadTextureFlagsFromFile(string path)

Load texture flags in the texture metafile from the local filesystem.

LoadTextureFromAssets Function

Texture, TextureInfo LoadTextureFromAssets(string path, TextureFlags flags)
TextureRef LoadTextureFromAssets(string path, integer flags, PipelineResources resources)

Load a texture from the assets system.

  • When not using pipeline resources the texture informations are returned directly.
  • When using pipeline resources the texture informations can be retrieved from the PipelineResources object.

See Resources & Assets.

LoadTextureFromFile Function

Texture, TextureInfo LoadTextureFromFile(string path, TextureFlags flags)
TextureRef LoadTextureFromFile(string path, integer flags, PipelineResources resources)

Load a texture from the local filesystem.

  • When not using pipeline resources the texture informations are returned directly.
  • When using pipeline resources the texture informations can be retrieved from the PipelineResources object.

LoadTGA Function

boolean LoadTGA(Picture pict, string path)

Load a Picture in TGA file format.

LoadWAVSoundAsset Function

SoundRef LoadWAVSoundAsset(string name)

Load a sound in WAV format from the assets system and return a reference to it.

See Resources & Assets.

LoadWAVSoundFile Function

SoundRef LoadWAVSoundFile(string path)

Load a sound in WAV format from the local filesystem and return a reference to it.

Log Function

nil Log(string msg)
nil Log(string msg, string details)

MakeAudioStreamer Function

IAudioStreamer MakeAudioStreamer(string module_path)

MakeForwardPipelineLinearLight Function

ForwardPipelineLight MakeForwardPipelineLinearLight(Mat4 world, Color diffuse, Color specular)
ForwardPipelineLight MakeForwardPipelineLinearLight(Mat4 world, Color diffuse, Color specular, Vec4 pssm_split)
ForwardPipelineLight MakeForwardPipelineLinearLight(Mat4 world, Color diffuse, Color specular, Vec4 pssm_split, number priority)
ForwardPipelineLight MakeForwardPipelineLinearLight(Mat4 world, Color diffuse, Color specular, Vec4 pssm_split, number priority, ForwardPipelineShadowType shadow_type)
ForwardPipelineLight MakeForwardPipelineLinearLight(Mat4 world, Color diffuse, Color specular, Vec4 pssm_split, number priority, ForwardPipelineShadowType shadow_type, number shadow_bias)

MakeForwardPipelinePointLight Function

ForwardPipelineLight MakeForwardPipelinePointLight(Mat4 world, Color diffuse, Color specular)
ForwardPipelineLight MakeForwardPipelinePointLight(Mat4 world, Color diffuse, Color specular, number radius)
ForwardPipelineLight MakeForwardPipelinePointLight(Mat4 world, Color diffuse, Color specular, number radius, number priority)
ForwardPipelineLight MakeForwardPipelinePointLight(Mat4 world, Color diffuse, Color specular, number radius, number priority, ForwardPipelineShadowType shadow_type)
ForwardPipelineLight MakeForwardPipelinePointLight(Mat4 world, Color diffuse, Color specular, number radius, number priority, ForwardPipelineShadowType shadow_type, number shadow_bias)

MakeForwardPipelineSpotLight Function

ForwardPipelineLight MakeForwardPipelineSpotLight(Mat4 world, Color diffuse, Color specular)
ForwardPipelineLight MakeForwardPipelineSpotLight(Mat4 world, Color diffuse, Color specular, number radius)
ForwardPipelineLight MakeForwardPipelineSpotLight(Mat4 world, Color diffuse, Color specular, number radius, number inner_angle)
ForwardPipelineLight MakeForwardPipelineSpotLight(Mat4 world, Color diffuse, Color specular, number radius, number inner_angle, number outer_angle)
ForwardPipelineLight MakeForwardPipelineSpotLight(Mat4 world, Color diffuse, Color specular, number radius, number inner_angle, number outer_angle, number priority)
ForwardPipelineLight MakeForwardPipelineSpotLight(Mat4 world, Color diffuse, Color specular, number radius, number inner_angle, number outer_angle, number priority, ForwardPipelineShadowType shadow_type)
ForwardPipelineLight MakeForwardPipelineSpotLight(Mat4 world, Color diffuse, Color specular, number radius, number inner_angle, number outer_angle, number priority, ForwardPipelineShadowType shadow_type, number shadow_bias)

MakeFrustum Function

Frustum MakeFrustum(Mat44 projection)
Frustum MakeFrustum(Mat44 projection, Mat4 mtx)

Create a projection frustum. This object can then be used to perform culling using TestVisibility.

# Compute a perspective matrix
proj = hg.ComputePerspectiveProjectionMatrix(0.1, 1000, hg.FovToZoomFactor(math.pi/4), 1280/720)
# Make a frustum from this projection matrix
frustum = hg.MakeFrustum(proj)

MakePlane Function

Vec4 MakePlane(Vec3 p, Vec3 n)
Vec4 MakePlane(Vec3 p, Vec3 n, Mat4 m)

Geometrical plane in 3D space.

  • p: a point lying on the plane.
  • n: the plane normal.
  • m: an affine transformation matrix that will be applied to p and n.

MakeRectFromWidthHeight Function

Rect MakeRectFromWidthHeight(number x, number y, number w, number h)
IntRect MakeRectFromWidthHeight(integer x, integer y, integer w, integer h)

Make a rectangle from width and height.

MakeUniformSetTexture Function

UniformSetTexture MakeUniformSetTexture(string name, Texture texture, integer stage)

Create a uniform set texture object.

This object can be added to a UniformSetTextureList to control the shader program uniform values for a subsequent call to DrawModel.

MakeUniformSetValue Function

UniformSetValue MakeUniformSetValue(string name, number v)
UniformSetValue MakeUniformSetValue(string name, Vec2 v)
UniformSetValue MakeUniformSetValue(string name, Vec3 v)
UniformSetValue MakeUniformSetValue(string name, Vec4 v)
UniformSetValue MakeUniformSetValue(string name, Mat3 v)
UniformSetValue MakeUniformSetValue(string name, Mat4 v)
UniformSetValue MakeUniformSetValue(string name, Mat44 v)

Create a uniform set value object.

This object can be added to a UniformSetValueList to control the shader program uniform values for a subsequent call to DrawModel.

MakeVec3 Function

Vec3 MakeVec3(Vec4 v)

Make a Vec3 from a Vec4. The input vector w component is discarded.

MakeVertex Function

Vertex MakeVertex(Vec3 pos)
Vertex MakeVertex(Vec3 pos, Vec3 nrm)
Vertex MakeVertex(Vec3 pos, Vec3 nrm, Vec2 uv0)
Vertex MakeVertex(Vec3 pos, Vec3 nrm, Vec2 uv0, Color color0)

MakeVideoStreamer Function

IVideoStreamer MakeVideoStreamer(string module_path)

Mat3LookAt Function

Mat3 Mat3LookAt(Vec3 front)
Mat3 Mat3LookAt(Vec3 front, Vec3 up)

Return a rotation matrix looking down the provided vector. The input vector does not need to be normalized.

Mat4LookAt Function

Mat4 Mat4LookAt(Vec3 position, Vec3 at)
Mat4 Mat4LookAt(Vec3 position, Vec3 at, Vec3 scale)

Return a look at matrix whose orientation points at the specified position.

Mat4LookAtUp Function

Mat4 Mat4LookAtUp(Vec3 position, Vec3 at, Vec3 up)
Mat4 Mat4LookAtUp(Vec3 position, Vec3 at, Vec3 up, Vec3 scale)

Return a look at matrix whose orientation points at the specified position and up direction.

Mat4LookToward Function

Mat4 Mat4LookToward(Vec3 position, Vec3 direction)
Mat4 Mat4LookToward(Vec3 position, Vec3 direction, Vec3 scale)

Return a look at matrix whose orientation points toward the specified direction.

Mat4LookTowardUp Function

Mat4 Mat4LookTowardUp(Vec3 position, Vec3 direction, Vec3 up)
Mat4 Mat4LookTowardUp(Vec3 position, Vec3 direction, Vec3 up, Vec3 scale)

Return a look at matrix whose orientation points toward the specified directions.

Max Function

Vec2 Max(Vec2 a, Vec2 b)
iVec2 Max(iVec2 a, iVec2 b)
Vec3 Max(Vec3 a, Vec3 b)
number Max(number a, number b)
integer Max(integer a, integer b)

Return a vector whose elements are the maximum of each of the two specified vectors.

Min Function

Vec2 Min(Vec2 a, Vec2 b)
iVec2 Min(iVec2 a, iVec2 b)
Vec3 Min(Vec3 a, Vec3 b)
number Min(number a, number b)
integer Min(integer a, integer b)

Return a vector whose elements are the minimum of each of the two specified vectors.

MinMaxFromPositionSize Function

MinMax MinMaxFromPositionSize(Vec3 position, Vec3 size)

Set min = p - size/2 and max = p + size/2.

MkDir Function

boolean MkDir(string path)
boolean MkDir(string path, integer permissions)

Create a new directory.

See MkTree.

MkTree Function

boolean MkTree(string path)
boolean MkTree(string path, integer permissions)

Create a directory tree on the local filesystem. This function is recursive and creates each missing directory in the path.

See MkDir.

Mm Function

number Mm(number mm)

Convert a value in millimeters to the Harfang internal unit system.

See Coordinates and Units System.

Ms Function

number Ms(number milliseconds)

Convert a value in milliseconds to the Harfang internal unit system.

See Coordinates and Units System.

Mtr Function

number Mtr(number m)

Convert a value in meters to the Harfang internal unit system.

See Coordinates and Units System.

NewFullscreenWindow Function

Window NewFullscreenWindow(Monitor monitor, integer mode_index)
Window NewFullscreenWindow(Monitor monitor, integer mode_index, MonitorRotation rotation)
Window NewFullscreenWindow(string title, Monitor monitor, integer mode_index)
Window NewFullscreenWindow(string title, Monitor monitor, integer mode_index, MonitorRotation rotation)

Create a new fullscreen window.

NewIsoSurface Function

IsoSurface NewIsoSurface(integer width, integer height, integer depth)

Return a new iso-surface object.

See IsoSurfaceSphere to draw to an iso-surface and IsoSurfaceToModel to draw it.

NewWindow Function

Window NewWindow(integer width, integer height)
Window NewWindow(integer width, integer height, integer bpp)
Window NewWindow(integer width, integer height, integer bpp, WindowVisibility visibility)
Window NewWindow(string title, integer width, integer height)
Window NewWindow(string title, integer width, integer height, integer bpp)
Window NewWindow(string title, integer width, integer height, integer bpp, WindowVisibility visibility)

Create a new window.

NewWindowFrom Function

Window NewWindowFrom(VoidPointer handle)

Wrap a native window handle in a Window object.

Normalize Function

Vec2 Normalize(Vec2 v)
iVec2 Normalize(iVec2 v)
Vec4 Normalize(Vec4 v)
Quaternion Normalize(Quaternion q)
Mat3 Normalize(Mat3 m)
Vec3 Normalize(Vec3 v)

Return the input vector scaled so that its length is one.

NormalizePath Function

string NormalizePath(string path)

Normalize a path according to the following conventions:

  • Replace all whitespaces by underscores.

Offset Function

Rect Offset(Rect rect, number x, number y)
IntRect Offset(IntRect rect, integer x, integer y)

Offset a rectangle by the specified amount of units.

Open Function

File Open(string path)

Open a file in binary mode.

See OpenText, OpenWrite, OpenWriteText

OpenFileDialog Function

boolean, string OpenFileDialog(string title, FileFilterList filters, string file)
boolean, string OpenFileDialog(string title, FileFilterList filters, string file, string initial_dir)

Open a native OpenFile dialog.

OpenFolderDialog Function

boolean, string OpenFolderDialog(string title, string folder_name)
boolean, string OpenFolderDialog(string title, string folder_name, string initial_dir)

Open a native OpenFolder dialog.

OpenTemp Function

File OpenTemp(string template_path)

Return a handle to a temporary file on the local filesystem.

OpenText Function

File OpenText(string path)

Open a file as text. Return a handle to the opened file.

See Open, OpenWrite, OpenWriteText

OpenVRCreateEyeFrameBuffer Function

OpenVREyeFrameBuffer OpenVRCreateEyeFrameBuffer()
OpenVREyeFrameBuffer OpenVRCreateEyeFrameBuffer(OpenVRAA aa)

Creates and returns an Virtual Reality eye framebuffer, with the desired level of anti-aliasing. This function must be invoked twice, for the left and right eyes.

OpenVRDestroyEyeFrameBuffer Function

nil OpenVRDestroyEyeFrameBuffer(OpenVREyeFrameBuffer eye_fb)

Destroy an eye framebuffer.

OpenVRGetColorTexture Function

Texture OpenVRGetColorTexture(OpenVREyeFrameBuffer eye)

Return the color texture attached to an eye framebuffer.

OpenVRGetDepthTexture Function

Texture OpenVRGetDepthTexture(OpenVREyeFrameBuffer eye)

Return the depth texture attached to an eye framebuffer.

OpenVRGetFrameBufferSize Function

iVec2 OpenVRGetFrameBufferSize()

OpenVRGetState Function

OpenVRState OpenVRGetState(Mat4 body, number znear, number zfar)

Returns the current OpenVR state including the body, head and eye transformations.

OpenVRInit Function

boolean OpenVRInit()

Initialize OpenVR. Start the device display, its controllers and trackers.

OpenVRIsHMDMounted Function

boolean OpenVRIsHMDMounted()

OpenVRPostPresentHandoff Function

nil OpenVRPostPresentHandoff()

Signal to the OpenVR compositor that it can immediatly start processing the current frame.

OpenVRShutdown Function

nil OpenVRShutdown()

Shutdown OpenVR.

OpenVRStateToViewState Function

ViewState, ViewState OpenVRStateToViewState(OpenVRState state)

Compute the left and right eye view states from an OpenVR state.

See OpenVRGetState.

OpenVRSubmitFrame Function

nil OpenVRSubmitFrame(OpenVREyeFrameBuffer left, OpenVREyeFrameBuffer right)

Submit the left and right eye textures to the OpenVR compositor.

See OpenVRCreateEyeFrameBuffer.

OpenWrite Function

File OpenWrite(string path)

Open a file as binary in write mode.

See Open, OpenText, OpenWriteText

OpenWriteText Function

File OpenWriteText(string path)

Open a file as text in write mode.

See Open, OpenText, OpenWrite

OpenXRCreateEyeFrameBuffer Function

OpenXREyeFrameBufferList OpenXRCreateEyeFrameBuffer()
OpenXREyeFrameBufferList OpenXRCreateEyeFrameBuffer(OpenXRAA aa)

OpenXRDestroyEyeFrameBuffer Function

nil OpenXRDestroyEyeFrameBuffer(OpenXREyeFrameBuffer eye_fb)

OpenXRFinishSubmitFrameBuffer Function

nil OpenXRFinishSubmitFrameBuffer(OpenXRFrameInfo frameInfo)

OpenXRGetColorTexture Function

Texture OpenXRGetColorTexture(OpenXREyeFrameBuffer eye)

OpenXRGetColorTextureFromId Function

Texture OpenXRGetColorTextureFromId(OpenXREyeFrameBufferList eyes, OpenXRFrameInfo frame_info, integer index)

OpenXRGetDepthTexture Function

Texture OpenXRGetDepthTexture(OpenXREyeFrameBuffer eye)

OpenXRGetDepthTextureFromId Function

Texture OpenXRGetDepthTextureFromId(OpenXREyeFrameBufferList eyes, OpenXRFrameInfo frame_info, integer index)

OpenXRGetEyeGaze Function

boolean, Mat4 OpenXRGetEyeGaze()

OpenXRGetHeadPose Function

boolean, Mat4 OpenXRGetHeadPose()

OpenXRGetInstanceInfo Function

string OpenXRGetInstanceInfo()

OpenXRInit Function

boolean OpenXRInit()
boolean OpenXRInit(integer ExtensionsFlagsEnable)

OpenXRShutdown Function

nil OpenXRShutdown()

OpenXRSubmitSceneToForwardPipeline Function

OpenXRFrameInfo, integer OpenXRSubmitSceneToForwardPipeline(Mat4 cam_offset, update_controllersCallback update_controllers, draw_sceneCallback draw_scene, integer view_id, number z_near, number z_far)

Orthonormalize Function

Mat3 Orthonormalize(Mat3 m)
Mat4 Orthonormalize(Mat4 m)

Return a matrix where the row vectors form an orthonormal basis. All vectors are normalized and perpendicular to each other.

Overlap Function

boolean Overlap(MinMax minmax_a, MinMax minmax_b)
boolean Overlap(MinMax minmax_a, MinMax minmax_b, Axis axis)

Return true if the provided volume overlaps with this volume, false otherwise. The test can optionally be restricted to a specific axis.

PathJoin Function

string PathJoin(StringList elements)

Return a file path from a set of string elements.

PathStartsWith Function

boolean PathStartsWith(string path, string with)

Test if the provided path starts with the provided prefix.

PathStripPrefix Function

string PathStripPrefix(string path, string prefix)

Return a copy of the input path stripped of the provided prefix.

PathStripSuffix Function

string PathStripSuffix(string path, string suffix)

Return a copy of the input path stripped of the provided suffix.

PathToDisplay Function

string PathToDisplay(string path)

Format a path for display.

PauseSource Function

nil PauseSource(SourceRef source)

Pause a playing audio source.

See PlayStereo and PlaySpatialized.

PlaySpatialized Function

SourceRef PlaySpatialized(SoundRef snd, SpatializedSourceState state)

Start playing a spatialized sound. Return a handle to the started source.

PlayStereo Function

SourceRef PlayStereo(SoundRef snd, StereoSourceState state)

Start playing a stereo sound. Return a handle to the started source.

PrepareForwardPipelineLights Function

ForwardPipelineLights PrepareForwardPipelineLights(ForwardPipelineLightList lights)

Prepare a list of forward pipeline lights into a structure ready for submitting to the forward pipeline.

Lights are sorted by priority/type and the most important lights are assigned to available lighting slot of the forward pipeline.

For the public scripting API, see SubmitSceneToForwardPipeline and Drawing a Scene.

PrepareSceneForwardPipelineCommonRenderData Function

integer, SceneForwardPipelinePassViewId PrepareSceneForwardPipelineCommonRenderData(integer view_id, Scene scene, SceneForwardPipelineRenderData render_data, ForwardPipeline pipeline, PipelineResources resources, SceneForwardPipelinePassViewId views)
integer, SceneForwardPipelinePassViewId PrepareSceneForwardPipelineCommonRenderData(integer view_id, Scene scene, SceneForwardPipelineRenderData render_data, ForwardPipeline pipeline, PipelineResources resources, SceneForwardPipelinePassViewId views, string debug_name)

Prepare the common render data to submit a scene to the forward pipeline.

Note: When rendering multiple views of the same scene, common data only needs to be prepared once.

See PrepareSceneForwardPipelineViewDependentRenderData.

PrepareSceneForwardPipelineViewDependentRenderData Function

integer, SceneForwardPipelinePassViewId PrepareSceneForwardPipelineViewDependentRenderData(integer view_id, ViewState view_state, Scene scene, SceneForwardPipelineRenderData render_data, ForwardPipeline pipeline, PipelineResources resources, SceneForwardPipelinePassViewId views)
integer, SceneForwardPipelinePassViewId PrepareSceneForwardPipelineViewDependentRenderData(integer view_id, ViewState view_state, Scene scene, SceneForwardPipelineRenderData render_data, ForwardPipeline pipeline, PipelineResources resources, SceneForwardPipelinePassViewId views, string debug_name)

Prepare the view dependent render data to submit a scene to the forward pipeline.

See PrepareSceneForwardPipelineCommonRenderData.

PrintProfilerFrame Function

nil PrintProfilerFrame(ProfilerFrame profiler_frame)

Print a profiler frame to the console. Print all sections in the frame, their duration and event count.

ProcessLoadQueues Function

integer ProcessLoadQueues(PipelineResources res)
integer ProcessLoadQueues(PipelineResources res, integer t_budget)

ProcessModelLoadQueue Function

integer ProcessModelLoadQueue(PipelineResources res)
integer ProcessModelLoadQueue(PipelineResources res, integer t_budget)

ProcessTextureLoadQueue Function

integer ProcessTextureLoadQueue(PipelineResources res)
integer ProcessTextureLoadQueue(PipelineResources res, integer t_budget)

Process the texture load queue. This function must be called to load textures queued while loading a scene or model with the LSSF_QueueTextureLoads flag.

See LoadSaveSceneFlags.

ProjectOrthoToClipSpace Function

boolean, Vec3 ProjectOrthoToClipSpace(Mat44 proj, Vec3 view)

ProjectOrthoToScreenSpace Function

boolean, Vec3 ProjectOrthoToScreenSpace(Mat44 proj, Vec3 view, Vec2 resolution)

ProjectToClipSpace Function

boolean, Vec3 ProjectToClipSpace(Mat44 proj, Vec3 view)

Project a world position to the clipping space.

ProjectToScreenSpace Function

boolean, Vec3 ProjectToScreenSpace(Mat44 proj, Vec3 view, Vec2 resolution)

Project a world position to screen coordinates.

ProjectZToClipSpace Function

number ProjectZToClipSpace(number z, Mat44 proj)

Project a depth value to clip space.

Quantize Function

number Quantize(number v, number q)

Return the provided value quantized to the specified step.

QuaternionFromAxisAngle Function

Quaternion QuaternionFromAxisAngle(number angle, Vec3 axis)

Return a quaternion rotation from a 3d axis and a rotation around that axis.

QuaternionFromEuler Function

Quaternion QuaternionFromEuler(number x, number y, number z)
Quaternion QuaternionFromEuler(number x, number y, number z, RotationOrder rotation_order)
Quaternion QuaternionFromEuler(Vec3 euler)
Quaternion QuaternionFromEuler(Vec3 euler, RotationOrder rotation_order)

Return a quaternion 3d rotation from its Euler vector representation.

QuaternionFromMatrix3 Function

Quaternion QuaternionFromMatrix3(Mat3 m)

Return a quaternion rotation from its Mat3 representation.

QuaternionLookAt Function

Quaternion QuaternionLookAt(Vec3 at)

Return a quaternion 3d rotation oriented toward the specified position when sitting on the world's origin {0, 0, 0}.

Rad Function

number Rad(number radians)

Convert an angle in radians to the engine unit system.

See Coordinates and Units System.

Rad3 Function

Vec3 Rad3(number x, number y, number z)

Convert a triplet of angles in radians to the engine unit system.

See Coordinates and Units System.

RadianToDegree Function

number RadianToDegree(number radians)

Convert an angle in radians to degrees.

Rand Function

integer Rand()
integer Rand(integer range)

Return a random integer value in the provided range, default range is [0;65535].

See FRand to generate a random floating point value.

RandomVec3 Function

Vec3 RandomVec3(number min, number max)
Vec3 RandomVec3(Vec3 min, Vec3 max)

Return a vector with each component randomized in the inclusive provided range.

RandomVec4 Function

Vec4 RandomVec4(number min, number max)
Vec4 RandomVec4(Vec4 min, Vec4 max)

Return a vector with each component randomized in the inclusive provided range.

ReadFloat Function

number ReadFloat(File file)

Read a binary 32 bit floating point value from a local file.

ReadGamepad Function

GamepadState ReadGamepad()
GamepadState ReadGamepad(string name)

Read the current state of a named gamepad. If no name is passed, default is implied.

See GetGamepadNames.

ReadJoystick Function

JoystickState ReadJoystick()
JoystickState ReadJoystick(string name)

ReadKeyboard Function

KeyboardState ReadKeyboard()
KeyboardState ReadKeyboard(string name)

Read the current state of a named keyboard. If no name is passed, default is implied.

See GetKeyboardNames.

ReadMouse Function

MouseState ReadMouse()
MouseState ReadMouse(string name)

Read the current state of a named mouse. If no name is passed, default is implied.

See GetMouseNames.

ReadString Function

string ReadString(File file)

Read a binary string from a local file.

Strings are stored as a uint32_t length field followed by the string content in UTF-8.

ReadUInt16 Function

integer ReadUInt16(File file)

Read a binary 16 bit unsigned integer value from a local file.

ReadUInt32 Function

integer ReadUInt32(File file)

Read a binary 32 bit unsigned integer value from a local file.

ReadUInt8 Function

integer ReadUInt8(File file)

Read a binary 8 bit unsigned integer value from a local file.

ReadVRController Function

VRControllerState ReadVRController()
VRControllerState ReadVRController(string name)

Read the current state of a named VR controller. If no name is passed, default is implied.

See GetVRControllerNames.

ReadVRGenericTracker Function

VRGenericTrackerState ReadVRGenericTracker()
VRGenericTrackerState ReadVRGenericTracker(string name)

Read the current state of a named VR generic tracked. If no name is passed, default is implied.

See GetVRGenericTrackerNames.

Reflect Function

Vec3 Reflect(Vec3 v, Vec3 n)

Return the input vector reflected around the specified normal.

Refract Function

Vec3 Refract(Vec3 v, Vec3 n)
Vec3 Refract(Vec3 v, Vec3 n, number k_in)
Vec3 Refract(Vec3 v, Vec3 n, number k_in, number k_out)

Return the input vector refracted around the provided surface normal.

  • k_in: IOR of the medium the vector is exiting.
  • k_out: IOR of the medium the vector is entering.

RemoveAssetsFolder Function

nil RemoveAssetsFolder(string path)

Remove a folder from the assets system.

See Resources & Assets.

RemoveAssetsPackage Function

nil RemoveAssetsPackage(string path)

Remove a package from the assets system.

See Resources & Assets.

RenderInit Function

boolean RenderInit(Window window)
boolean RenderInit(Window window, RendererType type)
Window RenderInit(integer width, integer height, ResetFlags reset_flags)
Window RenderInit(integer width, integer height, ResetFlags reset_flags, TextureFormat format)
Window RenderInit(integer width, integer height, ResetFlags reset_flags, TextureFormat format, DebugFlags debug_flags)
Window RenderInit(integer width, integer height, RendererType type)
Window RenderInit(integer width, integer height, RendererType type, ResetFlags reset_flags)
Window RenderInit(integer width, integer height, RendererType type, ResetFlags reset_flags, TextureFormat format)
Window RenderInit(integer width, integer height, RendererType type, ResetFlags reset_flags, TextureFormat format, DebugFlags debug_flags)
Window RenderInit(string window_title, integer width, integer height, ResetFlags reset_flags)
Window RenderInit(string window_title, integer width, integer height, ResetFlags reset_flags, TextureFormat format)
Window RenderInit(string window_title, integer width, integer height, ResetFlags reset_flags, TextureFormat format, DebugFlags debug_flags)
Window RenderInit(string window_title, integer width, integer height, RendererType type)
Window RenderInit(string window_title, integer width, integer height, RendererType type, ResetFlags reset_flags)
Window RenderInit(string window_title, integer width, integer height, RendererType type, ResetFlags reset_flags, TextureFormat format)
Window RenderInit(string window_title, integer width, integer height, RendererType type, ResetFlags reset_flags, TextureFormat format, DebugFlags debug_flags)

Initialize the render system.

To change the states of the render system afterward use RenderReset.

RenderReset Function

nil RenderReset(integer width, integer height)
nil RenderReset(integer width, integer height, ResetFlags flags)
nil RenderReset(integer width, integer height, ResetFlags flags, TextureFormat format)

Change the states of the render system at runtime.

RenderResetToWindow Function

boolean, integer, integer RenderResetToWindow(Window win, integer width, integer height)
boolean, integer, integer RenderResetToWindow(Window win, integer width, integer height, integer reset_flags)

Resize the renderer backbuffer to the provided window client area dimensions. Return true if a reset was needed and carried out.

RenderShutdown Function

nil RenderShutdown()

Shutdown the render system.

ResetClock Function

nil ResetClock()

Reset the elapsed time counter.

Reverse Function

Vec2 Reverse(Vec2 a)
iVec2 Reverse(iVec2 a)
Vec3 Reverse(Vec3 v)

Return the provided vector pointing in the opposite direction.

ReverseRotationOrder Function

RotationOrder ReverseRotationOrder(RotationOrder rotation_order)

Return the rotation order processing each axis in the reverse order of the input rotation order.

Rewind Function

nil Rewind(File file)

Rewind the read/write cursor of an open file.

RGBA32 Function

integer RGBA32(integer r, integer g, integer b)
integer RGBA32(integer r, integer g, integer b, integer a)

Create a 32 bit integer RGBA color.

RmDir Function

boolean RmDir(string path)

Remove an empty folder on the local filesystem.

See RmTree.

RmTree Function

boolean RmTree(string path)

Remove a folder on the local filesystem.

Warning: This function will through all subfolders and erase all files and folders in the target folder.

RotationMat2D Function

Mat3 RotationMat2D(number angle, Vec2 pivot)

Return a 2D rotation matrix by a radians around the specified pivot point.

RotationMat3 Function

Mat3 RotationMat3(number x, number y, number z)
Mat3 RotationMat3(number x, number y, number z, RotationOrder rotation_order)
Mat3 RotationMat3(Vec3 euler)
Mat3 RotationMat3(Vec3 euler, RotationOrder rotation_order)

Return a 3x3 rotation matrix.

RotationMat4 Function

Mat4 RotationMat4(Vec3 euler)
Mat4 RotationMat4(Vec3 euler, RotationOrder order)

Return a 4x3 rotation matrix from euler angles. The default rotation order is YXZ.

RotationMatX Function

Mat3 RotationMatX(number angle)

Return a 3x3 rotation matrix around the world X axis {1, 0, 0}.

RotationMatXY Function

Mat3 RotationMatXY(number x, number y)

Return a 3x3 rotation matrix around the X axis followed by a rotation around the Y axis.

RotationMatXYZ Function

Mat3 RotationMatXYZ(number x, number y, number z)

Return a 3x3 rotation matrix around the X axis followed by a rotation around the Y axis then a rotation around the Z axis.

RotationMatXZY Function

Mat3 RotationMatXZY(number x, number y, number z)

Return a 3x3 rotation matrix around the X axis followed by a rotation around the Z axis then a rotation around the Y axis.

RotationMatY Function

Mat3 RotationMatY(number angle)

Return a 3x3 rotation matrix around the world Y axis {0, 1, 0}.

RotationMatYXZ Function

Mat3 RotationMatYXZ(number x, number y, number z)

Return a 3x3 rotation matrix around the Y axis followed by a rotation around the X axis then a rotation around the Z axis.

RotationMatYZX Function

Mat3 RotationMatYZX(number x, number y, number z)

Return a 3x3 rotation matrix around the Y axis followed by a rotation around the Z axis then a rotation around the X axis.

RotationMatZ Function

Mat3 RotationMatZ(number angle)

Return a 3x3 rotation matrix around the world Z axis {0, 0, 1}.

RotationMatZXY Function

Mat3 RotationMatZXY(number x, number y, number z)

Return a 3x3 rotation matrix around the Z axis followed by a rotation around the X axis then a rotation around the Y axis.

RotationMatZYX Function

Mat3 RotationMatZYX(number x, number y, number z)

Return a 3x3 rotation matrix around the Z axis followed by a rotation around the Y axis then a rotation around the X axis.

SaveBMP Function

boolean SaveBMP(Picture pict, string path)

Save a Picture in BMP file format.

SaveDataToFile Function

boolean SaveDataToFile(string path, Data data)

SaveFileDialog Function

boolean, string SaveFileDialog(string title, FileFilterList filters, string file)
boolean, string SaveFileDialog(string title, FileFilterList filters, string file, string initial_dir)

Open a native SaveFile dialog.

SaveForwardPipelineAAAConfigToFile Function

boolean SaveForwardPipelineAAAConfigToFile(string path, ForwardPipelineAAAConfig config)

SaveGeometryToFile Function

boolean SaveGeometryToFile(string path, Geometry geo)

Save a geometry to the local filesystem.

Note that in order to render a geometry it must have been converted to model by the asset compiler.

See GeometryBuilder and ModelBuilder.

SaveJsonToFile Function

boolean SaveJsonToFile(JSON js, string path)

Save a JSON object to the local filesystem.

SavePNG Function

boolean SavePNG(Picture pict, string path)

Save a Picture in PNG file format.

SaveSceneBinaryToData Function

boolean SaveSceneBinaryToData(Data data, Scene scene, PipelineResources resources)
boolean SaveSceneBinaryToData(Data data, Scene scene, PipelineResources resources, LoadSaveSceneFlags flags)

SaveSceneBinaryToFile Function

boolean SaveSceneBinaryToFile(string path, Scene scene, PipelineResources resources)
boolean SaveSceneBinaryToFile(string path, Scene scene, PipelineResources resources, LoadSaveSceneFlags flags)

SaveSceneJsonToFile Function

boolean SaveSceneJsonToFile(string path, Scene scene, PipelineResources resources)
boolean SaveSceneJsonToFile(string path, Scene scene, PipelineResources resources, LoadSaveSceneFlags flags)

SaveTGA Function

boolean SaveTGA(Picture pict, string path)

Save a Picture in TGA file format.

ScaleMat3 Function

Mat3 ScaleMat3(Vec2 S)
Mat3 ScaleMat3(Vec3 S)

Return a 3x3 scale matrix from a 2D vector.

ScaleMat4 Function

Mat4 ScaleMat4(Vec3 scale)
Mat4 ScaleMat4(number scale)

Return a 4x3 scale matrix from the parameter scaling vector.

SceneClearSystems Function

nil SceneClearSystems(Scene scene)
nil SceneClearSystems(Scene scene, SceneLuaVM vm)
nil SceneClearSystems(Scene scene, ScenePhysics physics)
nil SceneClearSystems(Scene scene, ScenePhysics physics, SceneLuaVM vm)
nil SceneClearSystems(Scene scene, SceneBullet3Physics physics)
nil SceneClearSystems(Scene scene, SceneBullet3Physics physics, SceneLuaVM vm)

Clear scene and all optional systems.

SceneGarbageCollectSystems Function

integer SceneGarbageCollectSystems(Scene scene)
integer SceneGarbageCollectSystems(Scene scene, SceneLuaVM vm)
integer SceneGarbageCollectSystems(Scene scene, ScenePhysics physics)
integer SceneGarbageCollectSystems(Scene scene, ScenePhysics physics, SceneLuaVM vm)
integer SceneGarbageCollectSystems(Scene scene, SceneBullet3Physics physics)
integer SceneGarbageCollectSystems(Scene scene, SceneBullet3Physics physics, SceneLuaVM vm)

Garbage collect a scene and all its optional systems.

SceneSyncToSystemsFromAssets Function

nil SceneSyncToSystemsFromAssets(Scene scene, SceneLuaVM vm)
nil SceneSyncToSystemsFromAssets(Scene scene, ScenePhysics physics)
nil SceneSyncToSystemsFromAssets(Scene scene, ScenePhysics physics, SceneLuaVM vm)
nil SceneSyncToSystemsFromAssets(Scene scene, SceneBullet3Physics physics)
nil SceneSyncToSystemsFromAssets(Scene scene, SceneBullet3Physics physics, SceneLuaVM vm)

Synchronize optional systems (eg. physics or script) states with the scene states. Load resources from the assets system if required.

See Resources & Assets.

SceneSyncToSystemsFromFile Function

nil SceneSyncToSystemsFromFile(Scene scene, SceneLuaVM vm)
nil SceneSyncToSystemsFromFile(Scene scene, ScenePhysics physics)
nil SceneSyncToSystemsFromFile(Scene scene, ScenePhysics physics, SceneLuaVM vm)
nil SceneSyncToSystemsFromFile(Scene scene, SceneBullet3Physics physics)
nil SceneSyncToSystemsFromFile(Scene scene, SceneBullet3Physics physics, SceneLuaVM vm)

Synchronize optional systems (eg. physics or script) states with the scene states. Load resources from the local filesystem if required.

See Resources & Assets.

SceneUpdateSystems Function

nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt)
nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, SceneLuaVM vm)
nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, ScenePhysics physics, integer step, integer max_physics_step)
nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, ScenePhysics physics, integer step, integer max_physics_step, SceneLuaVM vm)
nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, ScenePhysics physics, NodePairContacts contacts, integer step, integer max_physics_step)
nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, ScenePhysics physics, NodePairContacts contacts, integer step, integer max_physics_step, SceneLuaVM vm)
nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, SceneBullet3Physics physics, integer step, integer max_physics_step)
nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, SceneBullet3Physics physics, integer step, integer max_physics_step, SceneLuaVM vm)
nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, SceneBullet3Physics physics, NodePairContacts contacts, integer step, integer max_physics_step)
nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, SceneBullet3Physics physics, NodePairContacts contacts, integer step, integer max_physics_step, SceneLuaVM vm)

Update a scene and all its optional systems.

ScreenSpaceToClipSpace Function

Vec3 ScreenSpaceToClipSpace(Vec3 screen, Vec2 resolution)

Transform a screen position to clip space.

Sec Function

number Sec(number seconds)

Convert a value in seconds to the Harfang internal unit system.

See Coordinates and Units System.

Seed Function

nil Seed(integer seed)

Set the starting seed of the pseudo-random number generator.

Seek Function

boolean Seek(File file, integer offset, SeekMode mode)

Move the handle cursor to a specific position in the file.

SendVRControllerHapticPulse Function

nil SendVRControllerHapticPulse(integer duration)
nil SendVRControllerHapticPulse(integer duration, string name)

Send an haptic pulse to a named VR controller.

See GetVRControllerNames.

SetAxises Function

nil SetAxises(Mat3 m, Vec3 X, Vec3 Y, Vec3 Z)

Inject X, Y and Z axises into a 3x3 matrix.

SetColumn Function

nil SetColumn(Mat3 m, integer n, Vec3 column)
nil SetColumn(Mat4 m, integer n, Vec3 v)
nil SetColumn(Mat44 m, integer idx, Vec4 v)

Returns the nth column.

SetHeight Function

nil SetHeight(Rect rect, number height)
nil SetHeight(IntRect rect, integer height)

Set a rectangle height.

SetJsonValue Function

nil SetJsonValue(JSON js, string key, string value)
nil SetJsonValue(JSON js, string key, boolean value)
nil SetJsonValue(JSON js, string key, integer value)
nil SetJsonValue(JSON js, string key, number value)

Set a JSON key value.

SetListener Function

nil SetListener(Mat4 world, Vec3 velocity)

Set the listener transformation and velocity for spatialization by the audio system.

SetLogDetailed Function

nil SetLogDetailed(boolean is_detailed)

Display the details field of log outputs.

SetLogLevel Function

nil SetLogLevel(LogLevel log_level)

Control which log levels should be displayed.

See Log, Warn, Error and Debug.

SetMaterialAlphaCut Function

nil SetMaterialAlphaCut(Material mat, boolean enable)

SetMaterialAmbientUsesUV1 Function

nil SetMaterialAmbientUsesUV1(Material mat, boolean enable)

SetMaterialBlendMode Function

nil SetMaterialBlendMode(Material mat, BlendMode mode)

Set material blend mode.

SetMaterialDepthTest Function

nil SetMaterialDepthTest(Material mat, DepthTest test)

Set material depth test.

SetMaterialDiffuseUsesUV1 Function

nil SetMaterialDiffuseUsesUV1(Material mat, boolean enable)

SetMaterialFaceCulling Function

nil SetMaterialFaceCulling(Material mat, FaceCulling culling)

Set material face culling.

SetMaterialNormalMapInWorldSpace Function

nil SetMaterialNormalMapInWorldSpace(Material mat, boolean enable)

SetMaterialProgram Function

nil SetMaterialProgram(Material mat, PipelineProgramRef program)

Set material pipeline program.

You should call UpdateMaterialPipelineProgramVariant after changing a material pipeline program so that the correct variant is selected according to the material states.

SetMaterialSkinning Function

nil SetMaterialSkinning(Material mat, boolean enable)

SetMaterialSpecularUsesUV1 Function

nil SetMaterialSpecularUsesUV1(Material mat, boolean enable)

SetMaterialTexture Function

nil SetMaterialTexture(Material mat, string name, TextureRef texture, integer stage)

Set a material uniform texture and texture stage.

Note: The texture stage specified should match the uniform declaration in the shader program.

SetMaterialTextureRef Function

nil SetMaterialTextureRef(Material mat, string name, TextureRef texture)

Set a material uniform texture reference.

See PipelineResources.

SetMaterialValue Function

nil SetMaterialValue(Material mat, string name, number v)
nil SetMaterialValue(Material mat, string name, Vec2 v)
nil SetMaterialValue(Material mat, string name, Vec3 v)
nil SetMaterialValue(Material mat, string name, Vec4 v)
nil SetMaterialValue(Material mat, string name, Mat3 m)
nil SetMaterialValue(Material mat, string name, Mat4 m)
nil SetMaterialValue(Material mat, string name, Mat44 m)

Set a material uniform value.

SetMaterialWriteRGBA Function

nil SetMaterialWriteRGBA(Material mat, boolean write_r, boolean write_g, boolean write_b, boolean write_a)

Set a material color write mask.

SetMaterialWriteZ Function

nil SetMaterialWriteZ(Material mat, boolean enable)

Set a material depth write mask.

SetRenderDebug Function

nil SetRenderDebug(DebugFlags flags)

Set render system debug flags.

SetRow Function

nil SetRow(Mat3 m, integer n, Vec3 row)
nil SetRow(Mat4 m, integer n, Vec4 v)
nil SetRow(Mat44 m, integer idx, Vec4 v)

Sets the nth row of a matrix.

SetS Function

nil SetS(Mat4 m, Vec3 scale)

Shortcut for SetScale.

SetSaturation Function

Color SetSaturation(Color color, number saturation)

Return a copy of the input RGBA color with its saturation set to the specified value, alpha channel is left unmodified.

See ToHLS and FromHLS.

SetScale Function

nil SetScale(Mat3 m, Vec3 S)
nil SetScale(Mat4 m, Vec3 scale)

Set the scaling part of the transformation matrix.

SetSourcePanning Function

nil SetSourcePanning(SourceRef source, number panning)

Set a playing audio source panning.

SetSourceRepeat Function

nil SetSourceRepeat(SourceRef source, SourceRepeat repeat)

Set audio source repeat mode.

SetSourceTimecode Function

boolean SetSourceTimecode(SourceRef source, integer t)

Set timecode of the audio source.

SetSourceTransform Function

nil SetSourceTransform(SourceRef source, Mat4 world, Vec3 velocity)

Set a playing spatialized audio source transformation.

SetSourceVolume Function

nil SetSourceVolume(SourceRef source, number volume)

Set audio source volume.

SetT Function

nil SetT(Mat4 m, Vec3 T)

Shortcut for SetTranslation.

SetTransform Function

nil SetTransform(Mat4 mtx)

Set the model matrix for the next drawn primitive.

If not called, model will be rendered with the identity model matrix.

SetTranslation Function

nil SetTranslation(Mat3 m, Vec3 T)
nil SetTranslation(Mat3 m, Vec2 T)
nil SetTranslation(Mat4 m, Vec3 T)

Sets the 2D translation part, i.e. the first 2 elements of the last matrix row.

SetView2D Function

nil SetView2D(integer id, integer x, integer y, integer res_x, integer res_y)
nil SetView2D(integer id, integer x, integer y, integer res_x, integer res_y, number znear, number zfar)
nil SetView2D(integer id, integer x, integer y, integer res_x, integer res_y, number znear, number zfar, ClearFlags flags, Color color, number depth, integer stencil)
nil SetView2D(integer id, integer x, integer y, integer res_x, integer res_y, number znear, number zfar, ClearFlags flags, Color color, number depth, integer stencil, boolean y_up)

High-level wrapper function to setup a view for 2D rendering.

This function calls SetViewClear, SetViewRect then SetViewTransform.

SetViewClear Function

nil SetViewClear(integer view_id, ClearFlags flags)
nil SetViewClear(integer view_id, ClearFlags flags, integer rgba)
nil SetViewClear(integer view_id, ClearFlags flags, integer rgba, number depth)
nil SetViewClear(integer view_id, ClearFlags flags, integer rgba, number depth, integer stencil)
nil SetViewClear(integer view_id, ClearFlags flags, Color col)
nil SetViewClear(integer view_id, ClearFlags flags, Color col, number depth)
nil SetViewClear(integer view_id, ClearFlags flags, Color col, number depth, integer stencil)

Set a view clear parameters.

See Drawing to Views.

SetViewFrameBuffer Function

nil SetViewFrameBuffer(integer view_id, FrameBufferHandle handle)

Set view output framebuffer.

See Drawing to Views.

SetViewMode Function

nil SetViewMode(integer view_id, ViewMode mode)

Set view draw ordering mode.

SetViewOrthographic Function

nil SetViewOrthographic(integer id, integer x, integer y, integer res_x, integer res_y, Mat4 world)
nil SetViewOrthographic(integer id, integer x, integer y, integer res_x, integer res_y, Mat4 world, number znear, number zfar)
nil SetViewOrthographic(integer id, integer x, integer y, integer res_x, integer res_y, Mat4 world, number znear, number zfar, number size)
nil SetViewOrthographic(integer id, integer x, integer y, integer res_x, integer res_y, Mat4 world, number znear, number zfar, number size, ClearFlags flags, Color color, number depth, integer stencil)

High-level wrapper function to setup a view for 3D orthographic rendering.

This function calls SetViewClear, SetViewRect then SetViewTransform.

SetViewPerspective Function

nil SetViewPerspective(integer id, integer x, integer y, integer res_x, integer res_y, Mat4 world)
nil SetViewPerspective(integer id, integer x, integer y, integer res_x, integer res_y, Mat4 world, number znear, number zfar)
nil SetViewPerspective(integer id, integer x, integer y, integer res_x, integer res_y, Mat4 world, number znear, number zfar, number zoom_factor)
nil SetViewPerspective(integer id, integer x, integer y, integer res_x, integer res_y, Mat4 world, number znear, number zfar, number zoom_factor, ClearFlags flags, Color color, number depth, integer stencil)

High-level wrapper function to setup a view for 3D perspective rendering.

This function calls SetViewClear, SetViewRect then SetViewTransform.

SetViewRect Function

nil SetViewRect(integer view_id, integer x, integer y, integer w, integer h)

SetViewTransform Function

nil SetViewTransform(integer view_id, Mat4 view, Mat44 proj)

Set view transforms, namely the view and projection matrices.

SetWidth Function

nil SetWidth(Rect rect, number width)
nil SetWidth(IntRect rect, integer width)

Set a rectangle width.

SetWindowClientSize Function

boolean SetWindowClientSize(Window window, integer width, integer height)

Set the window client size. The client area of a window excludes its decoration.

SetWindowPos Function

boolean SetWindowPos(Window window, iVec2 position)

Set window position.

SetWindowTitle Function

boolean SetWindowTitle(Window window, string title)

Set window title.

SetX Function

nil SetX(Mat3 m, Vec3 X)
nil SetX(Mat4 m, Vec3 X)
nil SetX(Rect rect, number x)
nil SetX(IntRect rect, integer x)

Sets the first row.

SetY Function

nil SetY(Mat3 m, Vec3 Y)
nil SetY(Mat4 m, Vec3 Y)
nil SetY(Rect rect, number y)
nil SetY(IntRect rect, integer y)

Sets the second row.

SetZ Function

nil SetZ(Mat3 m, Vec3 Z)
nil SetZ(Mat4 m, Vec3 Z)

Sets the third row.

ShowCursor Function

nil ShowCursor()

Show the system mouse cursor.

See HideCursor.

Sign Function

Vec3 Sign(Vec3 v)

Returns a vector whose elements are -1 if the corresponding vector element is < 0 and 1 if it's >= 0.

SkipClock Function

nil SkipClock()

Skip elapsed time since the last call to TickClock.

Sleep Function

nil Sleep(integer duration)

Sleep the caller thread, this function will resume execution after waiting for at least the specified amount of time.

Slerp Function

Quaternion Slerp(Quaternion a, Quaternion b, number t)

Interpolate between the rotation represented by two quaternions. The Spherical Linear Interpolation will always take the shortest path between the two rotations.

SRanipalGetState Function

SRanipalState SRanipalGetState()

Return the current SRanipal device state.

SRanipalInit Function

boolean SRanipalInit()

Initial the SRanipal eye detection SDK.

SRanipalIsViveProEye Function

boolean SRanipalIsViveProEye()

Return true if the eye detection device in use is Vive Pro Eye.

SRanipalLaunchEyeCalibration Function

nil SRanipalLaunchEyeCalibration()

Launch the eye detection calibration sequence.

SRanipalShutdown Function

nil SRanipalShutdown()

Shutdown the SRanipal eye detection SDK.

StopAllSources Function

nil StopAllSources()

Stop all playing audio sources.

StopSource Function

nil StopSource(SourceRef source)

Stop a playing audio source.

StreamAudioFileSpatialized Function

SourceRef StreamAudioFileSpatialized(IAudioStreamer streamer, string path, SpatializedSourceState state)

StreamAudioFileStereo Function

SourceRef StreamAudioFileStereo(IAudioStreamer streamer, string path, StereoSourceState state)

StreamModuleFileSpatialized Function

SourceRef StreamModuleFileSpatialized(string path, SpatializedSourceState state)

StreamModuleFileStereo Function

SourceRef StreamModuleFileStereo(string path, StereoSourceState state)

StreamOGGAssetSpatialized Function

SourceRef StreamOGGAssetSpatialized(string name, SpatializedSourceState state)

StreamOGGAssetStereo Function

SourceRef StreamOGGAssetStereo(string name, StereoSourceState state)

StreamOGGFileSpatialized Function

SourceRef StreamOGGFileSpatialized(string path, SpatializedSourceState state)

StreamOGGFileStereo Function

SourceRef StreamOGGFileStereo(string path, StereoSourceState state)

StreamWAVAssetSpatialized Function

SourceRef StreamWAVAssetSpatialized(string name, SpatializedSourceState state)

Start an audio stream from a WAV file from the assets system.

See SetSourceTransform and Resources & Assets.

StreamWAVAssetStereo Function

SourceRef StreamWAVAssetStereo(string name, StereoSourceState state)

Start an audio stream from a WAV file from the assets system.

See Resources & Assets.

StreamWAVFileSpatialized Function

SourceRef StreamWAVFileSpatialized(string path, SpatializedSourceState state)

Start an audio stream from a WAV file on the local filesystem.

See SetSourceTransform.

StreamWAVFileStereo Function

SourceRef StreamWAVFileStereo(string path, StereoSourceState state)

Start an audio stream from a WAV file on the local filesystem.

See Resources & Assets.

StringToFile Function

boolean StringToFile(string path, string value)

Return the content of a file on the local filesystem as a string.

SubmitSceneToForwardPipeline Function

SceneForwardPipelinePassViewId, integer SubmitSceneToForwardPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, SceneForwardPipelineRenderData render_data, PipelineResources resources)
SceneForwardPipelinePassViewId, integer SubmitSceneToForwardPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, SceneForwardPipelineRenderData render_data, PipelineResources resources, FrameBufferHandle frame_buffer)
SceneForwardPipelinePassViewId, integer SubmitSceneToForwardPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, SceneForwardPipelineRenderData render_data, PipelineResources resources, FrameBufferHandle frame_buffer, string debug_name)
integer SubmitSceneToForwardPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, SceneForwardPipelineRenderData render_data, PipelineResources resources, SceneForwardPipelinePassViewId views, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame)
integer SubmitSceneToForwardPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, SceneForwardPipelineRenderData render_data, PipelineResources resources, SceneForwardPipelinePassViewId views, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame, FrameBufferHandle frame_buffer)
integer SubmitSceneToForwardPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, SceneForwardPipelineRenderData render_data, PipelineResources resources, SceneForwardPipelinePassViewId views, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame, FrameBufferHandle frame_buffer, string debug_name)

Submit a scene to a forward pipeline.

See PrepareSceneForwardPipelineCommonRenderData and PrepareSceneForwardPipelineViewDependentRenderData if you need to render the same scene from different points of view.

SubmitSceneToPipeline Function

SceneForwardPipelinePassViewId, integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, PipelineResources resources)
SceneForwardPipelinePassViewId, integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, PipelineResources resources, FrameBufferHandle fb)
SceneForwardPipelinePassViewId, integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, PipelineResources resources, FrameBufferHandle fb, string debug_name)
SceneForwardPipelinePassViewId, integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, boolean fov_axis_is_horizontal, ForwardPipeline pipeline, PipelineResources resources)
SceneForwardPipelinePassViewId, integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, boolean fov_axis_is_horizontal, ForwardPipeline pipeline, PipelineResources resources, FrameBufferHandle fb)
SceneForwardPipelinePassViewId, integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, boolean fov_axis_is_horizontal, ForwardPipeline pipeline, PipelineResources resources, FrameBufferHandle fb, string debug_name)
SceneForwardPipelinePassViewId, integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, PipelineResources resources, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame)
SceneForwardPipelinePassViewId, integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, PipelineResources resources, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame, FrameBufferHandle frame_buffer)
SceneForwardPipelinePassViewId, integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, PipelineResources resources, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame, FrameBufferHandle frame_buffer, string debug_name)
SceneForwardPipelinePassViewId, integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, boolean fov_axis_is_horizontal, ForwardPipeline pipeline, PipelineResources resources, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame)
SceneForwardPipelinePassViewId, integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, boolean fov_axis_is_horizontal, ForwardPipeline pipeline, PipelineResources resources, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame, FrameBufferHandle frame_buffer)
SceneForwardPipelinePassViewId, integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, boolean fov_axis_is_horizontal, ForwardPipeline pipeline, PipelineResources resources, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame, FrameBufferHandle frame_buffer, string debug_name)

SwapFileExtension Function

string SwapFileExtension(string path, string ext)

Return the input file path with its extension replaced.

Tell Function

integer Tell(File file)

Return the current handle cursor position in bytes.

TestVisibility Function

Visibility TestVisibility(Frustum frustum, integer count, Vec3 points)
Visibility TestVisibility(Frustum frustum, integer count, Vec3 points, number distance)
Visibility TestVisibility(Frustum frustum, Vec3 origin, number radius)
Visibility TestVisibility(Frustum frustum, MinMax minmax)

Test if a list of 3d points are inside or outside a Frustum.

TickClock Function

integer TickClock()

Advance the engine clock and return the elapsed time since the last call to this function. See GetClock to retrieve the current clock.

See GetClockDt.

time_from_day Function

integer time_from_day(integer day)

Convert days to time.

See Coordinates and Units System.

time_from_hour Function

integer time_from_hour(integer hour)

Convert hours to time.

See Coordinates and Units System.

time_from_min Function

integer time_from_min(integer min)

Convert minutes to time.

See Coordinates and Units System.

time_from_ms Function

integer time_from_ms(integer ms)

Convert milliseconds to time.

See Coordinates and Units System.

time_from_ms_f Function

integer time_from_ms_f(number ms)

Convert milliseconds to time.

See Coordinates and Units System.

time_from_ns Function

integer time_from_ns(integer ns)

Convert nanoseconds to time.

See Coordinates and Units System.

time_from_sec Function

integer time_from_sec(integer sec)

Convert seconds to time.

See Coordinates and Units System.

time_from_sec_f Function

integer time_from_sec_f(number sec)

Convert fractional seconds to time.

See Coordinates and Units System.

time_from_us Function

integer time_from_us(integer us)

Convert microseconds to time.

See Coordinates and Units System.

time_from_us_f Function

integer time_from_us_f(number us)

Convert fractional microseconds to time.

See Coordinates and Units System.

time_now Function

integer time_now()

Return the current system time.

time_to_day Function

integer time_to_day(integer t)

Convert time to days.

time_to_hour Function

integer time_to_hour(integer t)

Convert time to hours.

time_to_min Function

integer time_to_min(integer t)

Convert time to minutes.

time_to_ms Function

integer time_to_ms(integer t)

Convert time to milliseconds.

time_to_ms_f Function

number time_to_ms_f(integer t)

Convert time to miliseconds.

time_to_ns Function

integer time_to_ns(integer t)

Convert time to nanoseconds.

time_to_sec Function

integer time_to_sec(integer t)

Convert time to seconds.

time_to_sec_f Function

number time_to_sec_f(integer t)

Convert time to fractional seconds.

time_to_string Function

string time_to_string(integer t)

Return time as a human-readable string.

time_to_us Function

integer time_to_us(integer t)

Convert time to microseconds.

time_to_us_f Function

number time_to_us_f(integer t)

Convert time to fractional microseconds.

ToEuler Function

Vec3 ToEuler(Quaternion q)
Vec3 ToEuler(Quaternion q, RotationOrder rotation_order)
Vec3 ToEuler(Mat3 m)
Vec3 ToEuler(Mat3 m, RotationOrder rotation_order)

Convert a quaternion rotation to its Euler vector representation.

ToFloatRect Function

Rect ToFloatRect(IntRect rect)

Return an integer rectangle as a floating point rectangle.

ToHLS Function

Color ToHLS(Color color)

Convert input RGBA color to hue/luminance/saturation, alpha channel is left unmodified.

ToIntRect Function

IntRect ToIntRect(Rect rect)

Return a floating point rectangle as an integer rectangle.

ToMatrix3 Function

Mat3 ToMatrix3(Quaternion q)

Convert a quaternion rotation to its Mat3 representation.

Touch Function

nil Touch(integer view_id)

Submit an empty primitive to the view.

See Frame.

TransformationMat4 Function

Mat4 TransformationMat4(Vec3 pos, Vec3 rot)
Mat4 TransformationMat4(Vec3 pos, Vec3 rot, Vec3 scale)
Mat4 TransformationMat4(Vec3 pos, Mat3 rot)
Mat4 TransformationMat4(Vec3 pos, Mat3 rot, Vec3 scale)

Creates a 4x3 transformation matrix from the translation vector p, the 3x3 rotation Matrix m (or YXZ euler rotation vector e) and the scaling vector s.

This is a more efficient version of TranslationMat4(p) * ScaleMat4(s) * m

TransformFrustum Function

Frustum TransformFrustum(Frustum frustum, Mat4 mtx)

Return the input frustum transformed by the provided world matrix.

TranslationMat3 Function

Mat3 TranslationMat3(Vec2 T)
Mat3 TranslationMat3(Vec3 T)

Return a 2D translation 3x3 matrix from the first 2 components (x,y) of the parameter vector.

TranslationMat4 Function

Mat4 TranslationMat4(Vec3 t)

Return a 4x3 translation matrix from the parameter displacement vector.

Transpose Function

Mat3 Transpose(Mat3 m)

Return the transpose of the input matrix.

For a pure rotation matrix this returns the opposite transformation so that M*MT=I.

Union Function

MinMax Union(MinMax minmax_a, MinMax minmax_b)
MinMax Union(MinMax minmax, Vec3 position)

Compute the union of this bounding volume with another volume or a 3d position.

Unlink Function

boolean Unlink(string path)

Remove a file from the local filesystem.

UnloadSound Function

nil UnloadSound(SoundRef snd)

Unload a sound from the audio system.

UnprojectFromClipSpace Function

boolean, Vec3 UnprojectFromClipSpace(Mat44 inv_proj, Vec3 clip)

Unproject a clip space position to view space.

UnprojectFromScreenSpace Function

boolean, Vec3 UnprojectFromScreenSpace(Mat44 inv_proj, Vec3 screen, Vec2 resolution)

Unproject a screen space position to view space.

UnprojectOrthoFromClipSpace Function

boolean, Vec3 UnprojectOrthoFromClipSpace(Mat44 inv_proj, Vec3 clip)

UnprojectOrthoFromScreenSpace Function

boolean, Vec3 UnprojectOrthoFromScreenSpace(Mat44 inv_proj, Vec3 screen, Vec2 resolution)

UpdateMaterialPipelineProgramVariant Function

nil UpdateMaterialPipelineProgramVariant(Material mat, PipelineResources resources)

Select the proper pipeline program variant for the current material state.

UpdateTexture Function

boolean, Texture, iVec2, TextureFormat UpdateTexture(IVideoStreamer streamer, integer handle, Texture texture, iVec2 size, TextureFormat format)
boolean, Texture, iVec2, TextureFormat UpdateTexture(IVideoStreamer streamer, integer handle, Texture texture, iVec2 size, TextureFormat format, boolean destroy)

UpdateTextureFromPicture Function

nil UpdateTextureFromPicture(Texture tex, Picture pic)

Update texture content from the provided picture.

Note: The picture is expected to be in a format compatible with the texture format.

UpdateWindow Function

boolean UpdateWindow(Window window)

Update a window on the host system.

Vec3I Function

Vec3 Vec3I(integer x, integer y, integer z)

Create a vector from integer values in the [0;255] range.

Vec4I Function

Vec4 Vec4I(integer x, integer y, integer z)
Vec4 Vec4I(integer x, integer y, integer z, integer w)

Create a vector from integer values in the [0;255] range.

VectorMat3 Function

Mat3 VectorMat3(Vec3 V)

Return a vector as a matrix.

VertexLayoutPosFloatColorFloat Function

VertexLayout VertexLayoutPosFloatColorFloat()

VertexLayoutPosFloatColorUInt8 Function

VertexLayout VertexLayoutPosFloatColorUInt8()

VertexLayoutPosFloatNormFloat Function

VertexLayout VertexLayoutPosFloatNormFloat()

Simple vertex layout with float position and normal.

vtx_layout = VertexLayout()
vtx_layout.Begin()
vtx_layout.Add(hg.A_Position, 3, hg.AT_Float)
vtx_layout.Add(hg.A_Normal, 3, hg.AT_Float)
vtx_layout.End()

VertexLayoutPosFloatNormUInt8 Function

VertexLayout VertexLayoutPosFloatNormUInt8()

Simple vertex layout with float position and 8-bit unsigned integer normal.

vtx_layout = VertexLayout()
vtx_layout.Begin()
vtx_layout.Add(hg.A_Position, 3, hg.AT_Float)
vtx_layout.Add(hg.A_Normal, 3, hg.AT_Uint8, True, True)
vtx_layout.End()

VertexLayoutPosFloatNormUInt8TexCoord0UInt8 Function

VertexLayout VertexLayoutPosFloatNormUInt8TexCoord0UInt8()

VertexLayoutPosFloatTexCoord0UInt8 Function

VertexLayout VertexLayoutPosFloatTexCoord0UInt8()

Warn Function

nil Warn(string msg)
nil Warn(string msg, string details)

WindowHasFocus Function

boolean WindowHasFocus(Window window)

Return true if the provided window has focus, false otherwise.

WindowSystemInit Function

nil WindowSystemInit()

Initialize the Window system.

WindowSystemShutdown Function

nil WindowSystemShutdown()

Shutdown the window system.

See WindowSystemInit.

Wrap Function

number Wrap(number v, number start, number end)
integer Wrap(integer v, integer start, integer end)

Wrap the input value so that it fits in the specified inclusive range.

WriteFloat Function

boolean WriteFloat(File file, number value)

Write a binary 32 bit floating point value to a file.

WriteString Function

boolean WriteString(File file, string value)

Write a string to a file as 32 bit integer size followed by the string content in UTF8.

WriteUInt16 Function

boolean WriteUInt16(File file, integer value)

Write a binary 16 bit unsigned integer to a file.

WriteUInt32 Function

boolean WriteUInt32(File file, integer value)

Write a binary 32 bit unsigned integer to a file.

WriteUInt8 Function

boolean WriteUInt8(File file, integer value)

Write a binary 8 bit unsigned integer to a file.

ZoomFactorToFov Function

number ZoomFactorToFov(number zoom_factor)

Convert from a zoom factor value in meters to a fov value in radian.