Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Nav::GetNearestNodes(lua_State* L, const Vector &Pos, const float Range)
- {
- int count = 1;
- struct kdres *results;
- double pt[3] = { Pos.x, Pos.y, Pos.z };
- ILuaObject *NodeTable = Lua()->GetNewTable();
- NodeTable->Push();
- results = kd_nearest_range( NodeTree, pt, Range );
- while( !kd_res_end( results ) )
- {
- PushNode(L, (Node*)kd_res_item_data( results ));
- ILuaObject *ObjNode = Lua()->GetObject(-1);
- NodeTable->SetMember((float)count, ObjNode);
- ObjNode->UnReference();
- Lua()->Pop();
- count++
- kd_res_next( results );
- }
- NodeTable->UnReference();
- kd_res_free( results );
- }
Advertisement
Add Comment
Please, Sign In to add comment