Documentation
¶
Index ¶
Constants ¶
View Source
const ( NW = iota NE SW SE )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnySpatial ¶
type AnySpatial[T constraints.Integer] interface { Bounds() Rect[T] Compare(other AnySpatial[T]) bool }
type Packet ¶
type Packet interface {
Serialize(writer *stream.StreamWriter) error
Deserialize(reader *stream.StreamReader)
Opcode() uint16
}
type Point ¶
type Point[T constraints.Integer] = Vector2[T]
type QuadTreeNode ¶
type QuadTreeNode[T constraints.Integer, U AnySpatial[T]] struct { Bounds Rect[T] Items []U Children [4]*QuadTreeNode[T, U] Depth int }
func NewQuadTreeNode ¶
func NewQuadTreeNode[T constraints.Integer, U AnySpatial[T]](bounds Rect[T], depth int) *QuadTreeNode[T, U]
func (*QuadTreeNode[T, U]) Find ¶
func (n *QuadTreeNode[T, U]) Find(p Vector2[T]) (*U, bool)
func (*QuadTreeNode[T, U]) Insert ¶
func (n *QuadTreeNode[T, U]) Insert(item U) bool
func (*QuadTreeNode[T, U]) QueryRange ¶
func (n *QuadTreeNode[T, U]) QueryRange(r Rect[T], out *[]U)
func (*QuadTreeNode[T, U]) Relations ¶
func (n *QuadTreeNode[T, U]) Relations(p Vector2[T]) []U
type Rect ¶
type Rect[T constraints.Integer] struct { Left, Top, Right, Bottom T }
func (Rect[T]) ContainsPoint ¶
func (Rect[T]) ContainsRect ¶
func (Rect[T]) Intersects ¶
type SendPolicy ¶
type SendPolicy uint32
const ( SEND_POLICY_RAW SendPolicy = 0 SEND_POLICY_ENCRYPT SendPolicy = 1 << iota )
Click to show internal directories.
Click to hide internal directories.