-
-
Notifications
You must be signed in to change notification settings - Fork 642
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unusued for now !
- Loading branch information
Showing
2 changed files
with
28 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7e4c1b5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@parasyte is this correct ? ( i mean for the
shapes[]
property)please do note the comment i added in the me.Rect.getBounds() function, as I believe this won't be the case anymore after ticket #103 ?
with this I can modify the whole object creation, add proper parsing of other Tiled shapes in master, and add corresponding shape type :)
7e4c1b5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think you have it right. The current code for #103 also expects the collision shape position to be updated with the "body" (eg. EntityObject). I think what we should do instead is use the shape position as an offset from the body, and the shapes will have a reference to the body as well, for the final position calculations during collision detection. I believe this is what Chipmunk does...
As an example, a circle shape with
pos = {x:0, y:0}
andradius = 10
would create a 20x20 circle with the body's position at its center. And withpos = {x:10,y:10}
the body's position would be at the circle's upper-left corner. Etc.7e4c1b5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@parasyte yes, offset pos sounds like right. This is actually what i tried to achieve with the colPos vector, in an more or less optimized way, but with a code difficult to understand at the end ! :)
I guess
shapes
still need a bit more love though, like addingadd/remove
function, or emptying the array on destroy.