siface

package
v0.1.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package siface .

Package siface .

Package siface .

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ISearch

type ISearch interface {
	// Add adds an entity to the search tree.
	Add(entity ISpatial) bool
	// Remove removes an entity from the search tree by its ID.
	Remove(entityId int64) bool
	// GetSurroundingEntities finds entities within a certain radius of a center point.
	GetSurroundingEntities(center []float32, radius float32, filters ...func(entity ISpatial) bool) []ISpatial
	// ToDot generates a dot file for the search tree.
	ToDot() error
}

ISearch interface for search, like Octree, QuadTree, RTree, etc.

type ISpatial

type ISpatial interface {
	GetID() int64             // GetID returns the ID of the spatial entity.
	GetLocation() geo.Vec3Int // returns the location of the spatial entity.
	// GetBound returns the boundary of the spatial entity.
	//
	//it is meaningless in octree and quadtree, because octree and quadtree treat all entities as a point,
	// but it is meaningful in rtree
	GetBound() bounds.Bound
}

ISpatial spatial entity interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL