Skip to content
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

Implement CellLandblock geometry cache. #639

Merged
merged 3 commits into from
Feb 14, 2018
Merged

Implement CellLandblock geometry cache. #639

merged 3 commits into from
Feb 14, 2018

Conversation

gmriggs
Copy link
Collaborator

@gmriggs gmriggs commented Feb 13, 2018

This pull request is for the 2 Trello tasks:

https://trello.com/c/4ErxP7lc/90-implement-celllandblock-geometry-cache
https://trello.com/c/TxnqEnBH/85-celllandblockgetz-needs-rework

I'm still learning my way around the ACE project, so it's possible this code is not integrated in the correct location yet...

A LoadMesh() method has been added to Landblock.cs, which uses the Region file to determine the correct heights for the vertices. It loads the landblock grid as a triangle mesh, using a snippet of code from AC2D to ensure the cells are split between the correct vertices. I have verified in a few different locations that these splitters are being generated correctly, but I have no automated way of ensuring 100% accuracy across the entire map yet.

The GetZ() method has been implemented in Landblock.cs, which returns the correct Z-height information for any X/Y position on the map.

There are no unit tests yet, but here is a video of the landblock grid mesh visualization:

https://youtu.be/5yTTcMY-1Pw

The video quality was unfortunately degraded when uploaded to Youtube, but in the right corner is a 'current landblock height' stat that is updated every time the camera moves. This shows the information returned by GetZ().

Since this mesh data is to eventually be consumed by other classes, it can be tailored to provide whatever public API would be most useful to these other classes. For now it just has some of the basics, but more can be added as needed.

@LtRipley36706 LtRipley36706 merged commit 44129d9 into ACEmulator:master Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants