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

Add spatial audio attach to camera, mesh or transform node feature #16161

Open
wants to merge 29 commits into
base: audio-engine-v2
Choose a base branch
from

Conversation

docEdub
Copy link
Contributor

@docEdub docEdub commented Feb 8, 2025

This change implements the "attach" feature for the spatial audio listener and sound sources.

... because the `preloadedCount` property is easily confused with the `preloadCount` property.
# Conflicts:
#	packages/dev/core/src/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.ts
#	packages/dev/core/src/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.ts
#	packages/dev/core/src/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.ts
#	packages/dev/core/src/AudioV2/abstractAudio/subProperties/spatialAudioListener.ts
#	packages/dev/core/src/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.ts
@docEdub docEdub requested a review from Copilot February 8, 2025 19:14
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 13 changed files in this pull request and generated 3 comments.

Files not reviewed (8)
  • packages/dev/core/src/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.ts: Evaluated as low risk
  • packages/dev/core/src/AudioV2/webAudio/webAudioEngine.ts: Evaluated as low risk
  • packages/dev/core/src/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.ts: Evaluated as low risk
  • packages/dev/core/src/AudioV2/abstractAudio/subProperties/spatialAudioListener.ts: Evaluated as low risk
  • packages/dev/core/src/AudioV2/abstractAudio/subProperties/spatialAudio.ts: Evaluated as low risk
  • packages/dev/core/src/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.ts: Evaluated as low risk
  • packages/dev/core/src/AudioV2/abstractAudio/spatialAttachers/abstractSpatialAudioAttacher.ts: Evaluated as low risk
  • packages/dev/core/src/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.ts: Evaluated as low risk
Comments suppressed due to low confidence (1)

packages/dev/core/src/AudioV2/abstractAudio/spatialAttachers/spatialAudioAttacher.ts:9

  • [nitpick] The constants in _SpatialAudioAttachedEntity should follow a consistent naming convention. Consider using uppercase for the constants.
export const _SpatialAudioAttachedEntity = {

return null;
}

private async _resetAttachedEntity(entity: Nullable<AbstractMesh | Camera | TransformNode>, attacherClassName: string): Promise<void> {
Copy link
Preview

Copilot AI Feb 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method _resetAttachedEntity does not handle potential errors from asynchronous operations. Add error handling to ensure robustness.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options

/** @internal */
public set camera(camera: Nullable<Camera>) {
if (this._camera === this.camera) {
Copy link
Preview

Copilot AI Feb 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comparison should be if (this._camera === camera) {.

Suggested change
if (this._camera === this.camera) {
if (this._camera === camera) {

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
super.update();

if (force) {
this._camera?.computeWorldMatrix();
Copy link
Preview

Copilot AI Feb 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The computeWorldMatrix method should be called with the force parameter: this._camera?.computeWorldMatrix(force);.

Suggested change
this._camera?.computeWorldMatrix();
this._camera?.computeWorldMatrix(force);

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@MrGallow88
Copy link

MrGallow88 commented Feb 8, 2025 via email

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