Releases: setanarut/kamera
Releases · setanarut/kamera
v2.9.1
v2.9.0
Change Log
Added
(cam *Camera) ApplyCameraTransformToPoint(x, y float64) (float64, float64)
None
,Lerp
,SmoothDamp
SmoothOptions{}
- Platformer demo example
- Director demo example
const (
// None is instant movement to the target. No smoothing.
None SmoothingType = iota
// Lerp is Lerp() function.
Lerp
// SmoothDamp is SmoothDamp() function.
SmoothDamp
)
func DefaultSmoothOptions() *SmoothOptions {
return &SmoothOptions{
LerpSpeed: 0.09,
SmoothDampTime: 0.2,
SmoothDampMaxSpeed: 1000.0,
}
}
Removed
LerpEnabled
Full Changelog: v2.8.1...v2.9.0
v2.8.1
Full Changelog: v2.8.0...v2.8.1
- Typo in doc comment
- Refactoring
v2.8.0
Full Changelog: v2.7.0...v2.8.0
[v2.8.0] Change Log
Renamed
cam.Target()
->cam.Center()
Lerp
->LerpEnabled
Fixed
- Incorrect position when use
SetSize()
. - Fix camera movement bug in example/demo.go.
Added
cam.ShakeEnabled
option- Added
BB{}
structure that returns camera bounds.cam.BB() cam.BB().ContainsPoint(-1, -5) cam.BB().Contains(kamera.NewBBForExtents(0, 0, 5, 5))
v2.7.0
[v2.7.0] Change Log
- Zoom was also included in the camera shaking
- More noise types with the new fastnoise package.
Changed
CameraShakeOptions{}
field names have changed. MaxZoomFactor
added.
type CameraShakeOptions struct {
// Noise generator for noise types and settings.
Noise *fastnoise.State[float64]
MaxX float64 // Maximum X-axis shake. 0 means disabled
MaxY float64 // Maximum Y-axis shake. 0 means disabled
MaxAngle float64 // Max shake angle (radians). 0 means disabled
MaxZoomFactor float64 // Zoom factor strength [1-0]. 0 means disabled
TimeScale float64 // Noise time domain speed
Decay float64 // Decay for trauma
}