-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generalize cell/world coordinate conversions. #5758
Conversation
var testSequence = info.Sequence + "-" + terrain; | ||
var sequence = anim.HasSequence(testSequence) ? testSequence : info.Sequence; | ||
anim.PlayFetchIndex(sequence, () => index); | ||
anim.IsDecoration = true; | ||
|
||
// Z-order is one set to the top of the footprint | ||
var offset = cellOffset.ToWVec() - centerOffset; | ||
var offset = self.World.Map.CenterOfCell(cell) - self.World.Map.CenterOfCell(location) - centerOffset; |
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.
This looks like an unnecessary calculation. Why are you not re-using cellOffset like before?
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.
It is no longer possible to convert directly between CVec and WVec, as the result now depends on outside information (cell grid type, map heightmap). This instead converts both cells to a world position, and then calculates the WVec directly.
Patch bomb and lot's of rebase and re-adaption pain for everybody else, but straight forward conversions that seemed easy to review. 👍 Can't find any regressions. |
Generalize cell/world coordinate conversions.
Specifically, the CPos::CenterPosition -> Map::CenterOfCell rename (OpenRA#5758), as well as the additional argument to Paradrop::SetLZ (OpenRA#5695).
Specifically, the CPos::CenterPosition -> Map::CenterOfCell rename (OpenRA#5758), as well as the additional argument to Paradrop::SetLZ (OpenRA#5695).
Part 3 / 5 of the isometric terrain implementation.
Moving the conversions into Map will allow these checks to be extended in future PRs to account for rectangular vs isometric cell grids, and use heightmap data.