-
-
Notifications
You must be signed in to change notification settings - Fork 410
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
Lua API for buildings #3274
Lua API for buildings #3274
Conversation
I think Euler angles should be used instead of quaternions. Quaternions are less intuitive and will be a nightmare for the most of beginners. Or maybe there should be an enbedded function for the Euler <-> Quaternion conversion. In addition, it would be easier to move previously created maps on |
Yes, i think so. I didn't found euler to quaternion functions. |
We're going from euler, to quaternion, to matrix now
If |
We can add quaternion -> euler utility function |
Well the point would be to get rid of that conversion altogether (where some euler angles are problematic) since the GTA function accepts a quaternion. But i'm not too steadfast on it, since it can be worked around by setting matrix. |
createBuilding function must check if modelId argument is actually a building model. It can be done by looking at usDynamicIndex field: Otherwise GTA will create a dummy object instead of a building and this type of object will never be deleted. You can check what will happened if create a building with model ID 3797. |
I also noticed that shadows and grass are still on the map even after a resource restart. But they disappear after the respawn(I guess shadows and grass are spawned once after the building creation). |
This can be fixed manually via |
Fixed |
It causes performance degradation when you have significant amount of buildings. I prefer additional |
See my additions to the comment: |
Nice work on this pr |
#1921 is also fixed with this PR |
Oh. rx between 90 and 270 is broken |
I think there is no more issues with rotation |
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.
The PR is mature enough to be merged I think. Problems related to grass and shadows(see my comments above) can be addressed in the next PRs. LODs can also be implemented in future commits.
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.
agree with tederis
Merge this! |
I come here to add my voice with the previous people and say please merge this ASAP as we need it in our upcoming project. |
What about: |
Draw distance is limited by GTA SA only. Buildings have equal draw distance with SA world world elements.
I think only global shaders work. Personally, i don't prioritize shaders over dynamic pool size / LODs / dynamic map box.
setPostion / setRotation / setMatrix functions work, but they are expensive. I suggest not use them |
@TheNormalnij https://wiki.multitheftauto.com/wiki/CreateBuilding doesn't exist 2 weeks after merge, please add it |
Fixes #450, #2755, #1921
API: