2022-01-20 21:58:50 +08:00
|
|
|
package entities
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"edgaru089.ml/go/gl01/internal/entity"
|
|
|
|
"edgaru089.ml/go/gl01/internal/util/itype"
|
|
|
|
"edgaru089.ml/go/gl01/internal/world"
|
|
|
|
)
|
|
|
|
|
|
|
|
type PlayerBehaviour struct{}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
entity.RegisterEntityBehaviour(PlayerBehaviour{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (PlayerBehaviour) Name() string { return "player" }
|
|
|
|
|
2022-02-01 23:48:39 +08:00
|
|
|
func (PlayerBehaviour) Hitbox(pos itype.Vec3d, dataset itype.Dataset) []itype.Boxd {
|
|
|
|
return []itype.Boxd{{
|
|
|
|
OffX: -0.3, OffY: 0, OffZ: -0.3,
|
|
|
|
SizeX: 0.6, SizeY: 1.8, SizeZ: 0.6,
|
|
|
|
}}
|
2022-01-20 21:58:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (PlayerBehaviour) EyeHeight(pos itype.Vec3d, dataset itype.Dataset) float64 {
|
|
|
|
return 1.65
|
|
|
|
}
|
|
|
|
|
|
|
|
func (PlayerBehaviour) Update(pos itype.Vec3d, dataset itype.Dataset, world *world.World, deltaTime time.Duration) {
|
|
|
|
|
|
|
|
}
|