API Functions Python

Abs Function

Abs(v: Vec4) -> Vec4
Abs(v: Vec3) -> Vec3
Abs(v: float) -> float
Abs(v: int) -> int

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

AddAssetsFolder(path: str) -> bool

Mount a local filesystem folder as an assets source.

See Resources & Assets.

AddAssetsPackage Function

AddAssetsPackage(path: str) -> bool

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

See Resources & Assets.

AlphaScale Function

AlphaScale(color: Color, k: float) -> Color

Scale the alpha component of the input color.

ApplyBloom Function

ApplyBloom(view_id: int, rect: IntRect, input: Texture, output: FrameBufferHandle, bloom: Bloom, threshold: float, smoothness: float, intensity: float) -> int

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

ARGB32(r: int, g: int, b: int) -> int
ARGB32(r: int, g: int, b: int, a: int) -> int

Create a 32 bit integer ARGB color.

ARGB32ToRGBA32 Function

ARGB32ToRGBA32(argb: int) -> int

Convert a 32 bit integer ARGB color to RGBA.

AudioInit Function

AudioInit() -> bool

Initialize the audio system.

AudioShutdown Function

AudioShutdown() -> None

Shutdown the audio system.

BaseToEuler Function

BaseToEuler(z: Vec3) -> Vec3
BaseToEuler(z: Vec3, y: Vec3) -> Vec3

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

BeginProfilerSection(name: str) -> int
BeginProfilerSection(name: str, section_details: str) -> int

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

CaptureProfilerFrame Function

CaptureProfilerFrame() -> ProfilerFrame

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

CaptureTexture(view_id: int, resources: PipelineResources, tex: TextureRef, read_back: Texture, pic: Picture) -> int, int

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

Cast_Pipeline_To_ForwardPipeline(o: Pipeline) -> ForwardPipeline

Ceil Function

Ceil(v: Vec3) -> Vec3

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

ChromaScale Function

ChromaScale(color: Color, k: float) -> Color

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

Clamp Function

Clamp(v: Vec3, min: float, max: float) -> Vec3
Clamp(v: Vec3, min: Vec3, max: Vec3) -> Vec3
Clamp(v: float, min: float, max: float) -> float
Clamp(v: int, min: int, max: int) -> int
Clamp(color: Color, min: float, max: float) -> Color
Clamp(color: Color, min: Color, max: Color) -> Color

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

ClampLen Function

ClampLen(v: Vec3, min: float, max: float) -> Vec3

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

ClassifyLine Function

ClassifyLine(minmax: MinMax, position: Vec3, direction: Vec3) -> bool, Vec3, Vec3

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

ClassifySegment Function

ClassifySegment(minmax: MinMax, p0: Vec3, p1: Vec3) -> bool, Vec3, Vec3

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

CleanPath Function

CleanPath(path: str) -> str

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

ClipSpaceToScreenSpace(clip: Vec3, resolution: Vec2) -> Vec3

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

Close Function

Close(file: File) -> bool

Close a file handle.

Cm Function

Cm(cm: float) -> float

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

See Coordinates and Units System.

ColorFromABGR32 Function

ColorFromABGR32(rgba32: int) -> Color

Create a color from a 32 bit ABGR integer.

ColorFromRGBA32 Function

ColorFromRGBA32(rgba32: int) -> Color

Create a color from a 32 bit RGBA integer.

ColorFromVector3 Function

ColorFromVector3(v: Vec3) -> Color

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

ColorFromVector4 Function

ColorFromVector4(v: Vec4) -> Color

Return a 4-dimensional vector as a color.

ColorI Function

ColorI(r: int, g: int, b: int) -> Color
ColorI(r: int, g: int, b: int, a: int) -> Color

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

ColorToABGR32 Function

ColorToABGR32(color: Color) -> int

Return a 32 bit ABGR integer from a color.

ColorToGrayscale Function

ColorToGrayscale(color: Color) -> float

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

ColorToRGBA32 Function

ColorToRGBA32(color: Color) -> int

Return a 32 bit RGBA integer from a color.

Compute2DProjectionMatrix Function

Compute2DProjectionMatrix(znear: float, zfar: float, res_x: float, res_y: float, y_up: bool) -> Mat44

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

ComputeAspectRatioX Function

ComputeAspectRatioX(width: float, height: float) -> Vec2

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

See ComputeAspectRatioY.

ComputeAspectRatioY Function

ComputeAspectRatioY(width: float, height: float) -> Vec2

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

See ComputeAspectRatioX.

ComputeMinMaxBoundingSphere Function

ComputeMinMaxBoundingSphere(minmax: MinMax) -> Vec3, float

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

ComputeOrthographicProjectionMatrix Function

ComputeOrthographicProjectionMatrix(znear: float, zfar: float, size: float, aspect_ratio: Vec2) -> Mat44
ComputeOrthographicProjectionMatrix(znear: float, zfar: float, size: float, aspect_ratio: Vec2, offset: Vec2) -> Mat44

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

ComputeOrthographicViewState(world: Mat4, size: float, znear: float, zfar: float, aspect_ratio: Vec2) -> ViewState

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

ComputePerspectiveProjectionMatrix(znear: float, zfar: float, zoom_factor: float, aspect_ratio: Vec2) -> Mat44
ComputePerspectiveProjectionMatrix(znear: float, zfar: float, zoom_factor: float, aspect_ratio: Vec2, offset: Vec2) -> Mat44

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

See ZoomFactorToFov, FovToZoomFactor, ComputeAspectRatioX and ComputeAspectRatioY.

ComputePerspectiveViewState Function

ComputePerspectiveViewState(world: Mat4, fov: float, znear: float, zfar: float, aspect_ratio: Vec2) -> ViewState

ComputeRenderState Function

ComputeRenderState(blend: BlendMode) -> RenderState
ComputeRenderState(blend: BlendMode, depth_test: DepthTest) -> RenderState
ComputeRenderState(blend: BlendMode, depth_test: DepthTest, culling: FaceCulling) -> RenderState
ComputeRenderState(blend: BlendMode, depth_test: DepthTest, culling: FaceCulling, write_z: bool) -> RenderState
ComputeRenderState(blend: BlendMode, depth_test: DepthTest, culling: FaceCulling, write_z: bool, write_r: bool) -> RenderState
ComputeRenderState(blend: BlendMode, depth_test: DepthTest, culling: FaceCulling, write_z: bool, write_r: bool, write_g: bool) -> RenderState
ComputeRenderState(blend: BlendMode, depth_test: DepthTest, culling: FaceCulling, write_z: bool, write_r: bool, write_g: bool, write_b: bool) -> RenderState
ComputeRenderState(blend: BlendMode, depth_test: DepthTest, culling: FaceCulling, write_z: bool, write_r: bool, write_g: bool, write_b: bool, write_a: bool) -> RenderState
ComputeRenderState(blend: BlendMode, write_z: bool) -> RenderState
ComputeRenderState(blend: BlendMode, write_z: bool, write_r: bool) -> RenderState
ComputeRenderState(blend: BlendMode, write_z: bool, write_r: bool, write_g: bool) -> RenderState
ComputeRenderState(blend: BlendMode, write_z: bool, write_r: bool, write_g: bool, write_b: bool) -> RenderState
ComputeRenderState(blend: BlendMode, write_z: bool, write_r: bool, write_g: bool, write_b: bool, write_a: bool) -> RenderState

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

ComputeSAO(view_id: int, rect: IntRect, attr0: Texture, attr1: Texture, noise: Texture, output: FrameBufferHandle, sao: SAO, projection: Mat44, bias: float, radius: float, sample_count: int, sharpness: float) -> None

ComputeSortKey Function

ComputeSortKey(view_depth: float) -> int

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

ComputeSortKeyFromWorld Function

ComputeSortKeyFromWorld(T: Vec3, view: Mat4) -> int
ComputeSortKeyFromWorld(T: Vec3, view: Mat4, model: Mat4) -> int

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

ComputeTextHeight Function

ComputeTextHeight(font: Font, text: str) -> float

Compute the height of a text string.

ComputeTextRect Function

ComputeTextRect(font: Font, text: str) -> Rect
ComputeTextRect(font: Font, text: str, xpos: float) -> Rect
ComputeTextRect(font: Font, text: str, xpos: float, ypos: float) -> Rect

Compute the width and height of a text string.

ConfigureCrowdAgent Function

ConfigureCrowdAgent(radius: float, height: float, max_acceleration: float, max_speed: float, collision_query_range: float, path_optimization_range: float, separation_weight: float) -> CrowdAgentParams

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

Contains Function

Contains(minmax: MinMax, position: Vec3) -> bool

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

CopyDir Function

CopyDir(src: str, dst: str) -> bool

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

See CopyDirRecursive.

CopyDirRecursive Function

CopyDirRecursive(src: str, dst: str) -> bool

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

CopyFile Function

CopyFile(src: str, dst: str) -> bool

Copy a file on the local filesystem.

CosineInterpolate Function

CosineInterpolate(y0: float, y1: float, t: float) -> float

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

See LinearInterpolate, CubicInterpolate and HermiteInterpolate.

CreateBloomFromAssets Function

CreateBloomFromAssets(path: str, ratio: BackbufferRatio) -> Bloom

CreateBloomFromFile Function

CreateBloomFromFile(path: str, ratio: BackbufferRatio) -> Bloom

CreateCamera Function

CreateCamera(scene: Scene, mtx: Mat4, znear: float, zfar: float) -> Node
CreateCamera(scene: Scene, mtx: Mat4, znear: float, zfar: float, fov: float) -> Node

Create a new Node with a Transform and Camera components.

CreateCapsuleModel Function

CreateCapsuleModel(decl: VertexLayout, radius: float, height: float, subdiv_x: int, subdiv_y: int) -> Model

CreateConeModel Function

CreateConeModel(decl: VertexLayout, radius: float, height: float, subdiv_x: int) -> Model

CreateCubeModel Function

CreateCubeModel(decl: VertexLayout, x: float, y: float, z: float) -> Model

CreateCylinderModel Function

CreateCylinderModel(decl: VertexLayout, radius: float, height: float, subdiv_x: int) -> Model

CreateForwardPipeline Function

CreateForwardPipeline() -> ForwardPipeline
CreateForwardPipeline(shadow_map_resolution: int) -> ForwardPipeline
CreateForwardPipeline(shadow_map_resolution: int, spot_16bit_shadow_map: bool) -> ForwardPipeline

Create a forward pipeline and its resources.

See DestroyForwardPipeline.

CreateForwardPipelineAAAFromAssets Function

CreateForwardPipelineAAAFromAssets(path: str, config: ForwardPipelineAAAConfig) -> ForwardPipelineAAA
CreateForwardPipelineAAAFromAssets(path: str, config: ForwardPipelineAAAConfig, ssgi_ratio: BackbufferRatio) -> ForwardPipelineAAA
CreateForwardPipelineAAAFromAssets(path: str, config: ForwardPipelineAAAConfig, ssgi_ratio: BackbufferRatio, ssr_ratio: BackbufferRatio) -> ForwardPipelineAAA

CreateForwardPipelineAAAFromFile Function

CreateForwardPipelineAAAFromFile(path: str, config: ForwardPipelineAAAConfig) -> ForwardPipelineAAA
CreateForwardPipelineAAAFromFile(path: str, config: ForwardPipelineAAAConfig, ssgi_ratio: BackbufferRatio) -> ForwardPipelineAAA
CreateForwardPipelineAAAFromFile(path: str, config: ForwardPipelineAAAConfig, ssgi_ratio: BackbufferRatio, ssr_ratio: BackbufferRatio) -> ForwardPipelineAAA

CreateFrameBuffer Function

CreateFrameBuffer(color: Texture, depth: Texture, name: str) -> FrameBuffer
CreateFrameBuffer(color_format: TextureFormat, depth_format: TextureFormat, aa: int, name: str) -> FrameBuffer
CreateFrameBuffer(width: int, height: int, color_format: TextureFormat, depth_format: TextureFormat, aa: int, name: str) -> FrameBuffer

Create a framebuffer and its texture attachments.

See DestroyFrameBuffer.

CreateInstanceFromAssets Function

CreateInstanceFromAssets(scene: Scene, mtx: Mat4, name: str, resources: PipelineResources, pipeline: PipelineInfo) -> Node, bool
CreateInstanceFromAssets(scene: Scene, mtx: Mat4, name: str, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> Node, bool

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

CreateInstanceFromFile(scene: Scene, mtx: Mat4, name: str, resources: PipelineResources, pipeline: PipelineInfo) -> Node, bool
CreateInstanceFromFile(scene: Scene, mtx: Mat4, name: str, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> Node, bool

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

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

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

CreateMaterial Function

CreateMaterial(prg: PipelineProgramRef) -> Material
CreateMaterial(prg: PipelineProgramRef, value_name: str, value: Vec4) -> Material
CreateMaterial(prg: PipelineProgramRef, value_name_0: str, value_0: Vec4, value_name_1: str, value_1: Vec4) -> Material

Helper function to create a material.

See SetMaterialProgram, SetMaterialValue and SetMaterialTexture.

CreateMissingMaterialProgramValuesFromAssets Function

CreateMissingMaterialProgramValuesFromAssets(mat: Material, resources: PipelineResources) -> None

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

CreateMissingMaterialProgramValuesFromFile(mat: Material, resources: PipelineResources) -> None

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

CreateNavMeshQuery(mesh: NavMesh) -> NavMeshQuery

Create a navigation mesh query from a navigation mesh.

See FindNavigationPathTo to perform an actual query.

CreateObject Function

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

Create a Node with a Transform and Object components.

CreateOrthographicCamera Function

CreateOrthographicCamera(scene: Scene, mtx: Mat4, znear: float, zfar: float) -> Node
CreateOrthographicCamera(scene: Scene, mtx: Mat4, znear: float, zfar: float, size: float) -> Node

Create a Node with a Transform and a Camera component.

CreatePhysicCube Function

CreatePhysicCube(scene: Scene, size: Vec3, mtx: Mat4, model_ref: ModelRef, materials: MaterialList) -> Node
CreatePhysicCube(scene: Scene, size: Vec3, mtx: Mat4, model_ref: ModelRef, materials: MaterialList, mass: float) -> Node

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

CreatePhysicSphere Function

CreatePhysicSphere(scene: Scene, radius: float, mtx: Mat4, model_ref: ModelRef, materials: MaterialList) -> Node
CreatePhysicSphere(scene: Scene, radius: float, mtx: Mat4, model_ref: ModelRef, materials: MaterialList, mass: float) -> Node

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

CreatePlaneModel Function

CreatePlaneModel(decl: VertexLayout, width: float, length: float, subdiv_x: int, subdiv_z: int) -> Model

Create a plane render model.

CreatePointLight Function

CreatePointLight(scene: Scene, mtx: Mat4, radius: float) -> Node
CreatePointLight(scene: Scene, mtx: Mat4, radius: float, diffuse: Color) -> Node
CreatePointLight(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, specular: Color) -> Node
CreatePointLight(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, specular: Color, priority: float) -> Node
CreatePointLight(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, specular: Color, priority: float, shadow_type: LightShadowType) -> Node
CreatePointLight(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, specular: Color, priority: float, shadow_type: LightShadowType, shadow_bias: float) -> Node
CreatePointLight(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, diffuse_intensity: float) -> Node
CreatePointLight(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, diffuse_intensity: float, specular: Color) -> Node
CreatePointLight(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, diffuse_intensity: float, specular: Color, specular_intensity: float) -> Node
CreatePointLight(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, diffuse_intensity: float, specular: Color, specular_intensity: float, priority: float) -> Node
CreatePointLight(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, diffuse_intensity: float, specular: Color, specular_intensity: float, priority: float, shadow_type: LightShadowType) -> Node
CreatePointLight(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, diffuse_intensity: float, specular: Color, specular_intensity: float, priority: float, shadow_type: LightShadowType, shadow_bias: float) -> Node

Create a Node with a Transform and a Light component.

CreateSAOFromAssets Function

CreateSAOFromAssets(path: str, ratio: BackbufferRatio) -> SAO

CreateSAOFromFile Function

CreateSAOFromFile(path: str, ratio: BackbufferRatio) -> SAO

CreateSceneRootNode Function

CreateSceneRootNode(scene: Scene, name: str, mtx: Mat4) -> Node

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

CreateScript Function

CreateScript(scene: Scene) -> Node
CreateScript(scene: Scene, path: str) -> Node

Helper function to create a Node with a Script component.

CreateSphereModel Function

CreateSphereModel(decl: VertexLayout, radius: float, subdiv_x: int, subdiv_y: int) -> Model

CreateSpotLight Function

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

Create a Node with a Transform and a Light component.

CreateTexture Function

CreateTexture(width: int, height: int, name: str, flags: TextureFlags) -> Texture
CreateTexture(width: int, height: int, name: str, flags: TextureFlags, format: TextureFormat) -> Texture

Create an empty texture.

See CreateTextureFromPicture and UpdateTextureFromPicture.

CreateTextureFromPicture Function

CreateTextureFromPicture(pic: Picture, name: str, flags: TextureFlags) -> Texture
CreateTextureFromPicture(pic: Picture, name: str, flags: TextureFlags, format: TextureFormat) -> Texture

Create a texture from a picture.

See Picture, CreateTexture and UpdateTextureFromPicture.

Crop Function

Crop(rect: Rect, left: float, top: float, right: float, bottom: float) -> Rect
Crop(rect: IntRect, left: int, top: int, right: int, bottom: int) -> IntRect

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

See Grow.

Cross Function

Cross(a: Vec3, b: Vec3) -> Vec3

Return the cross product of two vectors.

CrossProductMat3 Function

CrossProductMat3(V: Vec3) -> Mat3

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

CubicInterpolate(y0: float, y1: float, y2: float, y3: float, t: float) -> float
CubicInterpolate(v0: Vec3, v1: Vec3, v2: Vec3, v3: Vec3, t: float) -> Vec3

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

CutFileExtension(path: str) -> str

Return a file path with its extension stripped.

See CutFilePath and CutFileName.

CutFileName Function

CutFileName(path: str) -> str

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

See CutFileExtension and CutFilePath.

CutFilePath Function

CutFilePath(path: str) -> str

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

See CutFileExtension and CutFileName.

Debug Function

Debug(msg: str) -> None
Debug(msg: str, details: str) -> None

DebugSceneExplorer Function

DebugSceneExplorer(scene: Scene, name: str) -> None

Decompose Function

Decompose(m: Mat4) -> Vec3, Vec3, Vec3
Decompose(m: Mat4, rotation_order: RotationOrder) -> Vec3, Vec3, Vec3

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

Deg Function

Deg(degrees: float) -> float

Convert an angle in degrees to the engine unit system.

See Coordinates and Units System.

Deg3 Function

Deg3(x: float, y: float, z: float) -> Vec3

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

See Coordinates and Units System.

DegreeToRadian Function

DegreeToRadian(degrees: float) -> float

Convert an angle in degrees to radians.

DestroyBloom Function

DestroyBloom(bloom: Bloom) -> None

Destroy a bloom post process object and all associated resources.

DestroyForwardPipeline Function

DestroyForwardPipeline(pipeline: ForwardPipeline) -> None

Destroy a forward pipeline object.

DestroyForwardPipelineAAA Function

DestroyForwardPipelineAAA(pipeline: ForwardPipelineAAA) -> None

DestroyFrameBuffer Function

DestroyFrameBuffer(frameBuffer: FrameBuffer) -> None

Destroy a frame buffer and its resources.

DestroyNavMesh Function

DestroyNavMesh(mesh: NavMesh) -> None

Destroy a navigation mesh object.

DestroyNavMeshQuery Function

DestroyNavMeshQuery(mesh: NavMeshQuery) -> None

Destroy a navigation mesh query object.

DestroyProgram Function

DestroyProgram(h: ProgramHandle) -> None

Destroy a shader program.

DestroySAO Function

DestroySAO(sao: SAO) -> None

Destroy an ambient occlusion post process object and its resources.

DestroyTexture Function

DestroyTexture(tex: Texture) -> None

Destroy a texture object.

DestroyWindow Function

DestroyWindow(window: Window) -> bool

Destroy a window object.

Det Function

Det(m: Mat3) -> float

Return the determinant of a matrix.

DisableCursor Function

DisableCursor() -> None

Dist Function

Dist(a: Vec2, b: Vec2) -> float
Dist(a: iVec2, b: iVec2) -> int
Dist(a: Quaternion, b: Quaternion) -> float
Dist(a: Vec3, b: Vec3) -> float

Return the Euclidean distance between two vectors.

Dist2 Function

Dist2(a: Vec2, b: Vec2) -> float
Dist2(a: iVec2, b: iVec2) -> int
Dist2(a: Vec3, b: Vec3) -> float

Return the squared Euclidean distance between two vectors.

DistanceToPlane Function

DistanceToPlane(plane: Vec4, p: Vec3) -> float

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

Dot(a: Vec2, b: Vec2) -> float
Dot(a: iVec2, b: iVec2) -> int
Dot(a: Vec3, b: Vec3) -> float

Return the dot product of two vectors.

DrawLines Function

DrawLines(view_id: int, vtx: Vertices, prg: ProgramHandle) -> None
DrawLines(view_id: int, vtx: Vertices, prg: ProgramHandle, render_state: RenderState) -> None
DrawLines(view_id: int, vtx: Vertices, prg: ProgramHandle, render_state: RenderState, depth: int) -> None
DrawLines(view_id: int, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList) -> None
DrawLines(view_id: int, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, render_state: RenderState) -> None
DrawLines(view_id: int, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, render_state: RenderState, depth: int) -> None
DrawLines(view_id: int, idx: UInt16List, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList) -> None
DrawLines(view_id: int, idx: UInt16List, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, render_state: RenderState) -> None
DrawLines(view_id: int, idx: UInt16List, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, render_state: RenderState, depth: int) -> None

Draw a list of lines to the specified view.

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

DrawModel Function

DrawModel(view_id: int, mdl: Model, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, matrix: Mat4) -> None
DrawModel(view_id: int, mdl: Model, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, matrix: Mat4, render_state: RenderState) -> None
DrawModel(view_id: int, mdl: Model, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, matrix: Mat4, render_state: RenderState, depth: int) -> None
DrawModel(view_id: int, mdl: Model, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, matrices: Mat4List) -> None
DrawModel(view_id: int, mdl: Model, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, matrices: Mat4List, render_state: RenderState) -> None
DrawModel(view_id: int, mdl: Model, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, matrices: Mat4List, render_state: RenderState, depth: int) -> None

Draw a model to the specified view.

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

DrawNavMesh Function

DrawNavMesh(mesh: NavMesh, view_id: int, vtx_decl: VertexLayout, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState) -> None

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

DrawSprites(view_id: int, inv_view_R: Mat3, vtx_layout: VertexLayout, pos: Vec3List, size: Vec2, prg: ProgramHandle) -> None
DrawSprites(view_id: int, inv_view_R: Mat3, vtx_layout: VertexLayout, pos: Vec3List, size: Vec2, prg: ProgramHandle, state: RenderState) -> None
DrawSprites(view_id: int, inv_view_R: Mat3, vtx_layout: VertexLayout, pos: Vec3List, size: Vec2, prg: ProgramHandle, state: RenderState, depth: int) -> None
DrawSprites(view_id: int, inv_view_R: Mat3, vtx_layout: VertexLayout, pos: Vec3List, size: Vec2, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList) -> None
DrawSprites(view_id: int, inv_view_R: Mat3, vtx_layout: VertexLayout, pos: Vec3List, size: Vec2, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState) -> None
DrawSprites(view_id: int, inv_view_R: Mat3, vtx_layout: VertexLayout, pos: Vec3List, size: Vec2, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState, depth: int) -> None

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

DrawText(view_id: int, font: Font, text: str, prg: ProgramHandle, page_uniform: str, page_stage: int, mtx: Mat4) -> None
DrawText(view_id: int, font: Font, text: str, prg: ProgramHandle, page_uniform: str, page_stage: int, mtx: Mat4, pos: Vec3) -> None
DrawText(view_id: int, font: Font, text: str, prg: ProgramHandle, page_uniform: str, page_stage: int, mtx: Mat4, pos: Vec3, halign: DrawTextHAlign, valign: DrawTextVAlign) -> None
DrawText(view_id: int, font: Font, text: str, prg: ProgramHandle, page_uniform: str, page_stage: int, mtx: Mat4, pos: Vec3, halign: DrawTextHAlign, valign: DrawTextVAlign, values: UniformSetValueList, textures: UniformSetTextureList) -> None
DrawText(view_id: int, font: Font, text: str, prg: ProgramHandle, page_uniform: str, page_stage: int, mtx: Mat4, pos: Vec3, halign: DrawTextHAlign, valign: DrawTextVAlign, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState) -> None
DrawText(view_id: int, font: Font, text: str, prg: ProgramHandle, page_uniform: str, page_stage: int, mtx: Mat4, pos: Vec3, halign: DrawTextHAlign, valign: DrawTextVAlign, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState, depth: int) -> None

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

DrawTriangles Function

DrawTriangles(view_id: int, vtx: Vertices, prg: ProgramHandle) -> None
DrawTriangles(view_id: int, vtx: Vertices, prg: ProgramHandle, state: RenderState) -> None
DrawTriangles(view_id: int, vtx: Vertices, prg: ProgramHandle, state: RenderState, depth: int) -> None
DrawTriangles(view_id: int, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList) -> None
DrawTriangles(view_id: int, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState) -> None
DrawTriangles(view_id: int, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState, depth: int) -> None
DrawTriangles(view_id: int, idx: UInt16List, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList) -> None
DrawTriangles(view_id: int, idx: UInt16List, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState) -> None
DrawTriangles(view_id: int, idx: UInt16List, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState, depth: int) -> None

Draw a list of triangles to the specified view.

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

DuplicateNodeAndChildrenFromAssets Function

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

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

See Resources & Assets.

DuplicateNodeAndChildrenFromFile Function

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

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

See Resources & Assets.

DuplicateNodeFromAssets Function

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

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

See Resources & Assets.

DuplicateNodeFromFile Function

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

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

See Resources & Assets.

DuplicateNodesAndChildrenFromAssets Function

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

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

See Resources & Assets.

DuplicateNodesAndChildrenFromFile Function

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

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

See Resources & Assets.

DuplicateNodesFromAssets Function

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

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

DuplicateNodesFromFile Function

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

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

See Resources & Assets.

EndProfilerFrame Function

EndProfilerFrame() -> ProfilerFrame

End a profiler frame and return it.

See PrintProfilerFrame to print a profiler frame to the console.

EndProfilerSection Function

EndProfilerSection(section_idx: int) -> None

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

Error Function

Error(msg: str) -> None
Error(msg: str, details: str) -> None

Exists Function

Exists(path: str) -> bool

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

ExtractZoomFactorFromProjectionMatrix Function

ExtractZoomFactorFromProjectionMatrix(m: Mat44, aspect_ratio: Vec2) -> float

Extract zoom factor from a projection matrix.

See ZoomFactorToFov.

ExtractZRangeFromOrthographicProjectionMatrix Function

ExtractZRangeFromOrthographicProjectionMatrix(m: Mat44) -> float, float

ExtractZRangeFromPerspectiveProjectionMatrix Function

ExtractZRangeFromPerspectiveProjectionMatrix(m: Mat44) -> float, float

ExtractZRangeFromProjectionMatrix Function

ExtractZRangeFromProjectionMatrix(m: Mat44) -> float, float

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

FaceForward Function

FaceForward(v: Vec3, d: Vec3) -> Vec3

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

FactorizePath(path: str) -> str

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

FileToString Function

FileToString(path: str) -> str

Return the content of a local filesystem as a string.

FindNavigationPathTo Function

FindNavigationPathTo(query: NavMeshQuery, from: Vec3, to: Vec3) -> Vec3List

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

See CreateNavMeshQuery.

FitsInside Function

FitsInside(a: Rect, b: Rect) -> bool
FitsInside(a: IntRect, b: IntRect) -> bool

Return wether a fits in b.

Floor Function

Floor(v: Vec3) -> Vec3

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

FovToZoomFactor Function

FovToZoomFactor(fov: float) -> float

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

FpsController Function

FpsController(key_up: bool, key_down: bool, key_left: bool, key_right: bool, btn: bool, dx: float, dy: float, pos: Vec3, rot: Vec3, speed: float, dt_t: int) -> None
FpsController(keyboard: Keyboard, mouse: Mouse, pos: Vec3, rot: Vec3, speed: float, dt: int) -> None

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

Frame() -> int

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

FRand() -> float
FRand(range: float) -> float

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

FromHLS(color: Color) -> Color

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

FRRand Function

FRRand() -> float
FRRand(range_start: float) -> float
FRRand(range_start: float, range_end: float) -> float

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

GaussianBlurIsoSurface Function

GaussianBlurIsoSurface(surface: IsoSurface, width: int, height: int, depth: int) -> IsoSurface

Apply a Gaussian blur to an iso-surface.

GetArea Function

GetArea(minmax: MinMax) -> float

Return the area of the volume.

GetCenter Function

GetCenter(minmax: MinMax) -> Vec3

Return the center position of the volume.

GetClock Function

GetClock() -> int

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

GetClockDt() -> int

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

GetColorTexture Function

GetColorTexture(frameBuffer: FrameBuffer) -> Texture

Retrieves color texture attachment.

GetColumn Function

GetColumn(m: Mat3, n: int) -> Vec3
GetColumn(m: Mat4, n: int) -> Vec3
GetColumn(m: Mat44, idx: int) -> Vec4

Returns the nth column.

GetCurrentWorkingDirectory Function

GetCurrentWorkingDirectory() -> str

Return the system current working directory.

GetDepthTexture Function

GetDepthTexture(frameBuffer: FrameBuffer) -> Texture

Retrieves depth texture attachment.

GetFileExtension Function

GetFileExtension(path: str) -> str

Return the extension part of a file path.

GetFileName Function

GetFileName(path: str) -> str

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

GetFilePath Function

GetFilePath(path: str) -> str

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

GetForwardPipelineInfo Function

GetForwardPipelineInfo() -> PipelineInfo

Return the pipeline info object for the forward pipeline.

GetGamepadNames Function

GetGamepadNames() -> StringList

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

See ReadGamepad.

GetHandJointAngularVelocity Function

GetHandJointAngularVelocity(hand: HandsSide, handJoint: XrHandJoint) -> Vec3

GetHandJointLinearVelocity Function

GetHandJointLinearVelocity(hand: HandsSide, handJoint: XrHandJoint) -> Vec3

GetHandJointPose Function

GetHandJointPose(hand: HandsSide, handJoint: XrHandJoint) -> Mat4

GetHandJointRadius Function

GetHandJointRadius(hand: HandsSide, handJoint: XrHandJoint) -> float

GetHeight Function

GetHeight(rect: Rect) -> float
GetHeight(rect: IntRect) -> int

Return the height of a rectangle.

GetJoystickDeviceNames Function

GetJoystickDeviceNames() -> StringList

GetJoystickNames Function

GetJoystickNames() -> StringList

GetJsonBool Function

GetJsonBool(js: JSON, key: str) -> bool, bool

Return the value of a boolean JSON key.

GetJsonFloat Function

GetJsonFloat(js: JSON, key: str) -> bool, float

Return the value of a float JSON key.

GetJsonInt Function

GetJsonInt(js: JSON, key: str) -> bool, int

Return the value of an integer JSON key.

GetJsonString Function

GetJsonString(js: JSON, key: str) -> bool, str

Return the value of a string JSON key.

GetKeyboardNames Function

GetKeyboardNames() -> StringList

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

See ReadKeyboard.

GetKeyName Function

GetKeyName(key: Key) -> str
GetKeyName(key: Key, name: str) -> str

Return the name for a keyboard key.

GetMaterialAlphaCut Function

GetMaterialAlphaCut(mat: Material) -> bool

GetMaterialAmbientUsesUV1 Function

GetMaterialAmbientUsesUV1(mat: Material) -> bool

GetMaterialBlendMode Function

GetMaterialBlendMode(mat: Material) -> BlendMode

Return a material blending mode.

GetMaterialDepthTest Function

GetMaterialDepthTest(mat: Material) -> DepthTest

Return a material depth test function.

GetMaterialDiffuseUsesUV1 Function

GetMaterialDiffuseUsesUV1(mat: Material) -> bool

GetMaterialFaceCulling Function

GetMaterialFaceCulling(mat: Material) -> FaceCulling

Return a material culling mode.

GetMaterialNormalMapInWorldSpace Function

GetMaterialNormalMapInWorldSpace(mat: Material) -> bool

GetMaterialSkinning Function

GetMaterialSkinning(mat: Material) -> bool

GetMaterialSpecularUsesUV1 Function

GetMaterialSpecularUsesUV1(mat: Material) -> bool

GetMaterialTexture Function

GetMaterialTexture(mat: Material, name: str) -> TextureRef

Return the texture reference assigned to a material named uniform.

GetMaterialTextures Function

GetMaterialTextures(mat: Material) -> StringList

Return the list of names of a material texture uniforms.

GetMaterialValues Function

GetMaterialValues(mat: Material) -> StringList

Return the list of names of a material value uniforms.

GetMaterialWriteRGBA Function

GetMaterialWriteRGBA(mat: Material) -> bool, bool, bool, bool

Return the material color mask.

GetMaterialWriteZ Function

GetMaterialWriteZ(mat: Material) -> bool

Return the material depth write mask.

GetMonitorModes Function

GetMonitorModes(monitor: Monitor) -> bool, MonitorModeList

Return the list of supported monitor modes.

GetMonitorName Function

GetMonitorName(monitor: Monitor) -> str

Return the monitor name.

GetMonitorRect Function

GetMonitorRect(monitor: Monitor) -> IntRect

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

GetMonitors() -> MonitorList

Return a list of monitors connected to the system.

GetMonitorSizeMM Function

GetMonitorSizeMM(monitor: Monitor) -> iVec2

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

GetMouseNames Function

GetMouseNames() -> StringList

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

See ReadKeyboard.

GetNodePairContacts Function

GetNodePairContacts(first: Node, second: Node, node_pair_contacts: NodePairContacts) -> ContactList

GetNodesInContact Function

GetNodesInContact(scene: Scene, with: Node, node_pair_contacts: NodePairContacts) -> NodeList

GetR Function

GetR(m: Mat4) -> Vec3
GetR(m: Mat4, rotation_order: RotationOrder) -> Vec3

GetRMatrix Function

GetRMatrix(m: Mat4) -> Mat3

GetRotation Function

GetRotation(m: Mat4) -> Vec3
GetRotation(m: Mat4, rotation_order: RotationOrder) -> Vec3

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

GetRotationMatrix Function

GetRotationMatrix(m: Mat4) -> Mat3

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

GetRow Function

GetRow(m: Mat3, n: int) -> Vec3
GetRow(m: Mat4, n: int) -> Vec4
GetRow(m: Mat44, idx: int) -> Vec4

Returns the nth row of a matrix.

GetS Function

GetS(m: Mat4) -> Vec3

GetScale Function

GetScale(m: Mat3) -> Vec3
GetScale(m: Mat4) -> Vec3

Return the scale component of a matrix a scale vector.

GetSceneForwardPipelineFog Function

GetSceneForwardPipelineFog(scene: Scene) -> ForwardPipelineFog

GetSceneForwardPipelineLights Function

GetSceneForwardPipelineLights(scene: Scene) -> ForwardPipelineLightList

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

GetSceneForwardPipelinePassViewId Function

GetSceneForwardPipelinePassViewId(views: SceneForwardPipelinePassViewId, pass: SceneForwardPipelinePass) -> int

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

GetScenePhysicsBackendName Function

GetScenePhysicsBackendName() -> str

GetSize Function

GetSize(file: File) -> int
GetSize(rect: Rect) -> Vec2
GetSize(rect: IntRect) -> iVec2

Return the size in bytes of a local file.

GetSourceDuration Function

GetSourceDuration(source: SourceRef) -> int

Return the duration of an audio source.

GetSourceState Function

GetSourceState(source: SourceRef) -> SourceState

Return the state of an audio source.

GetSourceTimecode Function

GetSourceTimecode(source: SourceRef) -> int

Return the current timecode of a playing audio source.

GetT Function

GetT(m: Mat4) -> Vec3

GetTextures Function

GetTextures(framebuffer: FrameBuffer) -> Texture, Texture

Returns color and depth texture attachments.

GetTranslation Function

GetTranslation(m: Mat3) -> Vec3
GetTranslation(m: Mat4) -> Vec3

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

GetUserFolder Function

GetUserFolder() -> str

Return the system user folder for the current user.

GetVRControllerNames Function

GetVRControllerNames() -> StringList

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

See ReadVRController.

GetVRGenericTrackerNames Function

GetVRGenericTrackerNames() -> StringList

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

GetWidth Function

GetWidth(rect: Rect) -> float
GetWidth(rect: IntRect) -> int

Return the width of a rectangle.

GetWindowClientSize Function

GetWindowClientSize(window: Window) -> bool, int, int

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

GetWindowContentScale Function

GetWindowContentScale(window: Window) -> Vec2

GetWindowHandle Function

GetWindowHandle(window: Window) -> VoidPointer

Return the system native window handle.

GetWindowInFocus Function

GetWindowInFocus() -> Window

Return the system window with input focus.

GetWindowPos Function

GetWindowPos(window: Window) -> iVec2

Return a window position on screen.

GetWindowTitle Function

GetWindowTitle(window: Window) -> bool, str

Return a window title.

GetX Function

GetX(m: Mat3) -> Vec3
GetX(m: Mat4) -> Vec3
GetX(rect: Rect) -> float
GetX(rect: IntRect) -> int

Return the scaled X axis of a transformation matrix.

GetY Function

GetY(m: Mat3) -> Vec3
GetY(m: Mat4) -> Vec3
GetY(rect: Rect) -> float
GetY(rect: IntRect) -> int

Return the scaled Y axis of a transformation matrix.

GetZ Function

GetZ(m: Mat3) -> Vec3
GetZ(m: Mat4) -> Vec3

Return the scaled Z axis of a transformation matrix.

Grow Function

Grow(rect: Rect, border: float) -> Rect
Grow(rect: IntRect, border: int) -> IntRect

Grow a rectangle by the specified amount of units.

See Crop.

HasFileExtension Function

HasFileExtension(path: str) -> bool

Test the extension of a file path.

HermiteInterpolate Function

HermiteInterpolate(y0: float, y1: float, y2: float, y3: float, t: float, tension: float, bias: float) -> float

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

HideCursor() -> None

Hide the system mouse cursor.

See ShowCursor.

ImGuiAlignTextToFramePadding Function

ImGuiAlignTextToFramePadding() -> None

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

ImGuiBegin Function

ImGuiBegin(name: str) -> bool
ImGuiBegin(name: str, open: bool, flags: ImGuiWindowFlags) -> bool, bool

Start a new window.

ImGuiBeginChild Function

ImGuiBeginChild(id: str) -> bool
ImGuiBeginChild(id: str, size: Vec2) -> bool
ImGuiBeginChild(id: str, size: Vec2, border: bool) -> bool
ImGuiBeginChild(id: str, size: Vec2, border: bool, flags: ImGuiWindowFlags) -> bool

Begin a scrolling region.

ImGuiBeginCombo Function

ImGuiBeginCombo(label: str, preview_value: str) -> bool
ImGuiBeginCombo(label: str, preview_value: str, flags: ImGuiComboFlags) -> bool

Begin a ImGui Combo Box.

ImGuiBeginFrame Function

ImGuiBeginFrame(width: int, height: int, dt_clock: int, mouse: MouseState, keyboard: KeyboardState) -> None
ImGuiBeginFrame(ctx: DearImguiContext, width: int, height: int, dt_clock: int, mouse: MouseState, keyboard: KeyboardState) -> None

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

ImGuiBeginGroup() -> None

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

ImGuiBeginMainMenuBar() -> bool

Create and append to a full screen menu-bar.

Note: Only call ImGuiEndMainMenuBar if this returns true.

ImGuiBeginMenu Function

ImGuiBeginMenu(label: str) -> bool
ImGuiBeginMenu(label: str, enabled: bool) -> bool

Create a sub-menu entry.

Note: Only call ImGuiEndMenu if this returns true.

ImGuiBeginMenuBar Function

ImGuiBeginMenuBar() -> bool

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

ImGuiBeginPopup(id: str) -> bool

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

Note: Only call ImGuiEndPopup if this returns true.

ImGuiBeginPopupContextItem Function

ImGuiBeginPopupContextItem(id: str) -> bool
ImGuiBeginPopupContextItem(id: str, mouse_button: int) -> bool

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

ImGuiBeginPopupContextVoid Function

ImGuiBeginPopupContextVoid() -> bool
ImGuiBeginPopupContextVoid(id: str) -> bool
ImGuiBeginPopupContextVoid(id: str, mouse_button: int) -> bool

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

ImGuiBeginPopupContextWindow Function

ImGuiBeginPopupContextWindow() -> bool
ImGuiBeginPopupContextWindow(id: str) -> bool
ImGuiBeginPopupContextWindow(id: str, flags: ImGuiPopupFlags) -> bool

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

ImGuiBeginPopupModal Function

ImGuiBeginPopupModal(name: str) -> bool
ImGuiBeginPopupModal(name: str, open: bool) -> bool
ImGuiBeginPopupModal(name: str, open: bool, flags: ImGuiWindowFlags) -> bool

Begin an ImGui modal dialog.

ImGuiBeginTooltip Function

ImGuiBeginTooltip() -> None

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

ImGuiBullet Function

ImGuiBullet() -> None

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

ImGuiBulletText Function

ImGuiBulletText(label: str) -> None

Draw a bullet followed by a static text.

ImGuiButton Function

ImGuiButton(label: str) -> bool
ImGuiButton(label: str, size: Vec2) -> bool

Button widget returning True if the button was pressed.

ImGuiCalcItemWidth Function

ImGuiCalcItemWidth() -> float

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

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

ImGuiCalcTextSize Function

ImGuiCalcTextSize(text: str) -> Vec2
ImGuiCalcTextSize(text: str, hide_text_after_double_dash: bool) -> Vec2
ImGuiCalcTextSize(text: str, hide_text_after_double_dash: bool, wrap_width: float) -> Vec2

Compute the bounding rectangle for the provided text.

ImGuiCaptureKeyboardFromApp Function

ImGuiCaptureKeyboardFromApp(capture: bool) -> None

Force capture keyboard when your widget is being hovered.

ImGuiCaptureMouseFromApp Function

ImGuiCaptureMouseFromApp(capture: bool) -> None

Force capture mouse when your widget is being hovered.

ImGuiCheckbox Function

ImGuiCheckbox(label: str, value: bool) -> bool, bool

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

ImGuiClearInputBuffer() -> None

Force a reset of the ImGui input buffer.

ImGuiCloseCurrentPopup Function

ImGuiCloseCurrentPopup() -> None

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

ImGuiCollapsingHeader Function

ImGuiCollapsingHeader(label: str) -> bool
ImGuiCollapsingHeader(label: str, flags: ImGuiTreeNodeFlags) -> bool
ImGuiCollapsingHeader(label: str, p_open: bool) -> bool, bool
ImGuiCollapsingHeader(label: str, p_open: bool, flags: ImGuiTreeNodeFlags) -> bool, bool

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

ImGuiColorButton Function

ImGuiColorButton(id: str, color: Color) -> bool
ImGuiColorButton(id: str, color: Color, flags: ImGuiColorEditFlags) -> bool
ImGuiColorButton(id: str, color: Color, flags: ImGuiColorEditFlags, size: Vec2) -> bool

Color button widget, display a small colored rectangle.

ImGuiColorEdit Function

ImGuiColorEdit(label: str, color: Color) -> bool, Color
ImGuiColorEdit(label: str, color: Color, flags: ImGuiColorEditFlags) -> bool, Color

Color editor, returns the widget current color.

ImGuiColumns Function

ImGuiColumns() -> None
ImGuiColumns(count: int) -> None
ImGuiColumns(count: int, id: str) -> None
ImGuiColumns(count: int, id: str, with_border: bool) -> None

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

ImGuiCombo(label: str, current_item: int, items: StringList) -> bool, int
ImGuiCombo(label: str, current_item: int, items: StringList, height_in_items: int) -> bool, int

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

ImGuiDragFloat Function

ImGuiDragFloat(label: str, v: float) -> bool, float
ImGuiDragFloat(label: str, v: float, v_speed: float) -> bool, float
ImGuiDragFloat(label: str, v: float, v_speed: float, v_min: float, v_max: float) -> bool, float

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

ImGuiDragIntVec2 Function

ImGuiDragIntVec2(label: str, v: iVec2) -> bool, iVec2
ImGuiDragIntVec2(label: str, v: iVec2, v_speed: float) -> bool, iVec2
ImGuiDragIntVec2(label: str, v: iVec2, v_speed: float, v_min: int, v_max: int) -> bool, iVec2

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

ImGuiDragVec2 Function

ImGuiDragVec2(label: str, v: Vec2) -> bool, Vec2
ImGuiDragVec2(label: str, v: Vec2, v_speed: float) -> bool, Vec2
ImGuiDragVec2(label: str, v: Vec2, v_speed: float, v_min: float, v_max: float) -> bool, Vec2

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

ImGuiDragVec3 Function

ImGuiDragVec3(label: str, v: Vec3) -> bool, Vec3
ImGuiDragVec3(label: str, v: Vec3, v_speed: float) -> bool, Vec3
ImGuiDragVec3(label: str, v: Vec3, v_speed: float, v_min: float, v_max: float) -> bool, Vec3

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

ImGuiDragVec4 Function

ImGuiDragVec4(label: str, v: Vec4) -> bool, Vec4
ImGuiDragVec4(label: str, v: Vec4, v_speed: float) -> bool, Vec4
ImGuiDragVec4(label: str, v: Vec4, v_speed: float, v_min: float, v_max: float) -> bool, Vec4

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

ImGuiDummy Function

ImGuiDummy(size: Vec2) -> None

Add a dummy item of given size.

ImGuiEnd Function

ImGuiEnd() -> None

End the current window.

ImGuiEndChild Function

ImGuiEndChild() -> None

End a scrolling region.

ImGuiEndCombo Function

ImGuiEndCombo() -> None

End a combo widget.

ImGuiEndFrame Function

ImGuiEndFrame(ctx: DearImguiContext) -> None
ImGuiEndFrame(ctx: DearImguiContext, view_id: int) -> None
ImGuiEndFrame() -> None
ImGuiEndFrame(view_id: int) -> None

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

ImGuiEndGroup() -> None

End the current group.

ImGuiEndMainMenuBar Function

ImGuiEndMainMenuBar() -> None

End the main menu bar.

See ImGuiBeginMainMenuBar.

ImGuiEndMenu Function

ImGuiEndMenu() -> None

End the current sub-menu entry.

ImGuiEndMenuBar Function

ImGuiEndMenuBar() -> None

End the current menu bar.

ImGuiEndPopup Function

ImGuiEndPopup() -> None

End the current popup.

ImGuiEndTooltip Function

ImGuiEndTooltip() -> None

End the current tooltip window.

See ImGuiBeginTooltip.

ImGuiGetColorU32 Function

ImGuiGetColorU32(idx: ImGuiCol) -> int
ImGuiGetColorU32(idx: ImGuiCol, alpha_multiplier: float) -> int
ImGuiGetColorU32(color: Color) -> int

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

See ImGuiPushStyleColor.

ImGuiGetColumnIndex Function

ImGuiGetColumnIndex() -> int

Returns the index of the current column.

ImGuiGetColumnOffset Function

ImGuiGetColumnOffset() -> float
ImGuiGetColumnOffset(column_index: int) -> float

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

ImGuiGetColumnsCount Function

ImGuiGetColumnsCount() -> int

Return the number of columns in the current layout section.

See ImGuiColumns.

ImGuiGetColumnWidth Function

ImGuiGetColumnWidth() -> float
ImGuiGetColumnWidth(column_index: int) -> float

Returns the current column width in pixels.

ImGuiGetContentRegionAvail Function

ImGuiGetContentRegionAvail() -> Vec2

Get available space for content in the current layout.

ImGuiGetContentRegionAvailWidth Function

ImGuiGetContentRegionAvailWidth() -> float

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

See ImGuiGetContentRegionAvail.

ImGuiGetContentRegionMax Function

ImGuiGetContentRegionMax() -> Vec2

Return the available content space including window decorations and scrollbar.

ImGuiGetCursorPos Function

ImGuiGetCursorPos() -> Vec2

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

See ImGuiSetCursorPos and ImGuiSameLine.

ImGuiGetCursorPosX Function

ImGuiGetCursorPosX() -> float

Helper for ImGuiGetCursorPos.

ImGuiGetCursorPosY Function

ImGuiGetCursorPosY() -> float

Helper for ImGuiGetCursorPos.

ImGuiGetCursorScreenPos Function

ImGuiGetCursorScreenPos() -> Vec2

Return the current layout cursor position in screen space.

ImGuiGetCursorStartPos Function

ImGuiGetCursorStartPos() -> Vec2

Return the current layout "line" starting position.

See ImGuiSameLine.

ImGuiGetFont Function

ImGuiGetFont() -> ImFont

Return the current ImGui font.

ImGuiGetFontSize Function

ImGuiGetFontSize() -> float

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

ImGuiGetFontTexUvWhitePixel Function

ImGuiGetFontTexUvWhitePixel() -> Vec2

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

ImGuiGetFrameCount Function

ImGuiGetFrameCount() -> int

Return the ImGui frame counter.

See ImGuiBeginFrame and ImGuiEndFrame.

ImGuiGetFrameHeightWithSpacing Function

ImGuiGetFrameHeightWithSpacing() -> float

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

ImGuiGetID Function

ImGuiGetID(id: str) -> int

Return a unique ImGui ID.

ImGuiGetItemRectMax Function

ImGuiGetItemRectMax() -> Vec2

Get bounding rect maximum of last item in screen space.

ImGuiGetItemRectMin Function

ImGuiGetItemRectMin() -> Vec2

Get bounding rect minimum of last item in screen space.

ImGuiGetItemRectSize Function

ImGuiGetItemRectSize() -> Vec2

Get bounding rect size of last item in screen space.

ImGuiGetMouseDragDelta Function

ImGuiGetMouseDragDelta() -> Vec2
ImGuiGetMouseDragDelta(button: ImGuiMouseButton) -> Vec2
ImGuiGetMouseDragDelta(button: ImGuiMouseButton, lock_threshold: float) -> Vec2

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

ImGuiGetMousePos Function

ImGuiGetMousePos() -> Vec2

Return the mouse cursor coordinates in screen space.

ImGuiGetMousePosOnOpeningCurrentPopup Function

ImGuiGetMousePosOnOpeningCurrentPopup() -> Vec2

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

See ImGuiBeginPopup.

ImGuiGetScrollMaxX Function

ImGuiGetScrollMaxX() -> float

Get maximum scrolling amount on the horizontal axis.

ImGuiGetScrollMaxY Function

ImGuiGetScrollMaxY() -> float

Get maximum scrolling amount on the vertical axis.

ImGuiGetScrollX Function

ImGuiGetScrollX() -> float

Get scrolling amount on the horizontal axis.

ImGuiGetScrollY Function

ImGuiGetScrollY() -> float

Get scrolling amount on the vertical axis.

ImGuiGetTextLineHeight Function

ImGuiGetTextLineHeight() -> float

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

See ImGuiPushFont.

ImGuiGetTextLineHeightWithSpacing Function

ImGuiGetTextLineHeightWithSpacing() -> float

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

See ImGuiGetTextLineHeight.

ImGuiGetTime Function

ImGuiGetTime() -> float

Return the current ImGui time in seconds.

ImGuiGetTreeNodeToLabelSpacing Function

ImGuiGetTreeNodeToLabelSpacing() -> float

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

ImGuiGetWindowContentRegionMax() -> Vec2

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

ImGuiGetWindowContentRegionMin Function

ImGuiGetWindowContentRegionMin() -> Vec2

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

ImGuiGetWindowContentRegionWidth Function

ImGuiGetWindowContentRegionWidth() -> float

Return the width of the content region.

ImGuiGetWindowDrawList Function

ImGuiGetWindowDrawList() -> ImDrawList

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

ImGuiGetWindowHeight Function

ImGuiGetWindowHeight() -> float

Return the current window height.

ImGuiGetWindowPos Function

ImGuiGetWindowPos() -> Vec2

Return the current window position in screen space.

See ImGuiSetWindowPos.

ImGuiGetWindowSize Function

ImGuiGetWindowSize() -> Vec2

Return the current window size.

See ImGuiSetWindowSize.

ImGuiGetWindowWidth Function

ImGuiGetWindowWidth() -> float

Return the current window width.

ImGuiImage Function

ImGuiImage(tex: Texture, size: Vec2) -> None
ImGuiImage(tex: Texture, size: Vec2, uv0: Vec2) -> None
ImGuiImage(tex: Texture, size: Vec2, uv0: Vec2, uv1: Vec2) -> None
ImGuiImage(tex: Texture, size: Vec2, uv0: Vec2, uv1: Vec2, tint_col: Color) -> None
ImGuiImage(tex: Texture, size: Vec2, uv0: Vec2, uv1: Vec2, tint_col: Color, border_col: Color) -> None

Display a texture as an image widget.

See ImGuiImageButton.

ImGuiImageButton Function

ImGuiImageButton(tex: Texture, size: Vec2) -> bool
ImGuiImageButton(tex: Texture, size: Vec2, uv0: Vec2) -> bool
ImGuiImageButton(tex: Texture, size: Vec2, uv0: Vec2, uv1: Vec2) -> bool
ImGuiImageButton(tex: Texture, size: Vec2, uv0: Vec2, uv1: Vec2, frame_padding: int) -> bool
ImGuiImageButton(tex: Texture, size: Vec2, uv0: Vec2, uv1: Vec2, frame_padding: int, bg_col: Color) -> bool
ImGuiImageButton(tex: Texture, size: Vec2, uv0: Vec2, uv1: Vec2, frame_padding: int, bg_col: Color, tint_col: Color) -> bool

Declare an image button displaying the provided texture.

See ImGuiImage.

ImGuiIndent Function

ImGuiIndent() -> None
ImGuiIndent(width: float) -> None

Move content position toward the right.

ImGuiInit Function

ImGuiInit(font_size: float, imgui_program: ProgramHandle, imgui_image_program: ProgramHandle) -> None

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

See ImGuiInitContext.

ImGuiInitContext Function

ImGuiInitContext(font_size: float, imgui_program: ProgramHandle, imgui_image_program: ProgramHandle) -> DearImguiContext

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

See ImGuiInit.

ImGuiInputFloat Function

ImGuiInputFloat(label: str, v: float) -> bool, float
ImGuiInputFloat(label: str, v: float, step: float, step_fast: float) -> bool, float
ImGuiInputFloat(label: str, v: float, step: float, step_fast: float, decimal_precision: int) -> bool, float
ImGuiInputFloat(label: str, v: float, step: float, step_fast: float, decimal_precision: int, flags: ImGuiInputTextFlags) -> bool, float

Float field widget.

ImGuiInputInt Function

ImGuiInputInt(label: str, v: int) -> bool, int
ImGuiInputInt(label: str, v: int, step: int, step_fast: int) -> bool, int
ImGuiInputInt(label: str, v: int, step: int, step_fast: int, flags: ImGuiInputTextFlags) -> bool, int

Integer field widget.

ImGuiInputIntVec2 Function

ImGuiInputIntVec2(label: str, v: iVec2) -> bool, iVec2
ImGuiInputIntVec2(label: str, v: iVec2, flags: ImGuiInputTextFlags) -> bool, iVec2

ImGuiInputText Function

ImGuiInputText(label: str, text: str, max_size: int) -> bool, str
ImGuiInputText(label: str, text: str, max_size: int, flags: ImGuiInputTextFlags) -> bool, str

Text input widget, returns the current widget buffer content.

ImGuiInputVec2 Function

ImGuiInputVec2(label: str, v: Vec2) -> bool, Vec2
ImGuiInputVec2(label: str, v: Vec2, decimal_precision: int) -> bool, Vec2
ImGuiInputVec2(label: str, v: Vec2, decimal_precision: int, flags: ImGuiInputTextFlags) -> bool, Vec2

Vec2 field widget.

ImGuiInputVec3 Function

ImGuiInputVec3(label: str, v: Vec3) -> bool, Vec3
ImGuiInputVec3(label: str, v: Vec3, decimal_precision: int) -> bool, Vec3
ImGuiInputVec3(label: str, v: Vec3, decimal_precision: int, flags: ImGuiInputTextFlags) -> bool, Vec3

Vec3 field widget.

ImGuiInputVec4 Function

ImGuiInputVec4(label: str, v: Vec4) -> bool, Vec4
ImGuiInputVec4(label: str, v: Vec4, decimal_precision: int) -> bool, Vec4
ImGuiInputVec4(label: str, v: Vec4, decimal_precision: int, flags: ImGuiInputTextFlags) -> bool, Vec4

Vec4 field widget.

ImGuiInvisibleButton Function

ImGuiInvisibleButton(text: str, size: Vec2) -> bool

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

ImGuiIsAnyItemActive Function

ImGuiIsAnyItemActive() -> bool

Return true if any item is active, false otherwise.

ImGuiIsAnyItemHovered Function

ImGuiIsAnyItemHovered() -> bool

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

ImGuiIsItemActive Function

ImGuiIsItemActive() -> bool

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

ImGuiIsItemClicked() -> bool
ImGuiIsItemClicked(mouse_button: int) -> bool

Was the last item clicked.

ImGuiIsItemHovered Function

ImGuiIsItemHovered() -> bool
ImGuiIsItemHovered(flags: ImGuiHoveredFlags) -> bool

Was the last item hovered by mouse.

ImGuiIsItemVisible Function

ImGuiIsItemVisible() -> bool

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

ImGuiIsKeyDown Function

ImGuiIsKeyDown(key_index: int) -> bool

Was the specified key down during the last frame?

ImGuiIsKeyPressed Function

ImGuiIsKeyPressed(key_index: int) -> bool
ImGuiIsKeyPressed(key_index: int, repeat: bool) -> bool

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

ImGuiIsKeyReleased Function

ImGuiIsKeyReleased(key_index: int) -> bool

Was the specified key released during the last frame?

ImGuiIsMouseClicked Function

ImGuiIsMouseClicked(button: int) -> bool
ImGuiIsMouseClicked(button: int, repeat: bool) -> bool

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

ImGuiIsMouseDoubleClicked(button: int) -> bool

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

ImGuiIsMouseDown(button: int) -> bool

Was the specified mouse button down during the last frame?

ImGuiIsMouseDragging Function

ImGuiIsMouseDragging(button: ImGuiMouseButton) -> bool
ImGuiIsMouseDragging(button: ImGuiMouseButton, lock_threshold: float) -> bool

Is mouse dragging?

ImGuiIsMouseHoveringRect Function

ImGuiIsMouseHoveringRect(rect_min: Vec2, rect_max: Vec2) -> bool
ImGuiIsMouseHoveringRect(rect_min: Vec2, rect_max: Vec2, clip: bool) -> bool

Test whether the mouse cursor is hovering the specified rectangle.

ImGuiIsMouseReleased Function

ImGuiIsMouseReleased(button: int) -> bool

Was the specified mouse button released during the last frame?

ImGuiIsRectVisible Function

ImGuiIsRectVisible(size: Vec2) -> bool
ImGuiIsRectVisible(rect_min: Vec2, rect_max: Vec2) -> bool

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

ImGuiIsWindowCollapsed() -> bool

Is the current window collapsed.

ImGuiIsWindowFocused Function

ImGuiIsWindowFocused() -> bool
ImGuiIsWindowFocused(flags: ImGuiFocusedFlags) -> bool

Is the current window focused.

ImGuiIsWindowHovered Function

ImGuiIsWindowHovered() -> bool
ImGuiIsWindowHovered(flags: ImGuiHoveredFlags) -> bool

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

ImGuiLabelText Function

ImGuiLabelText(label: str, text: str) -> None

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

ImGuiListBox Function

ImGuiListBox(label: str, current_item: int, items: StringList) -> bool, int
ImGuiListBox(label: str, current_item: int, items: StringList, height_in_items: int) -> bool, int

List widget.

ImGuiMenuItem Function

ImGuiMenuItem(label: str) -> bool
ImGuiMenuItem(label: str, shortcut: str) -> bool
ImGuiMenuItem(label: str, shortcut: str, selected: bool) -> bool
ImGuiMenuItem(label: str, shortcut: str, selected: bool, enabled: bool) -> bool

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

ImGuiMouseDrawCursor Function

ImGuiMouseDrawCursor(draw_cursor: bool) -> None

Enable/disable the ImGui software mouse cursor.

ImGuiNewFrame Function

ImGuiNewFrame() -> None

ImGuiNewLine Function

ImGuiNewLine() -> None

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

ImGuiNextColumn Function

ImGuiNextColumn() -> None

Start the next column in multi-column layout.

See ImGuiColumns.

ImGuiOpenPopup Function

ImGuiOpenPopup(id: str) -> None

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

ImGuiPopAllowKeyboardFocus() -> None

Undo the last call to ImGuiPushAllowKeyboardFocus.

ImGuiPopButtonRepeat Function

ImGuiPopButtonRepeat() -> None

Undo the last call to ImGuiPushButtonRepeat.

ImGuiPopClipRect Function

ImGuiPopClipRect() -> None

Undo the last call to ImGuiPushClipRect.

ImGuiPopFont Function

ImGuiPopFont() -> None

Undo the last call to ImGuiPushFont.

ImGuiPopID Function

ImGuiPopID() -> None

Undo the last call to ImGuiPushID.

ImGuiPopItemWidth Function

ImGuiPopItemWidth() -> None

Undo the last call to ImGuiPushItemWidth.

ImGuiPopStyleColor Function

ImGuiPopStyleColor() -> None
ImGuiPopStyleColor(count: int) -> None

Undo the last call to ImGuiPushStyleColor.

ImGuiPopStyleVar Function

ImGuiPopStyleVar() -> None
ImGuiPopStyleVar(count: int) -> None

Undo the last call to ImGuiPushStyleVar.

ImGuiPopTextWrapPos Function

ImGuiPopTextWrapPos() -> None

Undo the last call to ImGuiPushTextWrapPos.

ImGuiProgressBar Function

ImGuiProgressBar(fraction: float) -> None
ImGuiProgressBar(fraction: float, size: Vec2) -> None
ImGuiProgressBar(fraction: float, size: Vec2, overlay: str) -> None

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

ImGuiPushAllowKeyboardFocus Function

ImGuiPushAllowKeyboardFocus(v: bool) -> None

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

ImGuiPushButtonRepeat Function

ImGuiPushButtonRepeat(repeat: bool) -> None

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

ImGuiPushClipRect(clip_rect_min: Vec2, clip_rect_max: Vec2, intersect_with_current_clip_rect: bool) -> None

Push a new clip rectangle onto the clipping stack.

ImGuiPushFont Function

ImGuiPushFont(font: ImFont) -> None

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

ImGuiPushID Function

ImGuiPushID(id: str) -> None
ImGuiPushID(id: int) -> None

Push a string into the ID stack.

ImGuiPushItemWidth Function

ImGuiPushItemWidth(item_width: float) -> None

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

ImGuiPushStyleColor(idx: ImGuiCol, color: Color) -> None

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

See ImGuiPopStyleColor.

ImGuiPushStyleVar Function

ImGuiPushStyleVar(idx: ImGuiStyleVar, value: float) -> None
ImGuiPushStyleVar(idx: ImGuiStyleVar, value: Vec2) -> None

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

See ImGuiPopStyleVar.

ImGuiPushTextWrapPos Function

ImGuiPushTextWrapPos() -> None
ImGuiPushTextWrapPos(wrap_pos_x: float) -> None

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

ImGuiRadioButton(label: str, active: bool) -> bool
ImGuiRadioButton(label: str, v: int, v_button: int) -> bool, int

Radio button widget, return the button state.

ImGuiRender Function

ImGuiRender() -> None

ImGuiResetMouseDragDelta Function

ImGuiResetMouseDragDelta() -> None
ImGuiResetMouseDragDelta(button: ImGuiMouseButton) -> None

ImGuiSameLine Function

ImGuiSameLine() -> None
ImGuiSameLine(pos_x: float) -> None
ImGuiSameLine(pos_x: float, spacing_w: float) -> None

Call between widgets or groups to layout them horizontally.

ImGuiSelectable Function

ImGuiSelectable(label: str) -> bool
ImGuiSelectable(label: str, selected: bool) -> bool
ImGuiSelectable(label: str, selected: bool, flags: ImGuiSelectableFlags) -> bool
ImGuiSelectable(label: str, selected: bool, flags: ImGuiSelectableFlags, size: Vec2) -> bool

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

ImGuiSeparator() -> None

Output an horizontal line to separate two distinct UI sections.

ImGuiSetColumnOffset Function

ImGuiSetColumnOffset(column_index: int, offset_x: float) -> None

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

ImGuiSetColumnWidth Function

ImGuiSetColumnWidth(column_index: int, width: float) -> None

Set the column width in pixels.

ImGuiSetCursorPos Function

ImGuiSetCursorPos(local_pos: Vec2) -> None

Set the current widget output cursor position in window space.

ImGuiSetCursorPosX Function

ImGuiSetCursorPosX(x: float) -> None

ImGuiSetCursorPosY Function

ImGuiSetCursorPosY(y: float) -> None

ImGuiSetCursorScreenPos Function

ImGuiSetCursorScreenPos(pos: Vec2) -> None

Set the widget cursor output position in screen space.

ImGuiSetItemAllowOverlap Function

ImGuiSetItemAllowOverlap() -> None

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

ImGuiSetItemDefaultFocus Function

ImGuiSetItemDefaultFocus() -> None

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

ImGuiSetKeyboardFocusHere Function

ImGuiSetKeyboardFocusHere() -> None
ImGuiSetKeyboardFocusHere(offset: int) -> None

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

ImGuiSetNextItemOpen(is_open: bool) -> None
ImGuiSetNextItemOpen(is_open: bool, condition: ImGuiCond) -> None

Set next item open state.

ImGuiSetNextWindowCollapsed Function

ImGuiSetNextWindowCollapsed(collapsed: bool, condition: ImGuiCond) -> None

Set next window collapsed state, call before ImGuiBegin.

ImGuiSetNextWindowContentSize Function

ImGuiSetNextWindowContentSize(size: Vec2) -> None

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

ImGuiSetNextWindowContentWidth Function

ImGuiSetNextWindowContentWidth(width: float) -> None

ImGuiSetNextWindowFocus Function

ImGuiSetNextWindowFocus() -> None

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

ImGuiSetNextWindowPos Function

ImGuiSetNextWindowPos(pos: Vec2) -> None
ImGuiSetNextWindowPos(pos: Vec2, condition: ImGuiCond) -> None

Set next window position, call before ImGuiBegin.

ImGuiSetNextWindowPosCenter Function

ImGuiSetNextWindowPosCenter() -> None
ImGuiSetNextWindowPosCenter(condition: ImGuiCond) -> None

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

ImGuiSetNextWindowSize Function

ImGuiSetNextWindowSize(size: Vec2) -> None
ImGuiSetNextWindowSize(size: Vec2, condition: ImGuiCond) -> None

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

ImGuiSetNextWindowSizeConstraints Function

ImGuiSetNextWindowSizeConstraints(size_min: Vec2, size_max: Vec2) -> None

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

ImGuiSetScrollFromPosY(pos_y: float) -> None
ImGuiSetScrollFromPosY(pos_y: float, center_y_ratio: float) -> None

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

ImGuiSetScrollHereY Function

ImGuiSetScrollHereY() -> None
ImGuiSetScrollHereY(center_y_ratio: float) -> None

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

ImGuiSetScrollX(scroll_x: float) -> None

Set scrolling amount between [0;ImGuiGetScrollMaxX].

ImGuiSetScrollY Function

ImGuiSetScrollY(scroll_y: float) -> None

Set scrolling amount between [0;ImGuiGetScrollMaxY].

ImGuiSetTooltip Function

ImGuiSetTooltip(text: str) -> None

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

ImGuiSetWindowCollapsed Function

ImGuiSetWindowCollapsed(name: str, collapsed: bool) -> None
ImGuiSetWindowCollapsed(name: str, collapsed: bool, condition: ImGuiCond) -> None

Set named window collapsed state, prefer using ImGuiSetNextWindowCollapsed.

ImGuiSetWindowFocus Function

ImGuiSetWindowFocus(name: str) -> None

Set named window to be focused/top-most.

ImGuiSetWindowFontScale Function

ImGuiSetWindowFontScale(scale: float) -> None

Per-window font scale.

ImGuiSetWindowPos Function

ImGuiSetWindowPos(name: str, pos: Vec2) -> None
ImGuiSetWindowPos(name: str, pos: Vec2, condition: ImGuiCond) -> None

Set named window position.

ImGuiSetWindowSize Function

ImGuiSetWindowSize(name: str, size: Vec2) -> None
ImGuiSetWindowSize(name: str, size: Vec2, condition: ImGuiCond) -> None

Set named window size.

ImGuiShutdown Function

ImGuiShutdown() -> None

Shutdown the global ImGui context.

ImGuiSliderFloat Function

ImGuiSliderFloat(label: str, v: float, v_min: float, v_max: float) -> bool, float
ImGuiSliderFloat(label: str, v: float, v_min: float, v_max: float, format: str) -> bool, float

Float slider widget.

ImGuiSliderInt Function

ImGuiSliderInt(label: str, v: int, v_min: int, v_max: int) -> bool, int
ImGuiSliderInt(label: str, v: int, v_min: int, v_max: int, format: str) -> bool, int

Integer slider widget.

ImGuiSliderIntVec2 Function

ImGuiSliderIntVec2(label: str, v: iVec2, v_min: int, v_max: int) -> bool, iVec2
ImGuiSliderIntVec2(label: str, v: iVec2, v_min: int, v_max: int, format: str) -> bool, iVec2

ImGuiSliderVec2 Function

ImGuiSliderVec2(label: str, v: Vec2, v_min: float, v_max: float) -> bool, Vec2
ImGuiSliderVec2(label: str, v: Vec2, v_min: float, v_max: float, format: str) -> bool, Vec2

Vec2 slider widget.

ImGuiSliderVec3 Function

ImGuiSliderVec3(label: str, v: Vec3, v_min: float, v_max: float) -> bool, Vec3
ImGuiSliderVec3(label: str, v: Vec3, v_min: float, v_max: float, format: str) -> bool, Vec3

Vec3 slider widget.

ImGuiSliderVec4 Function

ImGuiSliderVec4(label: str, v: Vec4, v_min: float, v_max: float) -> bool, Vec4
ImGuiSliderVec4(label: str, v: Vec4, v_min: float, v_max: float, format: str) -> bool, Vec4

Vec4 slider widget.

ImGuiSmallButton Function

ImGuiSmallButton(label: str) -> bool

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

ImGuiSpacing Function

ImGuiSpacing() -> None

Add spacing.

ImGuiText Function

ImGuiText(text: str) -> None

Static text.

ImGuiTextColored Function

ImGuiTextColored(color: Color, text: str) -> None

Colored static text.

ImGuiTextDisabled Function

ImGuiTextDisabled(text: str) -> None

Disabled static text.

ImGuiTextUnformatted Function

ImGuiTextUnformatted(text: str) -> None

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

ImGuiTextWrapped Function

ImGuiTextWrapped(text: str) -> None

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

ImGuiTreeNode(label: str) -> bool

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

ImGuiTreeNodeEx Function

ImGuiTreeNodeEx(label: str, flags: ImGuiTreeNodeFlags) -> bool

ImGuiTreePop Function

ImGuiTreePop() -> None

Pop the current tree node.

ImGuiTreePush Function

ImGuiTreePush(id: str) -> None

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

ImGuiUnindent Function

ImGuiUnindent() -> None
ImGuiUnindent(width: float) -> None

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

ImGuiWantCaptureMouse Function

ImGuiWantCaptureMouse() -> bool

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

Inch Function

Inch(inch: float) -> float

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

See Coordinates and Units System.

InputInit Function

InputInit() -> None

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

hg.InputInit()
hg.WindowSystemInit()

InputShutdown Function

InputShutdown() -> None

Shutdown the Input system.

Inside Function

Inside(rect: Rect, v: iVec2) -> bool
Inside(rect: Rect, v: Vec2) -> bool
Inside(rect: Rect, v: Vec3) -> bool
Inside(rect: Rect, v: Vec4) -> bool
Inside(rect: IntRect, v: iVec2) -> bool
Inside(rect: IntRect, v: Vec2) -> bool
Inside(rect: IntRect, v: Vec3) -> bool
Inside(rect: IntRect, v: Vec4) -> bool

Test if a value is inside a containing volume.

int_to_VoidPointer Function

int_to_VoidPointer(ptr: int) -> VoidPointer

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

Intersection(a: Rect, b: Rect) -> Rect
Intersection(a: IntRect, b: IntRect) -> IntRect

Return the intersection of two rectangles.

IntersectRay Function

IntersectRay(minmax: MinMax, origin: Vec3, direction: Vec3) -> bool, float, float

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

Intersects(a: Rect, b: Rect) -> bool
Intersects(a: IntRect, b: IntRect) -> bool

Return true if rect a intersects rect b.

Inverse Function

Inverse(q: Quaternion) -> Quaternion
Inverse(m: Mat3) -> bool, Mat3
Inverse(m: Mat4) -> bool, Mat4
Inverse(m: Mat44) -> Mat44, bool
Inverse(v: Vec3) -> Vec3

Return the inverse of a matrix, vector or quaternion.

InverseFast Function

InverseFast(m: Mat4) -> Mat4

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

IsAssetFile(name: str) -> bool

Test if an asset file exists in the assets system.

See Resources & Assets.

IsDir Function

IsDir(path: str) -> bool

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

IsEOF Function

IsEOF(file: File) -> bool

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

IsFile Function

IsFile(path: str) -> bool

Test if a file exists on the local filesystem.

IsFinite Function

IsFinite(v: float) -> bool

Test if a floating point value is finite.

IsHandJointActive Function

IsHandJointActive(hand: HandsSide) -> bool

IsMonitorConnected Function

IsMonitorConnected(monitor: Monitor) -> bool

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

IsoSurfaceSphere Function

IsoSurfaceSphere(surface: IsoSurface, width: int, height: int, depth: int, x: float, y: float, z: float, radius: float) -> None
IsoSurfaceSphere(surface: IsoSurface, width: int, height: int, depth: int, x: float, y: float, z: float, radius: float, value: float) -> None
IsoSurfaceSphere(surface: IsoSurface, width: int, height: int, depth: int, x: float, y: float, z: float, radius: float, value: float, exponent: float) -> None

Output a sphere to an iso-surface.

IsoSurfaceToModel Function

IsoSurfaceToModel(builder: ModelBuilder, surface: IsoSurface, width: int, height: int, depth: int) -> bool
IsoSurfaceToModel(builder: ModelBuilder, surface: IsoSurface, width: int, height: int, depth: int, material: int) -> bool
IsoSurfaceToModel(builder: ModelBuilder, surface: IsoSurface, width: int, height: int, depth: int, material: int, isolevel: float) -> bool
IsoSurfaceToModel(builder: ModelBuilder, surface: IsoSurface, width: int, height: int, depth: int, material: int, isolevel: float, scale_x: float, scale_y: float, scale_z: float) -> bool

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

IsPathAbsolute Function

IsPathAbsolute(path: str) -> bool

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

IsPrimaryMonitor Function

IsPrimaryMonitor(monitor: Monitor) -> bool

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

IsValid Function

IsValid(file: File) -> bool
IsValid(t: Texture) -> bool
IsValid(fb: FrameBuffer) -> bool
IsValid(pipeline: ForwardPipelineAAA) -> bool
IsValid(streamer: IAudioStreamer) -> bool
IsValid(streamer: IVideoStreamer) -> bool

Test if a resource if valid.

IsWindowOpen Function

IsWindowOpen(window: Window) -> bool

Return true if the window is open, false otherwise.

Km Function

Km(km: float) -> float

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

See Coordinates and Units System.

Len Function

Len(v: Vec2) -> float
Len(v: iVec2) -> int
Len(q: Quaternion) -> float
Len(v: Vec3) -> float

Return the length of the vector.

Len2 Function

Len2(v: Vec2) -> float
Len2(v: iVec2) -> int
Len2(q: Quaternion) -> float
Len2(v: Vec3) -> float

Return the length of the vector squared.

Lerp Function

Lerp(a: int, b: int, t: float) -> int
Lerp(a: float, b: float, t: float) -> float
Lerp(a: Vec3, b: Vec3, t: float) -> Vec3
Lerp(a: Vec4, b: Vec4, t: float) -> Vec4

LerpAsOrthonormalBase Function

LerpAsOrthonormalBase(from: Mat4, to: Mat4, k: float) -> Mat4
LerpAsOrthonormalBase(from: Mat4, to: Mat4, k: float, fast: bool) -> Mat4

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

LinearInterpolate Function

LinearInterpolate(y0: float, y1: float, t: float) -> float

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

See CosineInterpolate, CubicInterpolate and HermiteInterpolate.

ListDir Function

ListDir(path: str, type: DirEntryType) -> DirEntryList

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

See ListDirRecursive.

ListDirRecursive Function

ListDirRecursive(path: str, type: DirEntryType) -> DirEntryList

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

See ListDir.

LoadBMP Function

LoadBMP(pict: Picture, path: str) -> bool

Load a Picture in BMP file format.

LoadDataFromFile Function

LoadDataFromFile(path: str, data: Data) -> bool

LoadFontFromAssets Function

LoadFontFromAssets(name: str) -> Font
LoadFontFromAssets(name: str, size: float) -> Font
LoadFontFromAssets(name: str, size: float, resolution: int) -> Font
LoadFontFromAssets(name: str, size: float, resolution: int, padding: int) -> Font
LoadFontFromAssets(name: str, size: float, resolution: int, padding: int, glyphs: str) -> Font

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

See Resources & Assets.

LoadFontFromFile Function

LoadFontFromFile(path: str) -> Font
LoadFontFromFile(path: str, size: float) -> Font
LoadFontFromFile(path: str, size: float, resolution: int) -> Font
LoadFontFromFile(path: str, size: float, resolution: int, padding: int) -> Font
LoadFontFromFile(path: str, size: float, resolution: int, padding: int, glyphs: str) -> Font

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

See Resources & Assets.

LoadForwardPipelineAAAConfigFromAssets Function

LoadForwardPipelineAAAConfigFromAssets(path: str, config: ForwardPipelineAAAConfig) -> bool

LoadForwardPipelineAAAConfigFromFile Function

LoadForwardPipelineAAAConfigFromFile(path: str, config: ForwardPipelineAAAConfig) -> bool

LoadGIF Function

LoadGIF(pict: Picture, path: str) -> bool

Load a Picture in GIF file format.

LoadJPG Function

LoadJPG(pict: Picture, path: str) -> bool

Load a Picture in JPEG file format.

LoadJsonFromAssets Function

LoadJsonFromAssets(name: str) -> JSON

Load a JSON from the assets system.

See Resources & Assets.

LoadJsonFromFile Function

LoadJsonFromFile(path: str) -> JSON

Load a JSON from the local filesystem.

LoadLPCMSound Function

LoadLPCMSound(ptr: int, size: int, format: AudioFrameFormat) -> SoundRef

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

LoadModelFromAssets(name: str) -> Model

Load a render model from the assets system.

See DrawModel and Resources & Assets.

LoadModelFromFile Function

LoadModelFromFile(path: str) -> Model

Load a render model from the local filesystem.

LoadNavMeshFromAssets Function

LoadNavMeshFromAssets(name: str) -> NavMesh

Load a navigation mesh from the assets system.

See Resources & Assets.

LoadNavMeshFromFile Function

LoadNavMeshFromFile(path: str) -> NavMesh

Load a navigation mesh from the local filesystem.

LoadOGGSoundAsset Function

LoadOGGSoundAsset(name: str) -> SoundRef

LoadOGGSoundFile Function

LoadOGGSoundFile(path: str) -> SoundRef

LoadPicture Function

LoadPicture(pict: Picture, path: str) -> bool

Load a Picture content from the filesystem.

LoadPipelineProgramFromAssets Function

LoadPipelineProgramFromAssets(name: str, resources: PipelineResources, pipeline: PipelineInfo) -> PipelineProgram

Load a pipeline shader program from the assets system.

See Resources & Assets.

LoadPipelineProgramFromFile Function

LoadPipelineProgramFromFile(path: str, resources: PipelineResources, pipeline: PipelineInfo) -> PipelineProgram

Load a pipeline shader program from the local filesystem.

LoadPipelineProgramRefFromAssets Function

LoadPipelineProgramRefFromAssets(name: str, resources: PipelineResources, pipeline: PipelineInfo) -> PipelineProgramRef

LoadPipelineProgramRefFromFile Function

LoadPipelineProgramRefFromFile(path: str, resources: PipelineResources, pipeline: PipelineInfo) -> PipelineProgramRef

LoadPNG Function

LoadPNG(pict: Picture, path: str) -> bool

Load a Picture in PNG file format.

LoadProgramFromAssets Function

LoadProgramFromAssets(name: str) -> ProgramHandle
LoadProgramFromAssets(vertex_shader_name: str, fragment_shader_name: str) -> ProgramHandle

Load a shader program from the assets system.

See Resources & Assets.

LoadProgramFromFile Function

LoadProgramFromFile(path: str) -> ProgramHandle
LoadProgramFromFile(vertex_shader_path: str, fragment_shader_path: str) -> ProgramHandle

Load a shader program from the local filesystem.

LoadPSD Function

LoadPSD(pict: Picture, path: str) -> bool

Load a Picture in PSD file format.

LoadSceneBinaryFromAssets Function

LoadSceneBinaryFromAssets(name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo) -> bool
LoadSceneBinaryFromAssets(name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> bool

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

See Resources & Assets.

LoadSceneBinaryFromDataAndAssets Function

LoadSceneBinaryFromDataAndAssets(data: Data, name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo) -> bool
LoadSceneBinaryFromDataAndAssets(data: Data, name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> bool

LoadSceneBinaryFromDataAndFile Function

LoadSceneBinaryFromDataAndFile(data: Data, name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo) -> bool
LoadSceneBinaryFromDataAndFile(data: Data, name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> bool

LoadSceneBinaryFromFile Function

LoadSceneBinaryFromFile(path: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo) -> bool
LoadSceneBinaryFromFile(path: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> bool

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

LoadSceneFromAssets Function

LoadSceneFromAssets(name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo) -> bool
LoadSceneFromAssets(name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> bool

LoadSceneFromFile Function

LoadSceneFromFile(path: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo) -> bool
LoadSceneFromFile(path: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> bool

LoadSceneJsonFromAssets Function

LoadSceneJsonFromAssets(name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo) -> bool
LoadSceneJsonFromAssets(name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> bool

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

See Resources & Assets.

LoadSceneJsonFromFile Function

LoadSceneJsonFromFile(path: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo) -> bool
LoadSceneJsonFromFile(path: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> bool

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

LoadTextureFlagsFromAssets Function

LoadTextureFlagsFromAssets(name: str) -> TextureFlags

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

See Resources & Assets.

LoadTextureFlagsFromFile Function

LoadTextureFlagsFromFile(path: str) -> TextureFlags

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

LoadTextureFromAssets Function

LoadTextureFromAssets(path: str, flags: TextureFlags) -> Texture, TextureInfo
LoadTextureFromAssets(path: str, flags: int, resources: PipelineResources) -> TextureRef

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

LoadTextureFromFile(path: str, flags: TextureFlags) -> Texture, TextureInfo
LoadTextureFromFile(path: str, flags: int, resources: PipelineResources) -> TextureRef

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

LoadTGA(pict: Picture, path: str) -> bool

Load a Picture in TGA file format.

LoadWAVSoundAsset Function

LoadWAVSoundAsset(name: str) -> SoundRef

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

See Resources & Assets.

LoadWAVSoundFile Function

LoadWAVSoundFile(path: str) -> SoundRef

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

Log Function

Log(msg: str) -> None
Log(msg: str, details: str) -> None

MakeAudioStreamer Function

MakeAudioStreamer(module_path: str) -> IAudioStreamer

MakeForwardPipelineLinearLight Function

MakeForwardPipelineLinearLight(world: Mat4, diffuse: Color, specular: Color) -> ForwardPipelineLight
MakeForwardPipelineLinearLight(world: Mat4, diffuse: Color, specular: Color, pssm_split: Vec4) -> ForwardPipelineLight
MakeForwardPipelineLinearLight(world: Mat4, diffuse: Color, specular: Color, pssm_split: Vec4, priority: float) -> ForwardPipelineLight
MakeForwardPipelineLinearLight(world: Mat4, diffuse: Color, specular: Color, pssm_split: Vec4, priority: float, shadow_type: ForwardPipelineShadowType) -> ForwardPipelineLight
MakeForwardPipelineLinearLight(world: Mat4, diffuse: Color, specular: Color, pssm_split: Vec4, priority: float, shadow_type: ForwardPipelineShadowType, shadow_bias: float) -> ForwardPipelineLight

MakeForwardPipelinePointLight Function

MakeForwardPipelinePointLight(world: Mat4, diffuse: Color, specular: Color) -> ForwardPipelineLight
MakeForwardPipelinePointLight(world: Mat4, diffuse: Color, specular: Color, radius: float) -> ForwardPipelineLight
MakeForwardPipelinePointLight(world: Mat4, diffuse: Color, specular: Color, radius: float, priority: float) -> ForwardPipelineLight
MakeForwardPipelinePointLight(world: Mat4, diffuse: Color, specular: Color, radius: float, priority: float, shadow_type: ForwardPipelineShadowType) -> ForwardPipelineLight
MakeForwardPipelinePointLight(world: Mat4, diffuse: Color, specular: Color, radius: float, priority: float, shadow_type: ForwardPipelineShadowType, shadow_bias: float) -> ForwardPipelineLight

MakeForwardPipelineSpotLight Function

MakeForwardPipelineSpotLight(world: Mat4, diffuse: Color, specular: Color) -> ForwardPipelineLight
MakeForwardPipelineSpotLight(world: Mat4, diffuse: Color, specular: Color, radius: float) -> ForwardPipelineLight
MakeForwardPipelineSpotLight(world: Mat4, diffuse: Color, specular: Color, radius: float, inner_angle: float) -> ForwardPipelineLight
MakeForwardPipelineSpotLight(world: Mat4, diffuse: Color, specular: Color, radius: float, inner_angle: float, outer_angle: float) -> ForwardPipelineLight
MakeForwardPipelineSpotLight(world: Mat4, diffuse: Color, specular: Color, radius: float, inner_angle: float, outer_angle: float, priority: float) -> ForwardPipelineLight
MakeForwardPipelineSpotLight(world: Mat4, diffuse: Color, specular: Color, radius: float, inner_angle: float, outer_angle: float, priority: float, shadow_type: ForwardPipelineShadowType) -> ForwardPipelineLight
MakeForwardPipelineSpotLight(world: Mat4, diffuse: Color, specular: Color, radius: float, inner_angle: float, outer_angle: float, priority: float, shadow_type: ForwardPipelineShadowType, shadow_bias: float) -> ForwardPipelineLight

MakeFrustum Function

MakeFrustum(projection: Mat44) -> Frustum
MakeFrustum(projection: Mat44, mtx: Mat4) -> Frustum

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

MakePlane(p: Vec3, n: Vec3) -> Vec4
MakePlane(p: Vec3, n: Vec3, m: Mat4) -> Vec4

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

MakeRectFromWidthHeight(x: float, y: float, w: float, h: float) -> Rect
MakeRectFromWidthHeight(x: int, y: int, w: int, h: int) -> IntRect

Make a rectangle from width and height.

MakeUniformSetTexture Function

MakeUniformSetTexture(name: str, texture: Texture, stage: int) -> UniformSetTexture

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

MakeUniformSetValue(name: str, v: float) -> UniformSetValue
MakeUniformSetValue(name: str, v: Vec2) -> UniformSetValue
MakeUniformSetValue(name: str, v: Vec3) -> UniformSetValue
MakeUniformSetValue(name: str, v: Vec4) -> UniformSetValue
MakeUniformSetValue(name: str, v: Mat3) -> UniformSetValue
MakeUniformSetValue(name: str, v: Mat4) -> UniformSetValue
MakeUniformSetValue(name: str, v: Mat44) -> UniformSetValue

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

MakeVec3(v: Vec4) -> Vec3

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

MakeVertex Function

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

MakeVideoStreamer Function

MakeVideoStreamer(module_path: str) -> IVideoStreamer

Mat3LookAt Function

Mat3LookAt(front: Vec3) -> Mat3
Mat3LookAt(front: Vec3, up: Vec3) -> Mat3

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

Mat4LookAt Function

Mat4LookAt(position: Vec3, at: Vec3) -> Mat4
Mat4LookAt(position: Vec3, at: Vec3, scale: Vec3) -> Mat4

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

Mat4LookAtUp Function

Mat4LookAtUp(position: Vec3, at: Vec3, up: Vec3) -> Mat4
Mat4LookAtUp(position: Vec3, at: Vec3, up: Vec3, scale: Vec3) -> Mat4

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

Mat4LookToward Function

Mat4LookToward(position: Vec3, direction: Vec3) -> Mat4
Mat4LookToward(position: Vec3, direction: Vec3, scale: Vec3) -> Mat4

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

Mat4LookTowardUp Function

Mat4LookTowardUp(position: Vec3, direction: Vec3, up: Vec3) -> Mat4
Mat4LookTowardUp(position: Vec3, direction: Vec3, up: Vec3, scale: Vec3) -> Mat4

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

Max Function

Max(a: Vec2, b: Vec2) -> Vec2
Max(a: iVec2, b: iVec2) -> iVec2
Max(a: Vec3, b: Vec3) -> Vec3
Max(a: float, b: float) -> float
Max(a: int, b: int) -> int

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

Min Function

Min(a: Vec2, b: Vec2) -> Vec2
Min(a: iVec2, b: iVec2) -> iVec2
Min(a: Vec3, b: Vec3) -> Vec3
Min(a: float, b: float) -> float
Min(a: int, b: int) -> int

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

MinMaxFromPositionSize Function

MinMaxFromPositionSize(position: Vec3, size: Vec3) -> MinMax

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

MkDir Function

MkDir(path: str) -> bool
MkDir(path: str, permissions: int) -> bool

Create a new directory.

See MkTree.

MkTree Function

MkTree(path: str) -> bool
MkTree(path: str, permissions: int) -> bool

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

See MkDir.

Mm Function

Mm(mm: float) -> float

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

See Coordinates and Units System.

Ms Function

Ms(milliseconds: float) -> float

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

See Coordinates and Units System.

Mtr Function

Mtr(m: float) -> float

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

See Coordinates and Units System.

NewFullscreenWindow Function

NewFullscreenWindow(monitor: Monitor, mode_index: int) -> Window
NewFullscreenWindow(monitor: Monitor, mode_index: int, rotation: MonitorRotation) -> Window
NewFullscreenWindow(title: str, monitor: Monitor, mode_index: int) -> Window
NewFullscreenWindow(title: str, monitor: Monitor, mode_index: int, rotation: MonitorRotation) -> Window

Create a new fullscreen window.

NewIsoSurface Function

NewIsoSurface(width: int, height: int, depth: int) -> IsoSurface

Return a new iso-surface object.

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

NewWindow Function

NewWindow(width: int, height: int) -> Window
NewWindow(width: int, height: int, bpp: int) -> Window
NewWindow(width: int, height: int, bpp: int, visibility: WindowVisibility) -> Window
NewWindow(title: str, width: int, height: int) -> Window
NewWindow(title: str, width: int, height: int, bpp: int) -> Window
NewWindow(title: str, width: int, height: int, bpp: int, visibility: WindowVisibility) -> Window

Create a new window.

NewWindowFrom Function

NewWindowFrom(handle: VoidPointer) -> Window

Wrap a native window handle in a Window object.

Normalize Function

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

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

NormalizePath Function

NormalizePath(path: str) -> str

Normalize a path according to the following conventions:

  • Replace all whitespaces by underscores.

Offset Function

Offset(rect: Rect, x: float, y: float) -> Rect
Offset(rect: IntRect, x: int, y: int) -> IntRect

Offset a rectangle by the specified amount of units.

Open Function

Open(path: str) -> File

Open a file in binary mode.

See OpenText, OpenWrite, OpenWriteText

OpenFileDialog Function

OpenFileDialog(title: str, filters: FileFilterList, file: str) -> bool, str
OpenFileDialog(title: str, filters: FileFilterList, file: str, initial_dir: str) -> bool, str

Open a native OpenFile dialog.

OpenFolderDialog Function

OpenFolderDialog(title: str, folder_name: str) -> bool, str
OpenFolderDialog(title: str, folder_name: str, initial_dir: str) -> bool, str

Open a native OpenFolder dialog.

OpenTemp Function

OpenTemp(template_path: str) -> File

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

OpenText Function

OpenText(path: str) -> File

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

See Open, OpenWrite, OpenWriteText

OpenVRCreateEyeFrameBuffer Function

OpenVRCreateEyeFrameBuffer() -> OpenVREyeFrameBuffer
OpenVRCreateEyeFrameBuffer(aa: OpenVRAA) -> OpenVREyeFrameBuffer

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

OpenVRDestroyEyeFrameBuffer(eye_fb: OpenVREyeFrameBuffer) -> None

Destroy an eye framebuffer.

OpenVRGetColorTexture Function

OpenVRGetColorTexture(eye: OpenVREyeFrameBuffer) -> Texture

Return the color texture attached to an eye framebuffer.

OpenVRGetDepthTexture Function

OpenVRGetDepthTexture(eye: OpenVREyeFrameBuffer) -> Texture

Return the depth texture attached to an eye framebuffer.

OpenVRGetFrameBufferSize Function

OpenVRGetFrameBufferSize() -> iVec2

OpenVRGetState Function

OpenVRGetState(body: Mat4, znear: float, zfar: float) -> OpenVRState

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

OpenVRInit Function

OpenVRInit() -> bool

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

OpenVRIsHMDMounted Function

OpenVRIsHMDMounted() -> bool

OpenVRPostPresentHandoff Function

OpenVRPostPresentHandoff() -> None

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

OpenVRShutdown Function

OpenVRShutdown() -> None

Shutdown OpenVR.

OpenVRStateToViewState Function

OpenVRStateToViewState(state: OpenVRState) -> ViewState, ViewState

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

See OpenVRGetState.

OpenVRSubmitFrame Function

OpenVRSubmitFrame(left: OpenVREyeFrameBuffer, right: OpenVREyeFrameBuffer) -> None

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

See OpenVRCreateEyeFrameBuffer.

OpenWrite Function

OpenWrite(path: str) -> File

Open a file as binary in write mode.

See Open, OpenText, OpenWriteText

OpenWriteText Function

OpenWriteText(path: str) -> File

Open a file as text in write mode.

See Open, OpenText, OpenWrite

OpenXRCreateEyeFrameBuffer Function

OpenXRCreateEyeFrameBuffer() -> OpenXREyeFrameBufferList
OpenXRCreateEyeFrameBuffer(aa: OpenXRAA) -> OpenXREyeFrameBufferList

OpenXRDestroyEyeFrameBuffer Function

OpenXRDestroyEyeFrameBuffer(eye_fb: OpenXREyeFrameBuffer) -> None

OpenXRFinishSubmitFrameBuffer Function

OpenXRFinishSubmitFrameBuffer(frameInfo: OpenXRFrameInfo) -> None

OpenXRGetColorTexture Function

OpenXRGetColorTexture(eye: OpenXREyeFrameBuffer) -> Texture

OpenXRGetColorTextureFromId Function

OpenXRGetColorTextureFromId(eyes: OpenXREyeFrameBufferList, frame_info: OpenXRFrameInfo, index: int) -> Texture

OpenXRGetDepthTexture Function

OpenXRGetDepthTexture(eye: OpenXREyeFrameBuffer) -> Texture

OpenXRGetDepthTextureFromId Function

OpenXRGetDepthTextureFromId(eyes: OpenXREyeFrameBufferList, frame_info: OpenXRFrameInfo, index: int) -> Texture

OpenXRGetEyeGaze Function

OpenXRGetEyeGaze() -> bool, Mat4

OpenXRGetHeadPose Function

OpenXRGetHeadPose() -> bool, Mat4

OpenXRGetInstanceInfo Function

OpenXRGetInstanceInfo() -> str

OpenXRInit Function

OpenXRInit() -> bool
OpenXRInit(ExtensionsFlagsEnable: int) -> bool

OpenXRShutdown Function

OpenXRShutdown() -> None

OpenXRSubmitSceneToForwardPipeline Function

OpenXRSubmitSceneToForwardPipeline(cam_offset: Mat4, update_controllers: update_controllersCallback, draw_scene: draw_sceneCallback, view_id: int, z_near: float, z_far: float) -> OpenXRFrameInfo, int

Orthonormalize Function

Orthonormalize(m: Mat3) -> Mat3
Orthonormalize(m: Mat4) -> Mat4

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

Overlap Function

Overlap(minmax_a: MinMax, minmax_b: MinMax) -> bool
Overlap(minmax_a: MinMax, minmax_b: MinMax, axis: Axis) -> bool

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

PathJoin Function

PathJoin(elements: StringList) -> str

Return a file path from a set of string elements.

PathStartsWith Function

PathStartsWith(path: str, with: str) -> bool

Test if the provided path starts with the provided prefix.

PathStripPrefix Function

PathStripPrefix(path: str, prefix: str) -> str

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

PathStripSuffix Function

PathStripSuffix(path: str, suffix: str) -> str

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

PathToDisplay Function

PathToDisplay(path: str) -> str

Format a path for display.

PauseSource Function

PauseSource(source: SourceRef) -> None

Pause a playing audio source.

See PlayStereo and PlaySpatialized.

PlaySpatialized Function

PlaySpatialized(snd: SoundRef, state: SpatializedSourceState) -> SourceRef

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

PlayStereo Function

PlayStereo(snd: SoundRef, state: StereoSourceState) -> SourceRef

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

PrepareForwardPipelineLights Function

PrepareForwardPipelineLights(lights: ForwardPipelineLightList) -> ForwardPipelineLights

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

PrepareSceneForwardPipelineCommonRenderData(view_id: int, scene: Scene, render_data: SceneForwardPipelineRenderData, pipeline: ForwardPipeline, resources: PipelineResources, views: SceneForwardPipelinePassViewId) -> int, SceneForwardPipelinePassViewId
PrepareSceneForwardPipelineCommonRenderData(view_id: int, scene: Scene, render_data: SceneForwardPipelineRenderData, pipeline: ForwardPipeline, resources: PipelineResources, views: SceneForwardPipelinePassViewId, debug_name: str) -> int, SceneForwardPipelinePassViewId

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

PrepareSceneForwardPipelineViewDependentRenderData(view_id: int, view_state: ViewState, scene: Scene, render_data: SceneForwardPipelineRenderData, pipeline: ForwardPipeline, resources: PipelineResources, views: SceneForwardPipelinePassViewId) -> int, SceneForwardPipelinePassViewId
PrepareSceneForwardPipelineViewDependentRenderData(view_id: int, view_state: ViewState, scene: Scene, render_data: SceneForwardPipelineRenderData, pipeline: ForwardPipeline, resources: PipelineResources, views: SceneForwardPipelinePassViewId, debug_name: str) -> int, SceneForwardPipelinePassViewId

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

See PrepareSceneForwardPipelineCommonRenderData.

PrintProfilerFrame Function

PrintProfilerFrame(profiler_frame: ProfilerFrame) -> None

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

ProcessLoadQueues Function

ProcessLoadQueues(res: PipelineResources) -> int
ProcessLoadQueues(res: PipelineResources, t_budget: int) -> int

ProcessModelLoadQueue Function

ProcessModelLoadQueue(res: PipelineResources) -> int
ProcessModelLoadQueue(res: PipelineResources, t_budget: int) -> int

ProcessTextureLoadQueue Function

ProcessTextureLoadQueue(res: PipelineResources) -> int
ProcessTextureLoadQueue(res: PipelineResources, t_budget: int) -> int

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

ProjectOrthoToClipSpace(proj: Mat44, view: Vec3) -> bool, Vec3

ProjectOrthoToScreenSpace Function

ProjectOrthoToScreenSpace(proj: Mat44, view: Vec3, resolution: Vec2) -> bool, Vec3

ProjectToClipSpace Function

ProjectToClipSpace(proj: Mat44, view: Vec3) -> bool, Vec3

Project a world position to the clipping space.

ProjectToScreenSpace Function

ProjectToScreenSpace(proj: Mat44, view: Vec3, resolution: Vec2) -> bool, Vec3

Project a world position to screen coordinates.

ProjectZToClipSpace Function

ProjectZToClipSpace(z: float, proj: Mat44) -> float

Project a depth value to clip space.

Quantize Function

Quantize(v: float, q: float) -> float

Return the provided value quantized to the specified step.

QuaternionFromAxisAngle Function

QuaternionFromAxisAngle(angle: float, axis: Vec3) -> Quaternion

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

QuaternionFromEuler Function

QuaternionFromEuler(x: float, y: float, z: float) -> Quaternion
QuaternionFromEuler(x: float, y: float, z: float, rotation_order: RotationOrder) -> Quaternion
QuaternionFromEuler(euler: Vec3) -> Quaternion
QuaternionFromEuler(euler: Vec3, rotation_order: RotationOrder) -> Quaternion

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

QuaternionFromMatrix3 Function

QuaternionFromMatrix3(m: Mat3) -> Quaternion

Return a quaternion rotation from its Mat3 representation.

QuaternionLookAt Function

QuaternionLookAt(at: Vec3) -> Quaternion

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

Rad Function

Rad(radians: float) -> float

Convert an angle in radians to the engine unit system.

See Coordinates and Units System.

Rad3 Function

Rad3(x: float, y: float, z: float) -> Vec3

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

See Coordinates and Units System.

RadianToDegree Function

RadianToDegree(radians: float) -> float

Convert an angle in radians to degrees.

Rand Function

Rand() -> int
Rand(range: int) -> int

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

RandomVec3(min: float, max: float) -> Vec3
RandomVec3(min: Vec3, max: Vec3) -> Vec3

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

RandomVec4 Function

RandomVec4(min: float, max: float) -> Vec4
RandomVec4(min: Vec4, max: Vec4) -> Vec4

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

ReadFloat Function

ReadFloat(file: File) -> float

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

ReadGamepad Function

ReadGamepad() -> GamepadState
ReadGamepad(name: str) -> GamepadState

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

See GetGamepadNames.

ReadJoystick Function

ReadJoystick() -> JoystickState
ReadJoystick(name: str) -> JoystickState

ReadKeyboard Function

ReadKeyboard() -> KeyboardState
ReadKeyboard(name: str) -> KeyboardState

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

See GetKeyboardNames.

ReadMouse Function

ReadMouse() -> MouseState
ReadMouse(name: str) -> MouseState

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

See GetMouseNames.

ReadString Function

ReadString(file: File) -> str

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

ReadUInt16(file: File) -> int

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

ReadUInt32 Function

ReadUInt32(file: File) -> int

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

ReadUInt8 Function

ReadUInt8(file: File) -> int

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

ReadVRController Function

ReadVRController() -> VRControllerState
ReadVRController(name: str) -> VRControllerState

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

See GetVRControllerNames.

ReadVRGenericTracker Function

ReadVRGenericTracker() -> VRGenericTrackerState
ReadVRGenericTracker(name: str) -> VRGenericTrackerState

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

See GetVRGenericTrackerNames.

Reflect Function

Reflect(v: Vec3, n: Vec3) -> Vec3

Return the input vector reflected around the specified normal.

Refract Function

Refract(v: Vec3, n: Vec3) -> Vec3
Refract(v: Vec3, n: Vec3, k_in: float) -> Vec3
Refract(v: Vec3, n: Vec3, k_in: float, k_out: float) -> Vec3

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

RemoveAssetsFolder(path: str) -> None

Remove a folder from the assets system.

See Resources & Assets.

RemoveAssetsPackage Function

RemoveAssetsPackage(path: str) -> None

Remove a package from the assets system.

See Resources & Assets.

RenderInit Function

RenderInit(window: Window) -> bool
RenderInit(window: Window, type: RendererType) -> bool
RenderInit(width: int, height: int, reset_flags: ResetFlags) -> Window
RenderInit(width: int, height: int, reset_flags: ResetFlags, format: TextureFormat) -> Window
RenderInit(width: int, height: int, reset_flags: ResetFlags, format: TextureFormat, debug_flags: DebugFlags) -> Window
RenderInit(width: int, height: int, type: RendererType) -> Window
RenderInit(width: int, height: int, type: RendererType, reset_flags: ResetFlags) -> Window
RenderInit(width: int, height: int, type: RendererType, reset_flags: ResetFlags, format: TextureFormat) -> Window
RenderInit(width: int, height: int, type: RendererType, reset_flags: ResetFlags, format: TextureFormat, debug_flags: DebugFlags) -> Window
RenderInit(window_title: str, width: int, height: int, reset_flags: ResetFlags) -> Window
RenderInit(window_title: str, width: int, height: int, reset_flags: ResetFlags, format: TextureFormat) -> Window
RenderInit(window_title: str, width: int, height: int, reset_flags: ResetFlags, format: TextureFormat, debug_flags: DebugFlags) -> Window
RenderInit(window_title: str, width: int, height: int, type: RendererType) -> Window
RenderInit(window_title: str, width: int, height: int, type: RendererType, reset_flags: ResetFlags) -> Window
RenderInit(window_title: str, width: int, height: int, type: RendererType, reset_flags: ResetFlags, format: TextureFormat) -> Window
RenderInit(window_title: str, width: int, height: int, type: RendererType, reset_flags: ResetFlags, format: TextureFormat, debug_flags: DebugFlags) -> Window

Initialize the render system.

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

RenderReset Function

RenderReset(width: int, height: int) -> None
RenderReset(width: int, height: int, flags: ResetFlags) -> None
RenderReset(width: int, height: int, flags: ResetFlags, format: TextureFormat) -> None

Change the states of the render system at runtime.

RenderResetToWindow Function

RenderResetToWindow(win: Window, width: int, height: int) -> bool, int, int
RenderResetToWindow(win: Window, width: int, height: int, reset_flags: int) -> bool, int, int

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

RenderShutdown Function

RenderShutdown() -> None

Shutdown the render system.

ResetClock Function

ResetClock() -> None

Reset the elapsed time counter.

Reverse Function

Reverse(a: Vec2) -> Vec2
Reverse(a: iVec2) -> iVec2
Reverse(v: Vec3) -> Vec3

Return the provided vector pointing in the opposite direction.

ReverseRotationOrder Function

ReverseRotationOrder(rotation_order: RotationOrder) -> RotationOrder

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

Rewind Function

Rewind(file: File) -> None

Rewind the read/write cursor of an open file.

RGBA32 Function

RGBA32(r: int, g: int, b: int) -> int
RGBA32(r: int, g: int, b: int, a: int) -> int

Create a 32 bit integer RGBA color.

RmDir Function

RmDir(path: str) -> bool

Remove an empty folder on the local filesystem.

See RmTree.

RmTree Function

RmTree(path: str) -> bool

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

RotationMat2D(angle: float, pivot: Vec2) -> Mat3

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

RotationMat3 Function

RotationMat3(x: float, y: float, z: float) -> Mat3
RotationMat3(x: float, y: float, z: float, rotation_order: RotationOrder) -> Mat3
RotationMat3(euler: Vec3) -> Mat3
RotationMat3(euler: Vec3, rotation_order: RotationOrder) -> Mat3

Return a 3x3 rotation matrix.

RotationMat4 Function

RotationMat4(euler: Vec3) -> Mat4
RotationMat4(euler: Vec3, order: RotationOrder) -> Mat4

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

RotationMatX Function

RotationMatX(angle: float) -> Mat3

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

RotationMatXY Function

RotationMatXY(x: float, y: float) -> Mat3

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

RotationMatXYZ Function

RotationMatXYZ(x: float, y: float, z: float) -> Mat3

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

RotationMatXZY(x: float, y: float, z: float) -> Mat3

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

RotationMatY(angle: float) -> Mat3

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

RotationMatYXZ Function

RotationMatYXZ(x: float, y: float, z: float) -> Mat3

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

RotationMatYZX(x: float, y: float, z: float) -> Mat3

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

RotationMatZ(angle: float) -> Mat3

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

RotationMatZXY Function

RotationMatZXY(x: float, y: float, z: float) -> Mat3

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

RotationMatZYX(x: float, y: float, z: float) -> Mat3

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

SaveBMP(pict: Picture, path: str) -> bool

Save a Picture in BMP file format.

SaveDataToFile Function

SaveDataToFile(path: str, data: Data) -> bool

SaveFileDialog Function

SaveFileDialog(title: str, filters: FileFilterList, file: str) -> bool, str
SaveFileDialog(title: str, filters: FileFilterList, file: str, initial_dir: str) -> bool, str

Open a native SaveFile dialog.

SaveForwardPipelineAAAConfigToFile Function

SaveForwardPipelineAAAConfigToFile(path: str, config: ForwardPipelineAAAConfig) -> bool

SaveGeometryToFile Function

SaveGeometryToFile(path: str, geo: Geometry) -> bool

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

SaveJsonToFile(js: JSON, path: str) -> bool

Save a JSON object to the local filesystem.

SavePNG Function

SavePNG(pict: Picture, path: str) -> bool

Save a Picture in PNG file format.

SaveSceneBinaryToData Function

SaveSceneBinaryToData(data: Data, scene: Scene, resources: PipelineResources) -> bool
SaveSceneBinaryToData(data: Data, scene: Scene, resources: PipelineResources, flags: LoadSaveSceneFlags) -> bool

SaveSceneBinaryToFile Function

SaveSceneBinaryToFile(path: str, scene: Scene, resources: PipelineResources) -> bool
SaveSceneBinaryToFile(path: str, scene: Scene, resources: PipelineResources, flags: LoadSaveSceneFlags) -> bool

SaveSceneJsonToFile Function

SaveSceneJsonToFile(path: str, scene: Scene, resources: PipelineResources) -> bool
SaveSceneJsonToFile(path: str, scene: Scene, resources: PipelineResources, flags: LoadSaveSceneFlags) -> bool

SaveTGA Function

SaveTGA(pict: Picture, path: str) -> bool

Save a Picture in TGA file format.

ScaleMat3 Function

ScaleMat3(S: Vec2) -> Mat3
ScaleMat3(S: Vec3) -> Mat3

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

ScaleMat4 Function

ScaleMat4(scale: Vec3) -> Mat4
ScaleMat4(scale: float) -> Mat4

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

SceneClearSystems Function

SceneClearSystems(scene: Scene) -> None
SceneClearSystems(scene: Scene, vm: SceneLuaVM) -> None
SceneClearSystems(scene: Scene, physics: ScenePhysics) -> None
SceneClearSystems(scene: Scene, physics: ScenePhysics, vm: SceneLuaVM) -> None
SceneClearSystems(scene: Scene, physics: SceneBullet3Physics) -> None
SceneClearSystems(scene: Scene, physics: SceneBullet3Physics, vm: SceneLuaVM) -> None

Clear scene and all optional systems.

SceneGarbageCollectSystems Function

SceneGarbageCollectSystems(scene: Scene) -> int
SceneGarbageCollectSystems(scene: Scene, vm: SceneLuaVM) -> int
SceneGarbageCollectSystems(scene: Scene, physics: ScenePhysics) -> int
SceneGarbageCollectSystems(scene: Scene, physics: ScenePhysics, vm: SceneLuaVM) -> int
SceneGarbageCollectSystems(scene: Scene, physics: SceneBullet3Physics) -> int
SceneGarbageCollectSystems(scene: Scene, physics: SceneBullet3Physics, vm: SceneLuaVM) -> int

Garbage collect a scene and all its optional systems.

SceneSyncToSystemsFromAssets Function

SceneSyncToSystemsFromAssets(scene: Scene, vm: SceneLuaVM) -> None
SceneSyncToSystemsFromAssets(scene: Scene, physics: ScenePhysics) -> None
SceneSyncToSystemsFromAssets(scene: Scene, physics: ScenePhysics, vm: SceneLuaVM) -> None
SceneSyncToSystemsFromAssets(scene: Scene, physics: SceneBullet3Physics) -> None
SceneSyncToSystemsFromAssets(scene: Scene, physics: SceneBullet3Physics, vm: SceneLuaVM) -> None

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

SceneSyncToSystemsFromFile(scene: Scene, vm: SceneLuaVM) -> None
SceneSyncToSystemsFromFile(scene: Scene, physics: ScenePhysics) -> None
SceneSyncToSystemsFromFile(scene: Scene, physics: ScenePhysics, vm: SceneLuaVM) -> None
SceneSyncToSystemsFromFile(scene: Scene, physics: SceneBullet3Physics) -> None
SceneSyncToSystemsFromFile(scene: Scene, physics: SceneBullet3Physics, vm: SceneLuaVM) -> None

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

SceneUpdateSystems(scene: Scene, clocks: SceneClocks, dt: int) -> None
SceneUpdateSystems(scene: Scene, clocks: SceneClocks, dt: int, vm: SceneLuaVM) -> None
SceneUpdateSystems(scene: Scene, clocks: SceneClocks, dt: int, physics: ScenePhysics, step: int, max_physics_step: int) -> None
SceneUpdateSystems(scene: Scene, clocks: SceneClocks, dt: int, physics: ScenePhysics, step: int, max_physics_step: int, vm: SceneLuaVM) -> None
SceneUpdateSystems(scene: Scene, clocks: SceneClocks, dt: int, physics: ScenePhysics, contacts: NodePairContacts, step: int, max_physics_step: int) -> None
SceneUpdateSystems(scene: Scene, clocks: SceneClocks, dt: int, physics: ScenePhysics, contacts: NodePairContacts, step: int, max_physics_step: int, vm: SceneLuaVM) -> None
SceneUpdateSystems(scene: Scene, clocks: SceneClocks, dt: int, physics: SceneBullet3Physics, step: int, max_physics_step: int) -> None
SceneUpdateSystems(scene: Scene, clocks: SceneClocks, dt: int, physics: SceneBullet3Physics, step: int, max_physics_step: int, vm: SceneLuaVM) -> None
SceneUpdateSystems(scene: Scene, clocks: SceneClocks, dt: int, physics: SceneBullet3Physics, contacts: NodePairContacts, step: int, max_physics_step: int) -> None
SceneUpdateSystems(scene: Scene, clocks: SceneClocks, dt: int, physics: SceneBullet3Physics, contacts: NodePairContacts, step: int, max_physics_step: int, vm: SceneLuaVM) -> None

Update a scene and all its optional systems.

ScreenSpaceToClipSpace Function

ScreenSpaceToClipSpace(screen: Vec3, resolution: Vec2) -> Vec3

Transform a screen position to clip space.

Sec Function

Sec(seconds: float) -> float

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

See Coordinates and Units System.

Seed Function

Seed(seed: int) -> None

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

Seek Function

Seek(file: File, offset: int, mode: SeekMode) -> bool

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

SendVRControllerHapticPulse Function

SendVRControllerHapticPulse(duration: int) -> None
SendVRControllerHapticPulse(duration: int, name: str) -> None

Send an haptic pulse to a named VR controller.

See GetVRControllerNames.

SetAxises Function

SetAxises(m: Mat3, X: Vec3, Y: Vec3, Z: Vec3) -> None

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

SetColumn Function

SetColumn(m: Mat3, n: int, column: Vec3) -> None
SetColumn(m: Mat4, n: int, v: Vec3) -> None
SetColumn(m: Mat44, idx: int, v: Vec4) -> None

Returns the nth column.

SetHeight Function

SetHeight(rect: Rect, height: float) -> None
SetHeight(rect: IntRect, height: int) -> None

Set a rectangle height.

SetJsonValue Function

SetJsonValue(js: JSON, key: str, value: str) -> None
SetJsonValue(js: JSON, key: str, value: bool) -> None
SetJsonValue(js: JSON, key: str, value: int) -> None
SetJsonValue(js: JSON, key: str, value: float) -> None

Set a JSON key value.

SetListener Function

SetListener(world: Mat4, velocity: Vec3) -> None

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

SetLogDetailed Function

SetLogDetailed(is_detailed: bool) -> None

Display the details field of log outputs.

SetLogLevel Function

SetLogLevel(log_level: LogLevel) -> None

Control which log levels should be displayed.

See Log, Warn, Error and Debug.

SetMaterialAlphaCut Function

SetMaterialAlphaCut(mat: Material, enable: bool) -> None

SetMaterialAmbientUsesUV1 Function

SetMaterialAmbientUsesUV1(mat: Material, enable: bool) -> None

SetMaterialBlendMode Function

SetMaterialBlendMode(mat: Material, mode: BlendMode) -> None

Set material blend mode.

SetMaterialDepthTest Function

SetMaterialDepthTest(mat: Material, test: DepthTest) -> None

Set material depth test.

SetMaterialDiffuseUsesUV1 Function

SetMaterialDiffuseUsesUV1(mat: Material, enable: bool) -> None

SetMaterialFaceCulling Function

SetMaterialFaceCulling(mat: Material, culling: FaceCulling) -> None

Set material face culling.

SetMaterialNormalMapInWorldSpace Function

SetMaterialNormalMapInWorldSpace(mat: Material, enable: bool) -> None

SetMaterialProgram Function

SetMaterialProgram(mat: Material, program: PipelineProgramRef) -> None

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

SetMaterialSkinning(mat: Material, enable: bool) -> None

SetMaterialSpecularUsesUV1 Function

SetMaterialSpecularUsesUV1(mat: Material, enable: bool) -> None

SetMaterialTexture Function

SetMaterialTexture(mat: Material, name: str, texture: TextureRef, stage: int) -> None

Set a material uniform texture and texture stage.

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

SetMaterialTextureRef Function

SetMaterialTextureRef(mat: Material, name: str, texture: TextureRef) -> None

Set a material uniform texture reference.

See PipelineResources.

SetMaterialValue Function

SetMaterialValue(mat: Material, name: str, v: float) -> None
SetMaterialValue(mat: Material, name: str, v: Vec2) -> None
SetMaterialValue(mat: Material, name: str, v: Vec3) -> None
SetMaterialValue(mat: Material, name: str, v: Vec4) -> None
SetMaterialValue(mat: Material, name: str, m: Mat3) -> None
SetMaterialValue(mat: Material, name: str, m: Mat4) -> None
SetMaterialValue(mat: Material, name: str, m: Mat44) -> None

Set a material uniform value.

SetMaterialWriteRGBA Function

SetMaterialWriteRGBA(mat: Material, write_r: bool, write_g: bool, write_b: bool, write_a: bool) -> None

Set a material color write mask.

SetMaterialWriteZ Function

SetMaterialWriteZ(mat: Material, enable: bool) -> None

Set a material depth write mask.

SetRenderDebug Function

SetRenderDebug(flags: DebugFlags) -> None

Set render system debug flags.

SetRow Function

SetRow(m: Mat3, n: int, row: Vec3) -> None
SetRow(m: Mat4, n: int, v: Vec4) -> None
SetRow(m: Mat44, idx: int, v: Vec4) -> None

Sets the nth row of a matrix.

SetS Function

SetS(m: Mat4, scale: Vec3) -> None

Shortcut for SetScale.

SetSaturation Function

SetSaturation(color: Color, saturation: float) -> Color

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

SetScale(m: Mat3, S: Vec3) -> None
SetScale(m: Mat4, scale: Vec3) -> None

Set the scaling part of the transformation matrix.

SetSourcePanning Function

SetSourcePanning(source: SourceRef, panning: float) -> None

Set a playing audio source panning.

SetSourceRepeat Function

SetSourceRepeat(source: SourceRef, repeat: SourceRepeat) -> None

Set audio source repeat mode.

SetSourceTimecode Function

SetSourceTimecode(source: SourceRef, t: int) -> bool

Set timecode of the audio source.

SetSourceTransform Function

SetSourceTransform(source: SourceRef, world: Mat4, velocity: Vec3) -> None

Set a playing spatialized audio source transformation.

SetSourceVolume Function

SetSourceVolume(source: SourceRef, volume: float) -> None

Set audio source volume.

SetT Function

SetT(m: Mat4, T: Vec3) -> None

Shortcut for SetTranslation.

SetTransform Function

SetTransform(mtx: Mat4) -> None

Set the model matrix for the next drawn primitive.

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

SetTranslation Function

SetTranslation(m: Mat3, T: Vec3) -> None
SetTranslation(m: Mat3, T: Vec2) -> None
SetTranslation(m: Mat4, T: Vec3) -> None

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

SetView2D Function

SetView2D(id: int, x: int, y: int, res_x: int, res_y: int) -> None
SetView2D(id: int, x: int, y: int, res_x: int, res_y: int, znear: float, zfar: float) -> None
SetView2D(id: int, x: int, y: int, res_x: int, res_y: int, znear: float, zfar: float, flags: ClearFlags, color: Color, depth: float, stencil: int) -> None
SetView2D(id: int, x: int, y: int, res_x: int, res_y: int, znear: float, zfar: float, flags: ClearFlags, color: Color, depth: float, stencil: int, y_up: bool) -> None

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

This function calls SetViewClear, SetViewRect then SetViewTransform.

SetViewClear Function

SetViewClear(view_id: int, flags: ClearFlags) -> None
SetViewClear(view_id: int, flags: ClearFlags, rgba: int) -> None
SetViewClear(view_id: int, flags: ClearFlags, rgba: int, depth: float) -> None
SetViewClear(view_id: int, flags: ClearFlags, rgba: int, depth: float, stencil: int) -> None
SetViewClear(view_id: int, flags: ClearFlags, col: Color) -> None
SetViewClear(view_id: int, flags: ClearFlags, col: Color, depth: float) -> None
SetViewClear(view_id: int, flags: ClearFlags, col: Color, depth: float, stencil: int) -> None

Set a view clear parameters.

See Drawing to Views.

SetViewFrameBuffer Function

SetViewFrameBuffer(view_id: int, handle: FrameBufferHandle) -> None

Set view output framebuffer.

See Drawing to Views.

SetViewMode Function

SetViewMode(view_id: int, mode: ViewMode) -> None

Set view draw ordering mode.

SetViewOrthographic Function

SetViewOrthographic(id: int, x: int, y: int, res_x: int, res_y: int, world: Mat4) -> None
SetViewOrthographic(id: int, x: int, y: int, res_x: int, res_y: int, world: Mat4, znear: float, zfar: float) -> None
SetViewOrthographic(id: int, x: int, y: int, res_x: int, res_y: int, world: Mat4, znear: float, zfar: float, size: float) -> None
SetViewOrthographic(id: int, x: int, y: int, res_x: int, res_y: int, world: Mat4, znear: float, zfar: float, size: float, flags: ClearFlags, color: Color, depth: float, stencil: int) -> None

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

This function calls SetViewClear, SetViewRect then SetViewTransform.

SetViewPerspective Function

SetViewPerspective(id: int, x: int, y: int, res_x: int, res_y: int, world: Mat4) -> None
SetViewPerspective(id: int, x: int, y: int, res_x: int, res_y: int, world: Mat4, znear: float, zfar: float) -> None
SetViewPerspective(id: int, x: int, y: int, res_x: int, res_y: int, world: Mat4, znear: float, zfar: float, zoom_factor: float) -> None
SetViewPerspective(id: int, x: int, y: int, res_x: int, res_y: int, world: Mat4, znear: float, zfar: float, zoom_factor: float, flags: ClearFlags, color: Color, depth: float, stencil: int) -> None

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

This function calls SetViewClear, SetViewRect then SetViewTransform.

SetViewRect Function

SetViewRect(view_id: int, x: int, y: int, w: int, h: int) -> None

SetViewTransform Function

SetViewTransform(view_id: int, view: Mat4, proj: Mat44) -> None

Set view transforms, namely the view and projection matrices.

SetWidth Function

SetWidth(rect: Rect, width: float) -> None
SetWidth(rect: IntRect, width: int) -> None

Set a rectangle width.

SetWindowClientSize Function

SetWindowClientSize(window: Window, width: int, height: int) -> bool

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

SetWindowPos Function

SetWindowPos(window: Window, position: iVec2) -> bool

Set window position.

SetWindowTitle Function

SetWindowTitle(window: Window, title: str) -> bool

Set window title.

SetX Function

SetX(m: Mat3, X: Vec3) -> None
SetX(m: Mat4, X: Vec3) -> None
SetX(rect: Rect, x: float) -> None
SetX(rect: IntRect, x: int) -> None

Sets the first row.

SetY Function

SetY(m: Mat3, Y: Vec3) -> None
SetY(m: Mat4, Y: Vec3) -> None
SetY(rect: Rect, y: float) -> None
SetY(rect: IntRect, y: int) -> None

Sets the second row.

SetZ Function

SetZ(m: Mat3, Z: Vec3) -> None
SetZ(m: Mat4, Z: Vec3) -> None

Sets the third row.

ShowCursor Function

ShowCursor() -> None

Show the system mouse cursor.

See HideCursor.

Sign Function

Sign(v: Vec3) -> Vec3

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

SkipClock Function

SkipClock() -> None

Skip elapsed time since the last call to TickClock.

Sleep Function

Sleep(duration: int) -> None

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

Slerp Function

Slerp(a: Quaternion, b: Quaternion, t: float) -> Quaternion

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

SRanipalGetState Function

SRanipalGetState() -> SRanipalState

Return the current SRanipal device state.

SRanipalInit Function

SRanipalInit() -> bool

Initial the SRanipal eye detection SDK.

SRanipalIsViveProEye Function

SRanipalIsViveProEye() -> bool

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

SRanipalLaunchEyeCalibration Function

SRanipalLaunchEyeCalibration() -> None

Launch the eye detection calibration sequence.

SRanipalShutdown Function

SRanipalShutdown() -> None

Shutdown the SRanipal eye detection SDK.

StopAllSources Function

StopAllSources() -> None

Stop all playing audio sources.

StopSource Function

StopSource(source: SourceRef) -> None

Stop a playing audio source.

StreamAudioFileSpatialized Function

StreamAudioFileSpatialized(streamer: IAudioStreamer, path: str, state: SpatializedSourceState) -> SourceRef

StreamAudioFileStereo Function

StreamAudioFileStereo(streamer: IAudioStreamer, path: str, state: StereoSourceState) -> SourceRef

StreamModuleFileSpatialized Function

StreamModuleFileSpatialized(path: str, state: SpatializedSourceState) -> SourceRef

StreamModuleFileStereo Function

StreamModuleFileStereo(path: str, state: StereoSourceState) -> SourceRef

StreamOGGAssetSpatialized Function

StreamOGGAssetSpatialized(name: str, state: SpatializedSourceState) -> SourceRef

StreamOGGAssetStereo Function

StreamOGGAssetStereo(name: str, state: StereoSourceState) -> SourceRef

StreamOGGFileSpatialized Function

StreamOGGFileSpatialized(path: str, state: SpatializedSourceState) -> SourceRef

StreamOGGFileStereo Function

StreamOGGFileStereo(path: str, state: StereoSourceState) -> SourceRef

StreamWAVAssetSpatialized Function

StreamWAVAssetSpatialized(name: str, state: SpatializedSourceState) -> SourceRef

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

See SetSourceTransform and Resources & Assets.

StreamWAVAssetStereo Function

StreamWAVAssetStereo(name: str, state: StereoSourceState) -> SourceRef

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

See Resources & Assets.

StreamWAVFileSpatialized Function

StreamWAVFileSpatialized(path: str, state: SpatializedSourceState) -> SourceRef

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

See SetSourceTransform.

StreamWAVFileStereo Function

StreamWAVFileStereo(path: str, state: StereoSourceState) -> SourceRef

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

See Resources & Assets.

StringToFile Function

StringToFile(path: str, value: str) -> bool

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

SubmitSceneToForwardPipeline Function

SubmitSceneToForwardPipeline(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, render_data: SceneForwardPipelineRenderData, resources: PipelineResources) -> SceneForwardPipelinePassViewId, int
SubmitSceneToForwardPipeline(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, render_data: SceneForwardPipelineRenderData, resources: PipelineResources, frame_buffer: FrameBufferHandle) -> SceneForwardPipelinePassViewId, int
SubmitSceneToForwardPipeline(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, render_data: SceneForwardPipelineRenderData, resources: PipelineResources, frame_buffer: FrameBufferHandle, debug_name: str) -> SceneForwardPipelinePassViewId, int
SubmitSceneToForwardPipeline(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, render_data: SceneForwardPipelineRenderData, resources: PipelineResources, views: SceneForwardPipelinePassViewId, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int) -> int
SubmitSceneToForwardPipeline(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, render_data: SceneForwardPipelineRenderData, resources: PipelineResources, views: SceneForwardPipelinePassViewId, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int, frame_buffer: FrameBufferHandle) -> int
SubmitSceneToForwardPipeline(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, render_data: SceneForwardPipelineRenderData, resources: PipelineResources, views: SceneForwardPipelinePassViewId, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int, frame_buffer: FrameBufferHandle, debug_name: str) -> int

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

SubmitSceneToPipeline(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, resources: PipelineResources) -> SceneForwardPipelinePassViewId, int
SubmitSceneToPipeline(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, resources: PipelineResources, fb: FrameBufferHandle) -> SceneForwardPipelinePassViewId, int
SubmitSceneToPipeline(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, resources: PipelineResources, fb: FrameBufferHandle, debug_name: str) -> SceneForwardPipelinePassViewId, int
SubmitSceneToPipeline(view_id: int, scene: Scene, rect: IntRect, fov_axis_is_horizontal: bool, pipeline: ForwardPipeline, resources: PipelineResources) -> SceneForwardPipelinePassViewId, int
SubmitSceneToPipeline(view_id: int, scene: Scene, rect: IntRect, fov_axis_is_horizontal: bool, pipeline: ForwardPipeline, resources: PipelineResources, fb: FrameBufferHandle) -> SceneForwardPipelinePassViewId, int
SubmitSceneToPipeline(view_id: int, scene: Scene, rect: IntRect, fov_axis_is_horizontal: bool, pipeline: ForwardPipeline, resources: PipelineResources, fb: FrameBufferHandle, debug_name: str) -> SceneForwardPipelinePassViewId, int
SubmitSceneToPipeline(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, resources: PipelineResources, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int) -> SceneForwardPipelinePassViewId, int
SubmitSceneToPipeline(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, resources: PipelineResources, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int, frame_buffer: FrameBufferHandle) -> SceneForwardPipelinePassViewId, int
SubmitSceneToPipeline(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, resources: PipelineResources, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int, frame_buffer: FrameBufferHandle, debug_name: str) -> SceneForwardPipelinePassViewId, int
SubmitSceneToPipeline(view_id: int, scene: Scene, rect: IntRect, fov_axis_is_horizontal: bool, pipeline: ForwardPipeline, resources: PipelineResources, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int) -> SceneForwardPipelinePassViewId, int
SubmitSceneToPipeline(view_id: int, scene: Scene, rect: IntRect, fov_axis_is_horizontal: bool, pipeline: ForwardPipeline, resources: PipelineResources, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int, frame_buffer: FrameBufferHandle) -> SceneForwardPipelinePassViewId, int
SubmitSceneToPipeline(view_id: int, scene: Scene, rect: IntRect, fov_axis_is_horizontal: bool, pipeline: ForwardPipeline, resources: PipelineResources, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int, frame_buffer: FrameBufferHandle, debug_name: str) -> SceneForwardPipelinePassViewId, int

SwapFileExtension Function

SwapFileExtension(path: str, ext: str) -> str

Return the input file path with its extension replaced.

Tell Function

Tell(file: File) -> int

Return the current handle cursor position in bytes.

TestVisibility Function

TestVisibility(frustum: Frustum, count: int, points: Vec3) -> Visibility
TestVisibility(frustum: Frustum, count: int, points: Vec3, distance: float) -> Visibility
TestVisibility(frustum: Frustum, origin: Vec3, radius: float) -> Visibility
TestVisibility(frustum: Frustum, minmax: MinMax) -> Visibility

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

TickClock Function

TickClock() -> int

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

time_from_day(day: int) -> int

Convert days to time.

See Coordinates and Units System.

time_from_hour Function

time_from_hour(hour: int) -> int

Convert hours to time.

See Coordinates and Units System.

time_from_min Function

time_from_min(min: int) -> int

Convert minutes to time.

See Coordinates and Units System.

time_from_ms Function

time_from_ms(ms: int) -> int

Convert milliseconds to time.

See Coordinates and Units System.

time_from_ms_f Function

time_from_ms_f(ms: float) -> int

Convert milliseconds to time.

See Coordinates and Units System.

time_from_ns Function

time_from_ns(ns: int) -> int

Convert nanoseconds to time.

See Coordinates and Units System.

time_from_sec Function

time_from_sec(sec: int) -> int

Convert seconds to time.

See Coordinates and Units System.

time_from_sec_f Function

time_from_sec_f(sec: float) -> int

Convert fractional seconds to time.

See Coordinates and Units System.

time_from_us Function

time_from_us(us: int) -> int

Convert microseconds to time.

See Coordinates and Units System.

time_from_us_f Function

time_from_us_f(us: float) -> int

Convert fractional microseconds to time.

See Coordinates and Units System.

time_now Function

time_now() -> int

Return the current system time.

time_to_day Function

time_to_day(t: int) -> int

Convert time to days.

time_to_hour Function

time_to_hour(t: int) -> int

Convert time to hours.

time_to_min Function

time_to_min(t: int) -> int

Convert time to minutes.

time_to_ms Function

time_to_ms(t: int) -> int

Convert time to milliseconds.

time_to_ms_f Function

time_to_ms_f(t: int) -> float

Convert time to miliseconds.

time_to_ns Function

time_to_ns(t: int) -> int

Convert time to nanoseconds.

time_to_sec Function

time_to_sec(t: int) -> int

Convert time to seconds.

time_to_sec_f Function

time_to_sec_f(t: int) -> float

Convert time to fractional seconds.

time_to_string Function

time_to_string(t: int) -> str

Return time as a human-readable string.

time_to_us Function

time_to_us(t: int) -> int

Convert time to microseconds.

time_to_us_f Function

time_to_us_f(t: int) -> float

Convert time to fractional microseconds.

ToEuler Function

ToEuler(q: Quaternion) -> Vec3
ToEuler(q: Quaternion, rotation_order: RotationOrder) -> Vec3
ToEuler(m: Mat3) -> Vec3
ToEuler(m: Mat3, rotation_order: RotationOrder) -> Vec3

Convert a quaternion rotation to its Euler vector representation.

ToFloatRect Function

ToFloatRect(rect: IntRect) -> Rect

Return an integer rectangle as a floating point rectangle.

ToHLS Function

ToHLS(color: Color) -> Color

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

ToIntRect Function

ToIntRect(rect: Rect) -> IntRect

Return a floating point rectangle as an integer rectangle.

ToMatrix3 Function

ToMatrix3(q: Quaternion) -> Mat3

Convert a quaternion rotation to its Mat3 representation.

Touch Function

Touch(view_id: int) -> None

Submit an empty primitive to the view.

See Frame.

TransformationMat4 Function

TransformationMat4(pos: Vec3, rot: Vec3) -> Mat4
TransformationMat4(pos: Vec3, rot: Vec3, scale: Vec3) -> Mat4
TransformationMat4(pos: Vec3, rot: Mat3) -> Mat4
TransformationMat4(pos: Vec3, rot: Mat3, scale: Vec3) -> Mat4

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

TransformFrustum(frustum: Frustum, mtx: Mat4) -> Frustum

Return the input frustum transformed by the provided world matrix.

TranslationMat3 Function

TranslationMat3(T: Vec2) -> Mat3
TranslationMat3(T: Vec3) -> Mat3

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

TranslationMat4 Function

TranslationMat4(t: Vec3) -> Mat4

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

Transpose Function

Transpose(m: Mat3) -> Mat3

Return the transpose of the input matrix.

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

Union Function

Union(minmax_a: MinMax, minmax_b: MinMax) -> MinMax
Union(minmax: MinMax, position: Vec3) -> MinMax

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

Unlink Function

Unlink(path: str) -> bool

Remove a file from the local filesystem.

UnloadSound Function

UnloadSound(snd: SoundRef) -> None

Unload a sound from the audio system.

UnprojectFromClipSpace Function

UnprojectFromClipSpace(inv_proj: Mat44, clip: Vec3) -> bool, Vec3

Unproject a clip space position to view space.

UnprojectFromScreenSpace Function

UnprojectFromScreenSpace(inv_proj: Mat44, screen: Vec3, resolution: Vec2) -> bool, Vec3

Unproject a screen space position to view space.

UnprojectOrthoFromClipSpace Function

UnprojectOrthoFromClipSpace(inv_proj: Mat44, clip: Vec3) -> bool, Vec3

UnprojectOrthoFromScreenSpace Function

UnprojectOrthoFromScreenSpace(inv_proj: Mat44, screen: Vec3, resolution: Vec2) -> bool, Vec3

UpdateMaterialPipelineProgramVariant Function

UpdateMaterialPipelineProgramVariant(mat: Material, resources: PipelineResources) -> None

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

UpdateTexture Function

UpdateTexture(streamer: IVideoStreamer, handle: int, texture: Texture, size: iVec2, format: TextureFormat) -> bool, Texture, iVec2, TextureFormat
UpdateTexture(streamer: IVideoStreamer, handle: int, texture: Texture, size: iVec2, format: TextureFormat, destroy: bool) -> bool, Texture, iVec2, TextureFormat

UpdateTextureFromPicture Function

UpdateTextureFromPicture(tex: Texture, pic: Picture) -> None

Update texture content from the provided picture.

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

UpdateWindow Function

UpdateWindow(window: Window) -> bool

Update a window on the host system.

Vec3I Function

Vec3I(x: int, y: int, z: int) -> Vec3

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

Vec4I Function

Vec4I(x: int, y: int, z: int) -> Vec4
Vec4I(x: int, y: int, z: int, w: int) -> Vec4

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

VectorMat3 Function

VectorMat3(V: Vec3) -> Mat3

Return a vector as a matrix.

VertexLayoutPosFloatColorFloat Function

VertexLayoutPosFloatColorFloat() -> VertexLayout

VertexLayoutPosFloatColorUInt8 Function

VertexLayoutPosFloatColorUInt8() -> VertexLayout

VertexLayoutPosFloatNormFloat Function

VertexLayoutPosFloatNormFloat() -> VertexLayout

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

VertexLayoutPosFloatNormUInt8() -> VertexLayout

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

VertexLayoutPosFloatNormUInt8TexCoord0UInt8() -> VertexLayout

VertexLayoutPosFloatTexCoord0UInt8 Function

VertexLayoutPosFloatTexCoord0UInt8() -> VertexLayout

Warn Function

Warn(msg: str) -> None
Warn(msg: str, details: str) -> None

WindowHasFocus Function

WindowHasFocus(window: Window) -> bool

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

WindowSystemInit Function

WindowSystemInit() -> None

Initialize the Window system.

WindowSystemShutdown Function

WindowSystemShutdown() -> None

Shutdown the window system.

See WindowSystemInit.

Wrap Function

Wrap(v: float, start: float, end: float) -> float
Wrap(v: int, start: int, end: int) -> int

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

WriteFloat Function

WriteFloat(file: File, value: float) -> bool

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

WriteString Function

WriteString(file: File, value: str) -> bool

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

WriteUInt16 Function

WriteUInt16(file: File, value: int) -> bool

Write a binary 16 bit unsigned integer to a file.

WriteUInt32 Function

WriteUInt32(file: File, value: int) -> bool

Write a binary 32 bit unsigned integer to a file.

WriteUInt8 Function

WriteUInt8(file: File, value: int) -> bool

Write a binary 8 bit unsigned integer to a file.

ZoomFactorToFov Function

ZoomFactorToFov(zoom_factor: float) -> float

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