private static extern void SetRoomProperties (int roomId, float px, float py, float pz, float qx, float qy, float qz, float qw, float dx, float dy, float dz, CardboardAudioRoom.SurfaceMaterial[] materialNames, float reflectionScalar, float reverbGain, float reverbBrightness, float reverbTime);
/// Updates the room effects of the environment with given |room| properties. /// @note This should only be called from the main Unity thread. public static void UpdateAudioRoom (int id, Transform transform, CardboardAudioRoom.SurfaceMaterial[] materials, float reflectivity, float reverbGainDb, float reverbBrightness, float reverbTime, Vector3 size) { if (initialized) { // Update room transform. Vector3 position = transform.position; Quaternion rotation = transform.rotation; Vector3 scale = Vector3.Scale(size, transform.lossyScale); scale = worldScaleInverse * new Vector3(Mathf.Abs(scale.x), Mathf.Abs(scale.y), Mathf.Abs(scale.z)); ConvertAudioTransformFromUnity(ref position, ref rotation); float reverbGain = ConvertAmplitudeFromDb(reverbGainDb); SetRoomProperties(id, position.x, position.y, position.z, rotation.x, rotation.y, rotation.z, rotation.w, scale.x, scale.y, scale.z, materials, reflectivity, reverbGain, reverbBrightness, reverbTime); } }