Closed italomaia closed 10 years ago
Ok, just pinned the problem. I can't rotate my polygon if I require 30logclasscommons before requiring "hardoncollider.shapes". This probably has something to do with the use of 30log CC implementation. No ideia if this is a problem related to 30log or HC.
More on this issue: I tried testing another OO library with hardon, slither. The result? No result, actually. I get an error. So, I went back to trace down the reason for 30log and HC "no rotate" behavior. Placing a print inside polygon:rotate and shape:rotate, I discovered that when using 30log, polygon:rotate is never called. If 30log is not present, shape and polygon rotate methods are called. Here is my test code:
Fixed on 30log side.
Just for completeness, and to clarify some things about class commons:
common.class(name, table, parents...)
expects parents...
to be classes, but pol
is an instance of either shapes.ConvexPolygonShape
or shapes.ConcavePolygonShape
.As an end-user, you should not use the common.*
interface, but the interface the class system provides. In the case of 30log this should work:
car = pol:extends{}
myCar = car:new()
Just made a polygon using shapes.newPolygonShape, extended it using 30log + CC, instantiated it and then tried to rotate it but the polygon doesn't rotate.
Example: