Improve physics and add examples
This commit is contained in:
parent
f200ce6e7e
commit
fc1eef80f8
7 changed files with 1039 additions and 376 deletions
|
@ -7,22 +7,6 @@ import (
|
|||
"github.com/gen2brain/raylib-go/raylib"
|
||||
)
|
||||
|
||||
// Clamp - Clamp float value
|
||||
func Clamp(value, min, max float32) float32 {
|
||||
var res float32
|
||||
if value < min {
|
||||
res = min
|
||||
} else {
|
||||
res = value
|
||||
}
|
||||
|
||||
if res > max {
|
||||
return max
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
// Vector2Zero - Vector with components value 0.0
|
||||
func Vector2Zero() raylib.Vector2 {
|
||||
return raylib.NewVector2(0.0, 0.0)
|
||||
|
@ -1039,3 +1023,19 @@ func QuaternionTransform(q *raylib.Quaternion, mat raylib.Matrix) {
|
|||
q.Z = mat.M2*x + mat.M6*y + mat.M10*z + mat.M14*w
|
||||
q.W = mat.M3*x + mat.M7*y + mat.M11*z + mat.M15*w
|
||||
}
|
||||
|
||||
// Clamp - Clamp float value
|
||||
func Clamp(value, min, max float32) float32 {
|
||||
var res float32
|
||||
if value < min {
|
||||
res = min
|
||||
} else {
|
||||
res = value
|
||||
}
|
||||
|
||||
if res > max {
|
||||
return max
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue