返回目录
关灯 护眼
加入书架

去死吧,苟系统 第26章 能量定位

#include"Octree。h"

#include"MinHeap。h"

void*CaptureLowestEnergyEntity(Octree*octree,Vector3selfPosition,floatradius){

MinHeapresultHeap;

MinHeapInit(&resultHeap,100);

AABBsearchBox=buildAABBFromSphere(selfPosition,radius);

OctreeSearch(octree,searchBox,&resultHeap);

void*lowestEnergyEntity=MinHeapExtractMin(&resultHeap);

returnlowestEnergyEntity;