Files
a301_game_server/internal/world/zone_transfer.go
2026-02-26 17:52:48 +09:00

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
}