Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.

Constants

PI

#

PI_2

#

HALF_PI

#

FRAC_PI_3

#

E

#

Functions

affine2_to_square

#
fn affine2_to_square (
affine: mat3x2<f32>
) -> mat3x3<f32>

affine3_to_square

#

mat2x4_f32_to_mat3x3_unpack

#

affine3_to_mat3x3

#

Extracts the square portion of an affine matrix: i.e. discards the translation.

fn affine3_to_mat3x3 (
affine: mat4x3<f32>
) -> mat3x3<f32>

inverse_mat3x3

#

Returns the inverse of a 3x3 matrix.

fn inverse_mat3x3 (
matrix: mat3x3<f32>
) -> mat3x3<f32>

inverse_affine3

#

mat4x4_to_mat3x3

#

Extracts the upper 3x3 portion of a 4x4 matrix.

fn mat4x4_to_mat3x3 ( ) -> mat3x3<f32>

orthonormalize

#
fn orthonormalize (
z_unnormalized: vec3<f32>,
up: vec3<f32>
) -> mat3x3<f32>

sphere_intersects_plane_half_space

#

This is used for frustum culling.

fn sphere_intersects_plane_half_space (
plane: vec4<f32>,
sphere_center: vec4<f32>,
sphere_radius: f32
) -> bool

powsafe

#

project_onto

#

fast_sqrt

#
fn fast_sqrt (
x: f32
) -> f32

fast_acos

#

Slightly less accurate than fast_acos_4, but much simpler.

fn fast_acos (
in_x: f32
) -> f32

fast_acos_4

#

4th order polynomial approximation 4 VGRP, 16 ALU Full Rate 7 * 10^-5 radians precision Reference : Handbook of Mathematical Functions (chapter : Elementary Transcendental Functions), M. Abramowitz and I.A. Stegun, Ed.

fn fast_acos_4 (
x: f32
) -> f32

fast_atan2

#
Contents