util

package
v0.0.0-...-052c9d9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clamp

func Clamp(num, min, max float64) float64

func Lerp

func Lerp(fac float64, v1, v2 r3.Vec) r3.Vec

Lerp does a linear interpolation of two vectors using a provided factor. It is expected to operate on the factor range of [0.0, 1.0], but does not check for inclusion. May return unexpected results when the factor is out of the expected range

func RandomUnitVec3

func RandomUnitVec3() r3.Vec

func RandomV3InHemisphere

func RandomV3InHemisphere(nor r3.Vec) r3.Vec

func RandomVec3

func RandomVec3() r3.Vec

func RandomVec3Between

func RandomVec3Between(min, max float64) r3.Vec

func RandomVec3Disk

func RandomVec3Disk() r3.Vec

func RealRand

func RealRand() float64

func RealRandRange

func RealRandRange(min, max float64) float64

func Vec3Dot

func Vec3Dot(v1, v2 r3.Vec) float64

Vec3Dot computes the dot product of two vectors

func Vec3Length

func Vec3Length(v r3.Vec) float64

func Vec3LengthSquared

func Vec3LengthSquared(v r3.Vec) float64

func Vec3Mul

func Vec3Mul(v1, v2 r3.Vec) r3.Vec

func VecToRGBA

func VecToRGBA(vec r3.Vec) color.RGBA

VecToRGBA scales the input vector by 255 and then returns a new RGBA color

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL