Repository navigation
fix(libSceNgs2): support listener transforms in sceNgs2GeomCalcListener - #5810
adriadam10 merged 2 commits into
Conversation
|
Windows run: Windows 11, WinLibs GCC 15.2.0 r7, Release, this head (3918d43) merged onto
AI-assisted: yes (Claude Code Opus 5.5) |
Allow custom voice filter type 0 to clear the destination filter, matching the sampler filter convention. Type 1 continues to configure the biquad frequency, Q and level. Other unsupported filter types still throw. This follows the listener-transform support in fix/libSceNgs2-listener-transform and is needed for Dead Cells (PPSA15552), which reaches this path after the custom sampler rack. Depends on: fix(libSceNgs2): support listener transforms in sceNgs2GeomCalcListener- boykopovar#5810 Unblocks: PPSA15552 AI assistance: yes
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
Restore world-to-listener matrix construction instead of rejecting non-default orientation, translation or flags. - Build an orthonormal row-major matrix from position, orient_front and orient_up; apply the right-handed axis flip for flag 1. - Store the negated dotted translation in each matrix row. - Validate unknown flags, invalid or non-finite input, short orientation axes, and unrepresentable translation without changing the output. - Preserve finite velocity and positive finite sound speed. - Update NGS2 geometry tests and the libSceNgs2 technical debt note. AI assistance: yes
…ntation handling as implemented Co-Authored-By: Claude <noreply@anthropic.com>
|
Checked the transform against PS5PCEM's Pushed one docs-only commit on top (
Merging once CI is green. |
3918d43 to
2f25a54
Compare
|
I tested this PR's Test environment:
Dead Cells aborts after 2,682 listener calls: Front and up are parallel on that call, so their cross product is zero and Over a separate run of about 60 s, the listener calls (about 3,700) were almost all flags 0 with distinct vectors:
When I replaced up with a perpendicular reference in the parallel case (up = +Y, or +Z when front is closer to the Y axis), the game did not crash. Whether the console does the same is unknown, so it would need a documented assumption in the debt entry. For reference, the fallback adapted to this PR's helpers (my tested version used different helper names; this form compiles standalone and gives the expected axes for the cases above): Vector Cross(const Vector& left, const Vector& right) {
return {left[1] * right[2] - left[2] * right[1], left[2] * right[0] - left[0] * right[2], left[0] * right[1] - left[1] * right[0]};
}
// in Ngs2GeomCalcListener, replacing the right/up computation:
const Vector front = Unit(ReadVector(param->orient_front));
Vector up = Unit(ReadVector(param->orient_up));
Vector right = Cross(up, front);
if (!(std::hypot(right[0], right[1], right[2]) > 1e-6)) {
up = std::abs(front[1]) < 0.5 ? Vector{0.0, 1.0, 0.0} : Vector{0.0, 0.0, 1.0};
right = Cross(up, front);
}
right = Unit(right);
up = Cross(front, right);
if (flags == 1) for (auto& component : right) component = -component;Results of that snippet for the cases above (front, up → right, up, front): Two smaller points: the tests dropped the exhaustive non-finite checks and the default-listener AI-assisted: yes. |
Allow custom voice filter type 0 to clear the destination filter, matching the sampler filter convention. Type 1 continues to configure the biquad frequency, Q and level. Other unsupported filter types still throw. This follows the listener-transform support in fix/libSceNgs2-listener-transform and is needed for Dead Cells (PPSA15552), which reaches this path after the custom sampler rack. Depends on: fix(libSceNgs2): support listener transforms in sceNgs2GeomCalcListener- boykopovar#5810 Unblocks: PPSA15552 AI assistance: yes
Allow custom voice filter type 0 to clear the destination filter, matching the sampler filter convention. Type 1 continues to configure the biquad frequency, Q and level. Other unsupported filter types still throw. This follows the listener-transform support in fix/libSceNgs2-listener-transform and is needed for Dead Cells (PPSA15552), which reaches this path after the custom sampler rack. Depends on: fix(libSceNgs2): support listener transforms in sceNgs2GeomCalcListener- boykopovar#5810 Unblocks: PPSA15552 AI assistance: yes
Allow custom voice filter type 0 to clear the destination filter, matching the sampler filter convention. Type 1 continues to configure the biquad frequency, Q and level. Other unsupported filter types still throw. This follows the listener-transform support in fix/libSceNgs2-listener-transform and is needed for Dead Cells (PPSA15552), which reaches this path after the custom sampler rack. Depends on: fix(libSceNgs2): support listener transforms in sceNgs2GeomCalcListener- boykopovar#5810 Unblocks: PPSA15552 AI assistance: yes
What
Restore world-to-listener matrix construction in
sceNgs2GeomCalcListener(core/libs/prx/libSceNgs2.native/src/Geom.cpp). The previous implementation rejected non-default listener orientation, listener translation, and listener coordinate flags. That rejection stopped Dead Cells (PPSA15552) after its custom sampler rack startup because the title uses a non-default listener orientation.This change computes an orthonormal row-major world-to-listener matrix from
position,orient_frontandorient_up, applies the right-handed axis flip for flag 1, stores translation in the matrix, and preserves finite velocity and positive finite sound speed. Unknown flags, invalid or non-finite input, non-unit orientation axes, and unrepresentable translation still throw without changing the output. Source attenuation, panning and Doppler insceNgs2GeomApplyremain unimplemented.Updated
docs/dev/debt/libSceNgs2.native.mdandcore/libs/prx/libSceNgs2.native/tests/Ngs2Geom.cppto match the restored behavior.Tested
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ONcmake --build build --target ngs2_geom_testsctest --test-dir build -R '^ngs2_geom$' --output-on-failureTest #760: ngs2_geompassed (100% tests passed, 0 failures)Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)