Code Monkey home page Code Monkey logo

aoi's Introduction

介绍

  • aoi的九宫格和十字链表两种实现

状态

  • 尚未经过线上项目验证

API

  • 见grid/src/aoi.h或者crosslink/src/aoi.h
  • 另外lua-bind相关见grid/lua-bind/laoi.c或者crosslink/lua-bind/laoi.c

编译和运行

以九宫格实现为例说明,十字链表实现编译方式完全相同

  • c源码:

    • 编译: cd grid/src && make clean && make all
    • 运行: ./aoi
  • lua绑定:

    • 编译: cd grid/lua-bind && make clean && make all
    • 运行: lua test.lua

用法

  • 见各目录下的test.c/test.lua

优缺点

  • 九宫格

    • 优点: cpu消耗小
    • 缺点: 内存开销大,内存消耗不仅和实体数有关,还和场景大小成正比
  • 十字链表

    • 优点: 内存开销小,内存消耗仅和实体数有关,和场景大小无关
    • 缺点: cpu消耗高,每次移动都需要计算视野差,当实体在小区域堆积严重时效率更差

参考

aoi's People

Contributors

sundream avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.