SKPhysicsBody bodyWithPolygonFromPath memory leaks

前端 未结 5 1921
醉酒成梦
醉酒成梦 2020-12-10 15:38

I have a strange memory leaks when creating Sprite Kit physics bodies with custom shapes. This is how my implementation looks:

CGFloat offsetX = self.frame.s         


        
5条回答
  •  甜味超标
    2020-12-10 16:11

    The only restriction on the path parameter is:

    A convex polygonal path with counterclockwise winding and no self intersections. The points are specified relative to the owning node’s origin.

    I do not know the values of offsetX and offsetY so I do not know whether the path is correct or not, but assuming that they are both 0, it seems to me like this path is clockwise and not counterclockwise. I would create the path using constants and no variables, just to make sure that it is correct and if it is still leaking I would say it's a bug in PhysicsKit.

提交回复
热议问题