21 lines
524 B
Go
21 lines
524 B
Go
package world
|
|
|
|
import "a301_game_server/pkg/mathutil"
|
|
|
|
// ZonePortal defines a connection between two zones.
|
|
type ZonePortal struct {
|
|
// Trigger area in source zone.
|
|
SourceZoneID uint32
|
|
TriggerPos mathutil.Vec3
|
|
TriggerRadius float32
|
|
|
|
// Destination in target zone.
|
|
TargetZoneID uint32
|
|
TargetPos mathutil.Vec3
|
|
}
|
|
|
|
// IsInRange returns true if the given position is within the portal's trigger area.
|
|
func (p *ZonePortal) IsInRange(pos mathutil.Vec3) bool {
|
|
return pos.DistanceXZ(p.TriggerPos) <= p.TriggerRadius
|
|
}
|