entity: physics rewrite

This commit is contained in:
2022-02-01 23:48:39 +08:00
parent 25872b257d
commit 37ee76e9fc
9 changed files with 201 additions and 256 deletions

View File

@@ -16,8 +16,11 @@ func init() {
func (PlayerBehaviour) Name() string { return "player" }
func (PlayerBehaviour) Hitbox(pos itype.Vec3d, dataset itype.Dataset) itype.Vec3d {
return itype.Vec3d{0.6, 1.8, 0.6}
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,
}}
}
func (PlayerBehaviour) EyeHeight(pos itype.Vec3d, dataset itype.Dataset) float64 {