Skip to content

Commit

Permalink
Add "metadata" support to "ReflectionProbe" class (#12911)
Browse files Browse the repository at this point in the history
Former-commit-id: ef05293305573dd03cf67f04967657dc68a5efe3
  • Loading branch information
julien-moreau authored Aug 29, 2022
1 parent 40bfc93 commit 4dff68f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/dev/core/src/Probes/reflectionProbe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ export class ReflectionProbe {
@serializeAsVector3()
public position = Vector3.Zero();

/**
* Gets or sets an object used to store user defined information for the sound.
*/
public metadata: any = null;

/** @hidden */
public _parentContainer: Nullable<AbstractScene> = null;

Expand Down Expand Up @@ -318,6 +323,7 @@ export class ReflectionProbe {
public serialize(): any {
const serializationObject = SerializationHelper.Serialize(this, this._renderTargetTexture.serialize());
serializationObject.isReflectionProbe = true;
serializationObject.metadata = this.metadata;

return serializationObject;
}
Expand Down Expand Up @@ -353,6 +359,10 @@ export class ReflectionProbe {
reflectionProbe.attachToMesh(scene.getMeshById(parsedReflectionProbe._attachedMesh));
}

if (parsedReflectionProbe.metadata) {
reflectionProbe.metadata = parsedReflectionProbe.metadata;
}

return reflectionProbe;
}
}
1 change: 1 addition & 0 deletions what's new.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
- Added `CompatibilityOptions.UseOpenGLOrientationForUV` to define if the system should use OpenGL convention for UVs when creating geometry or loading .babylon files (false by default) ([Deltakosh](https://github.com/deltakosh))
- Added RuntimeError and errorCodes for runtime errors. ([jp833](https://github.com/jp833))
- Added `AutoReleaseWorkerPool` which will automatically terminate idle workers after a specified amount of time and use them in KTX2 and Draco decoders. ([bghgary](https://github.com/bghgary))
- Added `metadata` support to `ReflectionProbe` class. ([julien-moreau](https://github.com/julien-moreau))

### Engine

Expand Down

0 comments on commit 4dff68f

Please sign in to comment.