first commit
This commit is contained in:
20
internal/world/zone_transfer.go
Normal file
20
internal/world/zone_transfer.go
Normal file
@@ -0,0 +1,20 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user