Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

💜 LiteIndex - Fast library for indexing box/area in space by vectors/location/position.

NotificationsYou must be signed in to change notification settings

Rollczi/LiteIndex

Repository files navigation

💜 LiteIndex - Fast and extensive library for indexing box/area in space by vectors/location/position based on hash indexing.

Simple Example

publicclassMain {publicstaticvoidmain(String[]args) {intSPACE_SIZE =10_000;intAREA_SIZE =80;// create indexSpaceIndex<Area,Location>index =SpaceIndex.<Area,Location>builder()            .axisX(location ->location.getX())            .axisZ(location ->location.getZ())            .axisY(location ->location.getY())            .space(area ->area.getMin(),area ->area.getMax())            .indexing(IndexingAlgorithm.calculateOptimal(SPACE_SIZE,AREA_SIZE))            .concurrent(false)            .build();// put areas to indexindex.put(newArea(newLocation(0,0,0),newLocation(10,10,10)));index.put(newArea(newLocation(3,3,3),newLocation(7,7,7)));index.put(newArea(newLocation(5,5,5),newLocation(15,15,15)));// fast searchList<Area>areas =index.get(newLocation(5,5,5));    }}

Variables:It's not limit, it's just for optimization and memory saving.

  • MAP_SIZE - expected maximum size of space
  • AREA_SIZE - expected maximum size of area

SpaceIndex builder

  • axisX - function for gettingX coordinate
  • axisZ - function for gettingZ coordinate
  • axisY - function for gettingY coordinate
  • space - function for gettingmin andmax location from area
  • indexing - set indexing algorithm (configure forbetter performance)
  • concurrent - set concurrent mode (if you want to use index in multiple threads)

SpaceIndex methods

  • put - put area to index
  • get - get areas by location
  • getAll - get all areas from index
  • getFirst - get first area by location
  • remove - remove area from index
  • removeAll - remove all areas from index
  • contains - check if index contains area
  • size - get size of index

IndexingAlgorithm

  • calculateOptimal - calculate optimal indexing algorithm for your space and area size
  • chunk - create indexing algorithm(advanced)

Gradle

repositories {    maven("https://repo.eternalcode.pl/releases")}
dependencies {    implementation("dev.rollczi:liteindex:1.0.0")}

Maven

<repositories>    <repository>        <id>eternalcode-repo</id>        <url>https://repo.eternalcode.pl/releases</url>    </repository></repositories>
<dependencies>    <dependency>        <groupId>dev.rollczi</groupId>        <artifactId>liteindex</artifactId>        <version>1.0.0</version>    </dependency></dependencies>

About

💜 LiteIndex - Fast library for indexing box/area in space by vectors/location/position.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp