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

SAMDL: Add Support For Quaternion Objects #277

Open
shaddatic opened this issue Nov 15, 2024 · 0 comments
Open

SAMDL: Add Support For Quaternion Objects #277

shaddatic opened this issue Nov 15, 2024 · 0 comments

Comments

@shaddatic
Copy link

Both Chunk and Ginja have game support for quaternion rotation parameters in the NJS_OBJECT. Both of them define the ang structure members as the imaginary part of the quaternion, reinterpreting them as floats, and add a new float to the end of the structure called re_quat which is the real part of the quaternion; the definition matches those found in Ninja2.

SA2B (GC/HD/PC) has been tested and has full support for this rotation type. In fact all it's NJS_OBJECT structures are 4 bytes larger than currently defined in the SA2 Mod Loader headers, this includes Basic objects.

Right now, SAMDL completely ignores the EVAL_QUATERNION object flag and interprets the ang member as NJS_Angles, making the result essentially random. With SAIO now supporting quaternion objects, having support for them in SAMDL would allow for correctly viewing these object types and exporting them to alternative file formats, such as NJA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants