MCPcopy Create free account
hub / github.com/LabSound/LabSound / distanceConeGain

Method distanceConeGain

src/extended/SpatializationNode.cpp:84–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84float SpatializationNode::distanceConeGain(ContextRenderLock & r)
85{
86 if (!r.context())
87 return 1.f;
88
89 auto listener = r.context()->listener();
90
91 /// @fixme these values should be per sample, not per quantum
92 FloatPoint3D fwd = {
93 listener->forwardX()->value(),
94 listener->forwardY()->value(),
95 listener->forwardZ()->value()};
96
97 /// @fixme these values should be per sample, not per quantum
98 FloatPoint3D pos = {
99 positionX()->value(),
100 positionY()->value(),
101 positionZ()->value()};
102
103 float occlusionAttenuation = occluders ? occluders->occlusion(pos, fwd) : 1.0f;
104 return occlusionAttenuation * PannerNode::distanceConeGain(r);
105}
106}

Callers

nothing calls this directly

Calls 7

listenerMethod · 0.80
forwardXMethod · 0.80
forwardYMethod · 0.80
forwardZMethod · 0.80
occlusionMethod · 0.80
contextMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected