1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Performance fix + SAO factorization

Original credits goes to @Rogier-5

* Merge common attributes between LuaEntitySAO & PlayerSAO to UnitSAO
* Make some functions const
* Improve some lists performance by returning const ref

Signed-off-by: Loic Blot <loic.blot@unix-experience.fr>
This commit is contained in:
Rogier 2017-01-10 04:39:45 +09:00 committed by Ner'zhul
parent ec30d49e02
commit 6647939403
8 changed files with 88 additions and 117 deletions

View file

@ -47,8 +47,8 @@ public:
virtual void updateLightNoCheck(u8 light_at_pos){}
virtual v3s16 getLightPosition(){return v3s16(0,0,0);}
virtual aabb3f *getSelectionBox() { return NULL; }
virtual bool getCollisionBox(aabb3f *toset){return false;}
virtual bool collideWithObjects(){return false;}
virtual bool getCollisionBox(aabb3f *toset) const { return false; }
virtual bool collideWithObjects() const { return false; }
virtual v3f getPosition(){return v3f(0,0,0);}
virtual float getYaw() const {return 0;}
virtual scene::ISceneNode *getSceneNode(){return NULL;}