| java.lang.Object com.sun.j3d.audioengines.Sample com.sun.j3d.audioengines.javasound.JSSample com.sun.j3d.audioengines.javasound.JSPositionalSample
All known Subclasses: com.sun.j3d.audioengines.javasound.JSDirectionalSample,
JSPositionalSample | class JSPositionalSample extends JSSample (Code) | | The PostionalSample Class defines the data and methods associated with a
PointSound sample played thru the AudioDevice.
|
MAX_DISTANCES | static int MAX_DISTANCES(Code) | | |
NO_CHANGE | static int NO_CHANGE(Code) | | |
TOWARDS | static int TOWARDS(Code) | | |
averageDistances | boolean averageDistances(Code) | | |
centerEars | Point3f[] centerEars(Code) | | |
currentIndex | int currentIndex(Code) | | |
deltaTime | long deltaTime(Code) | | |
dopplerFlag | final protected static boolean dopplerFlag(Code) | | |
filterFlag | boolean filterFlag(Code) | | |
filterFreq | float filterFreq(Code) | | |
firstIndex | int firstIndex(Code) | | |
headPositionChange | double headPositionChange(Code) | | |
lastActualDopplerRateRatio | double lastActualDopplerRateRatio(Code) | | |
lastRequestedDopplerRateRatio | double lastRequestedDopplerRateRatio(Code) | | |
maxRatio | static double maxRatio(Code) | | |
numDistances | int numDistances(Code) | | |
positions | Point3f[] positions(Code) | | |
reverbIndex | int reverbIndex(Code) | | A third sample for control of reverb of the stream/clip is openned
and maintained for all directional/positional sounds.
For now, even if no aural attributes (using reverb) are active,
a reverb channel is always started with the other two. A sound could
be started without reverb and then reverb added later, but since there
is no way to offset properly into all sounds (considering non-cached
and nconsistent rate-changes during playing) this third sound is
always allocated and started.
|
rightDelay | int rightDelay(Code) | | |
rightGain | float rightGain(Code) | | |
secondIndex | int secondIndex(Code) | | For positional and directional sounds, TWO Hae streams or clips
are allocated, one each for the left and right channels, played at
a different (delayed) time and with a different gain value.
|
sourcePositionChange | double sourcePositionChange(Code) | | |
sourceToCenterEar | Vector3f sourceToCenterEar(Code) | | Save vectors from source source position to transformed ear parameters
|
sourceToLeftEar | Vector3f sourceToLeftEar(Code) | | |
sourceToRightEar | Vector3f sourceToRightEar(Code) | | |
xformHeadZAxis | Vector3f xformHeadZAxis(Code) | | |
xformLeftEar | Point3f xformLeftEar(Code) | | Save ear positions transformed into VirtualWorld coords from Head coords
These default positions are used when the real values cannot queried
|
xformRightEar | Point3f xformRightEar(Code) | | |
JSPositionalSample | public JSPositionalSample()(Code) | | |
calculateAngularGain | float calculateAngularGain()(Code) | | |
calculateDistanceAttenuation | float calculateDistanceAttenuation(float distance)(Code) | | CalculateDistanceAttenuation
Simply calls generic (for PointSound) 'findFactor()' with
a single set of attenuation distance and gain scale factor arrays.
|
calculateDoppler | float calculateDoppler(AuralParameters attribs)(Code) | | Set Doppler effect Rate
Calculate the rate of change in for the head and sound
between the two time stamps (last two times position or
VirtualWorld transform was updated).
First determine if the head and sound source are moving
towards each other (distance between them is decreasing),
moving away from each other (distance between them is
increasing), or no change (distance is the same, not moving
or moving the same speed/direction).
The following equation is used for determining the change in frequency -
If there has been a change in the distance between the head and sound:
f' = f * frequencyScaleFactor * velocityRatio
For no change in the distance bewteen head and sound, velocityRatio is 1:
f' = f
For head and sound moving towards each other, velocityRatio (> 1.0) is:
| speedOfSound*rollOff + velocityOfHead*velocityScaleFactor |
| ------------------------------------------------------------- |
| speedOfSound*rollOff - velocityOfSource*velocityScaleFactor |
For head and sound moving away from each other, velocityRatio (< 1.0) is:
| speedOfSound*rollOff - velocityOfHead*velocityScaleFactor |
| ------------------------------------------------------------- |
| speedOfSound*rollOff + velocityOfSource*velocityScaleFactor |
where frequencyScaleFactor, rollOff, velocityScaleFactor all come from
the active AuralAttributes parameters.
The following special cases must be test for AuralAttribute parameters:
rolloff
Value MUST be > zero for any sound to be heard!
If value is zero, all sounds affected by AuralAttribute region are silent.
velocityScaleFactor
Value MUST be > zero for any sound to be heard!
If value is zero, all sounds affected by AuralAttribute region are paused.
frequencyScaleFactor
Value of zero disables Doppler calculations:
Sfreq' = Sfreq * frequencyScaleFactor
This rate is passed to device drive as a change to playback sample
rate, in this case the frequency need not be known.
Return value of zero denotes no change
Return value of -1 denotes ERROR
|
calculateNewEar | boolean calculateNewEar(int dirtyFlags, View view, Point3f xformCenterEar)(Code) | | |
clear | public void clear()(Code) | | Clears the fields associated with sample data for this sound, and
frees any device specific data associated with this sample.
|
findFactor | float findFactor(double distance, double[] distanceArray, float[] factorArray)(Code) | | |
getFilterFlag | boolean getFilterFlag()(Code) | | |
getFilterFreq | float getFilterFreq()(Code) | | |
incrementIndices | void incrementIndices()(Code) | | |
render | public void render(int dirtyFlags, View view, AuralParameters attribs)(Code) | | Render this sample
Calculate the audiodevice parameters necessary to spatially play this
sound.
|
reset | void reset()(Code) | | Reset time and count based fields associated with sample data
for this sound
|
setXformedPosition | void setXformedPosition()(Code) | | |
updateEar | void updateEar(int dirtyFlags, View view)(Code) | | |
|
|