BufferGeometry
Object3D
Raycaster
Camera
CubeCamera
PerspectiveCamera
OrthographicCamera
StereoCamera
Clock
Curve
CurvePath
Path
Shape
ShapePath
ArrowHelper
AxesHelper
BoxHelper
Box3Helper
CameraHelper
DirectionalLightHelper
GridHelper
PolarGridHelper
HemisphereLightHelper
PlaneHelper
PointLightHelper
SkeletonHelper
SpotLightHelper
Light
PointLight
RectAreaLight
SpotLight
DirectionalLight
HemisphereLight
LightShadow
PointLightShadow
AnimationLoader
AudioLoader
BufferGeometryLoader
CompressedTextureLoader
CubeTextureLoader
DataTextureLoader
FileLoader
ImageBitmapLoader
ImageLoader
Loader
LoaderUtils
MaterialLoader
ObjectLoader
TextureLoader
LoadingManager
Material
Box2
Box3
Color
Cylindrical
Euler
Frustum
Interpolant
Line3
MathUtils
Matrix3
Matrix4
Plane
Quaternion
AnimationAction
AnimationClip
AnimationMixer
AnimationObjectGroup
AnimationUtils
keyframeTrack
PropertyBinding
PropertyMixer
BooleanKeyframeTrack
QuaternionKeyframeTrack
StringKeyframeTrack
Audio
AudioAnalyser
AudioContext
AudioListener
PositionalAudio

PositionalAudio.getRefDistance()

概述

PositionalAudio.getRefDistance() 是 three.js 中 PositionalAudio 类的一个方法,用于获取音频源的参考距离(单位为米)。音频源的参考距离是在距离其距离值内的所有侦听器体积内,音量衰减将被缩放至此参考距离。如果将 refDistance 设置为 0,则所有侦听器的音量将始终相同。

语法

getRefDistance(): number

返回值

  • number — 音频源的参考距离(单位为米)。

示例

以下示例从 PositionalAudio 实例中获取参考距离值:

const audio = new THREE.PositionalAudio(listener);
const refDistance = audio.getRefDistance();

参考