Documentation ¶
Overview ¶
Package random provides a random generator with some weighed random functions
Index ¶
- type Random
- func (r *Random) Bool() bool
- func (r *Random) Float01() float64
- func (r *Random) Float02Pi() float64
- func (r *Random) Float0A(a float64) float64
- func (r *Random) Float0Pi() float64
- func (r *Random) FloatAB(a, b float64) float64
- func (r *Random) Int0N(n int) int
- func (r *Random) Int320N(n int32) int32
- func (r *Random) Int32AB(a, b int32) int32
- func (r *Random) Int640N(n int64) int64
- func (r *Random) Int64AB(a, b int64) int64
- func (r *Random) IntAB(a, b int) int
- func (r *Random) NewSeed() int64
- func (r *Random) Sign() int
- func (r *Random) Sign32() int32
- func (r *Random) Sign64() int64
- func (r *Random) Vec3Hemi(normal *maths.Vec3) *maths.Vec3
- func (r *Random) Vec3HemiCos(normal *maths.Vec3) *maths.Vec3
- func (r *Random) Vec3Sphere() *maths.Vec3
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Random ¶
type Random struct {
// contains filtered or unexported fields
}
Random is a random generator with convenient methods
func (*Random) Vec3HemiCos ¶
Vec3HemiCos returns a random unit vector chosen on a cosine-weighed hemisphere defined by normal
func (*Random) Vec3Sphere ¶
Vec3Sphere returns a random unit vector
Click to show internal directories.
Click to hide internal directories.