|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpslib.GenericParticle
pslib.DynamicParticle
pslib.AudioParticle
public class AudioParticle
AudioParticle Class
The AudioParticle object extends the functionality of the DynamicParticle class by incorporating spatial audio calculation.
This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library. If not, see http://www.gnu.org/licenses/.
Field Summary |
---|
Fields inherited from interface pslib.PSConstants |
---|
CAM2D_LOOK, CAM2D_RIGHT, CAM2D_UP, CORNER, INVERSE, INVERSE_TRIANGULAR, LEADING, LINEAR, MIDPOINT, NONE, STATIC, TRAILING, TRIANGULAR |
Constructor Summary | |
---|---|
AudioParticle()
Create a static object instance |
|
AudioParticle(int d)
Create a dynamic object instance with the specified decay time |
Method Summary | |
---|---|
AudioParticle |
copy()
Return a copy of this particle |
float[] |
getRelativeAudioData(PSVector lpv,
PSVector llv,
PSVector luv)
Return an array containing audio data relative to the specified listener position |
float |
getRelativeFBPan(PSVector lpv,
PSVector llv)
Return the front/back pan value relative to the specified listener position |
float |
getRelativeLRPan(PSVector lpv,
PSVector llv,
PSVector luv)
Return the left/right pan value relative to the specified listener position |
float |
getRelativeUDPan(PSVector lpv,
PSVector luv)
Return the up/down pan value relative to the specified listener position |
float |
getRelativeVolume(PSVector lpv)
Return the volume value relative to the specified listener position |
void |
setLimits(float min,
float max)
Set the minimum and maximum audio radii |
void |
setVolume(float v)
Set the particle volume scalar |
Methods inherited from class pslib.DynamicParticle |
---|
clearBehaviour, debug, debug, getBehaviour, getDecay, getDecayTime, getInitialDecayTime, getMass, getRenderAlpha, getRenderSize, getSnapshot, isDead, isDynamic, map, render, render, setAlphaEnvelope, setBehaviour, setBehaviour, setDecayTime, setMass, setSizeEnvelope, update |
Methods inherited from class pslib.GenericParticle |
---|
getAlpha, getColour, getPosition, getSize, getVelocity, setAlpha, setColour, setColour, setPosition, setSize, setVelocity |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AudioParticle()
public AudioParticle(int d)
d
- decay (ms)Method Detail |
---|
public void setLimits(float min, float max)
If the listener position is within the minimum radius, the particle volume will be 1, while if the listener position is outside the maxium radius, the particle volume will be 0.
min
- minimum radiusmax
- maximum radiuspublic void setVolume(float v)
v
- volumepublic final float getRelativeVolume(PSVector lpv)
lpv
- listener position vector
public final float getRelativeLRPan(PSVector lpv, PSVector llv, PSVector luv)
lpv
- listener position vectorllv
- listener look vectorluv
- listener up vector
public final float getRelativeFBPan(PSVector lpv, PSVector llv)
lpv
- listener position vectorllv
- listener look vector
public final float getRelativeUDPan(PSVector lpv, PSVector luv)
lpv
- listener position vectorluv
- listener up vector
public final float[] getRelativeAudioData(PSVector lpv, PSVector llv, PSVector luv)
Format: { volume, l/r pan, f/b pan, u/d pan }
lpv
- listener position vectorllv
- listener look vectorluv
- listener up vector
public AudioParticle copy()
The returned copy will use the volume and limit values of the source particle and will adhere to the rules defined in the DynamicParticle map() function.
copy
in class DynamicParticle
DynamicParticle
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |