-
Notifications
You must be signed in to change notification settings - Fork 26
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
RFC: Projection Libraries #129
base: master
Are you sure you want to change the base?
Conversation
…This is not complete and not all of these match, but it's a good start on the process.
All projections must be in the same header/cpp file. |
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.
Looks mostly good but abood mentioned the projection headers and sources are supposed to be condensed into one file ie. seadProjection.(h/cpp)
@@ -63,6 +63,6 @@ class GraphicsNvn : public Graphics | |||
bool _201; | |||
bool _202; | |||
}; | |||
static_assert(sizeof(GraphicsNvn) == 0x208); | |||
// static_assert(sizeof(GraphicsNvn) == 0x208); |
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.
is there a reason why this was commented out?
} // namespace sead | ||
|
||
#endif // SEAD_GRAPHICS_CONTEXT_H_ | ||
#ifndef SEAD_GRAPHICS_CONTEXT_H_ |
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.
extra copy and paste?
@@ -0,0 +1,550 @@ | |||
#ifndef SEAD_GRAPHICS_CONTEXT_H_ |
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.
#pragma once
@@ -1,31 +1,35 @@ | |||
#pragma once | |||
#ifndef SEAD_VIEWPORT_H_ |
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.
pragma once
explicit Viewport(const BoundBox2f& parent); | ||
explicit Viewport(const LogicalFrameBuffer& buffer); | ||
Viewport(f32 left, f32 top, f32 sizeX, f32 sizeY); | ||
// explicit Viewport(const BoundBox2f& box); |
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.
reason behind commenting this out?
@@ -22,8 +22,6 @@ s32 DirectResource::getLoadDataAlignment() const | |||
return 4; | |||
} | |||
|
|||
void DirectResource::doCreate_(u8*, u32, Heap*) {} |
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 change seems unrelated to the PR
This PR attempts to implement many of the Projection libraries and tries to update their dependencies where needed and from @aboood40091's repo.
Goals
Projection
libraries, including what appear to be the Perspective, Ortho, Frustum, and Direct projections.Addresses
0xB1D898
-0xB1F2B0
are the bulk of the Projection functions in BotW.0xB1FFF0
-0xB20718
are thesead::Viewport
functionsWaiting on dependencies
Projection::unproject(Ray<>, ...)
Non-Matching Functions
Projection::doScreenPosToCameraPosTo(sead::Vector3<float>*, sead::Vector3<float> const&) const
Projection::project(sead::Vector2<float>*, sead::Vector3<float> const&, sead::Viewport const&) const
Projection::unproject(sead::Vector3<float>*, sead::Vector3<float> const&, sead::Camera const&) const
Projection::doUpdateDeviceMatrix(sead::Matrix44<float>*, sead::Matrix44<float> const&, sead::Graphics::DevicePosture) const
PerspectiveProjection::PerspectiveProjection()
PerspectiveProjection::PerspectiveProjection(float, float, float, float)
OrthoProjection::OrthoProjection()
OrthoProjection::OrthoProjection(float, float, float, float, float, float)
OrthoProjection::OrthoProjection(float, float, sead::Viewport const&)
OrthoProjection::setByViewport(sead::Viewport const&)
OrthoProjection::doUpdateMatrix(sead::Matrix44<float>*) const
FrustumProjection::FrustumProjection(float, float, float, float, float, float)
DirectProjection::DirectProjection()
DirectProjection::DirectProjection(sead::Matrix44<float> const*, sead::Graphics::DevicePosture)
DirectProjection::setDirectProjectionMatrix(sead::Matrix44<float> const*, sead::Graphics::DevicePosture)
DirectProjection::updateAttributesForDirectProjection()
DirectProjection::doUpdateMatrix(sead::Matrix44<float>*) const
DirectProjection::doScreenPosToCameraPosTo(sead::Vector3<float>*, sead::Vector3<float> const&) const
Next Steps
I'm looking for feedback on the non-matching functions, and which of the library files that have been modified that need to be updated here.
This change is