MrLoick / emo-framework

Automatically exported from code.google.com/p/emo-framework
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Patch for some issues #17

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi, Kota.

I've found some problems while I'm developing a game with emo.
I am not an expert of C/C++, but I made a patch to solve following problems.
It would be great if you check and apply them onto the next version. 

1)There is no way to attach collision filter.
  ->I've added "Filter" class to Physics.nut and modified FixtureDef
    to let it have filter as a property.
  ->I also added Fixture.setFilter function to change filters dynamically.

2)There is no way to set center of mass
  ->I've implemented Body.setCenterOfMass function.

3)Mis-spelling in Runtime.nut
  ->moter -> motor.

4)I also implemented a function Vec2.getOrientationTo(other).
  This is used when you want an angle to another object.
  usage)
  local headAngle = (basePoint.getOrientationTo(force) / PI) * 180.0;
  target.rotate(headAngle - 90);
  // -90 is the angle of direction character on the image is facing

Tell me if I'm doing something stupid.
Best Regards.

-- Tedd

Original issue reported on code.google.com by teddBroi...@gmail.com on 26 Feb 2012 at 6:15

Attachments:

GoogleCodeExporter commented 8 years ago
Hi, Kota. 
i've just realized that Squirrel API has atan2(y,x) as a built-in function. 
So forget about 4) and excuse me please.

ciao!

-- Tedd

Original comment by teddBroi...@gmail.com on 15 Mar 2012 at 1:17