}
else {
Point2f[] attenuation = new Point2f[arraySize];
Point2f[] backAttenuation = new Point2f[arraySize];
for (int i=0; i< arraySize; i++) {
attenuation[i] = new Point2f();
backAttenuation[i] = new Point2f();
}
cnSound.getDistanceGain(attenuation, backAttenuation);
double[] frontDistance = new double[arraySize];
float[] frontGain = new float[arraySize];
double[] backDistance = new double[arraySize];
float[] backGain = new float[arraySize];
for (int i=0; i< arraySize; i++) {
frontDistance[i] = attenuation[i].x;
frontGain[i] = attenuation[i].y;
backDistance[i] = backAttenuation[i].x;
backGain[i] = backAttenuation[i].y;
}
audioDevice3D.setDistanceGain(index,
frontDistance, frontGain, backDistance, backGain);
}
} // ConeSound distanceGain
else if (sound instanceof PointSoundRetained) {
PointSoundRetained ptSound = (PointSoundRetained)sound;
// set distance attenuation
arraySize = ptSound.getDistanceGainLength();
if (arraySize == 0) {
// send default
audioDevice3D.setDistanceGain(index, null, null, null, null);
}
else {
Point2f[] attenuation = new Point2f[arraySize];
for (int i=0; i< arraySize; i++)
attenuation[i] = new Point2f();
ptSound.getDistanceGain(attenuation);
double[] frontDistance = new double[arraySize];
float[] frontGain = new float[arraySize];
for (int i=0; i< arraySize; i++) {
frontDistance[i] = attenuation[i].x;