本文整理汇总了Java中com.jme3.audio.Listener类的典型用法代码示例。如果您正苦于以下问题:Java Listener类的具体用法?Java Listener怎么用?Java Listener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Listener类属于com.jme3.audio包,在下文中一共展示了Listener类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setListener
import com.jme3.audio.Listener; //导入依赖的package包/类
public void setListener(Listener listener) {
checkDead();
synchronized (threadLock){
while (!threadLock.get()){
try {
threadLock.wait();
} catch (InterruptedException ex) {
}
}
if (audioDisabled)
return;
if (this.listener != null){
// previous listener no longer associated with current
// renderer
this.listener.setRenderer(null);
}
this.listener = listener;
this.listener.setRenderer(this);
setListenerParams(listener);
}
}
开发者ID:mleoking,项目名称:PhET,代码行数:24,代码来源:LwjglAudioRenderer.java
示例2: AudioApp
import com.jme3.audio.Listener; //导入依赖的package包/类
public AudioApp(){
AppSettings settings = new AppSettings(true);
settings.setRenderer(null); // force dummy renderer (?)
settings.setAudioRenderer(AppSettings.LWJGL_OPENAL);
audioRenderer = JmeSystem.newAudioRenderer(settings);
audioRenderer.initialize();
assetManager = new DesktopAssetManager(true);
listener = new Listener();
audioRenderer.setListener(listener);
}
开发者ID:mleoking,项目名称:PhET,代码行数:12,代码来源:AudioApp.java
示例3: initAudio
import com.jme3.audio.Listener; //导入依赖的package包/类
private void initAudio(){
if (settings.getAudioRenderer() != null){
audioRenderer = JmeSystem.newAudioRenderer(settings);
audioRenderer.initialize();
listener = new Listener();
audioRenderer.setListener(listener);
}
}
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:Application.java
示例4: updateListenerParam
import com.jme3.audio.Listener; //导入依赖的package包/类
public void updateListenerParam(Listener listener, ListenerParam param){
checkDead();
synchronized (threadLock){
while (!threadLock.get()){
try {
threadLock.wait();
} catch (InterruptedException ex) {
}
}
if (audioDisabled)
return;
switch (param){
case Position:
Vector3f pos = listener.getLocation();
alListener3f(AL_POSITION, pos.x, pos.y, pos.z);
break;
case Rotation:
Vector3f dir = listener.getDirection();
Vector3f up = listener.getUp();
fb.rewind();
fb.put(dir.x).put(dir.y).put(dir.z);
fb.put(up.x).put(up.y).put(up.z);
fb.flip();
alListener(AL_ORIENTATION, fb);
break;
case Velocity:
Vector3f vel = listener.getVelocity();
alListener3f(AL_VELOCITY, vel.x, vel.y, vel.z);
break;
case Volume:
alListenerf(AL_GAIN, listener.getVolume());
break;
}
}
}
开发者ID:mleoking,项目名称:PhET,代码行数:37,代码来源:LwjglAudioRenderer.java
示例5: setListenerParams
import com.jme3.audio.Listener; //导入依赖的package包/类
private void setListenerParams(Listener listener){
Vector3f pos = listener.getLocation();
Vector3f vel = listener.getVelocity();
Vector3f dir = listener.getDirection();
Vector3f up = listener.getUp();
alListener3f(AL_POSITION, pos.x, pos.y, pos.z);
alListener3f(AL_VELOCITY, vel.x, vel.y, vel.z);
fb.rewind();
fb.put(dir.x).put(dir.y).put(dir.z);
fb.put(up.x).put(up.y).put(up.z);
fb.flip();
alListener(AL_ORIENTATION, fb);
alListenerf(AL_GAIN, listener.getVolume());
}
开发者ID:mleoking,项目名称:PhET,代码行数:16,代码来源:LwjglAudioRenderer.java
示例6: updateListenerParam
import com.jme3.audio.Listener; //导入依赖的package包/类
@Override
public void updateListenerParam(Listener listener, ListenerParam param) {
//logger.log(Level.INFO, "updateListenerParam " + param);
if (audioDisabled) {
return;
}
switch (param) {
case Position:
listenerPosition.set(listener.getLocation());
break;
case Rotation:
Vector3f dir = listener.getDirection();
Vector3f up = listener.getUp();
break;
case Velocity:
Vector3f vel = listener.getVelocity();
break;
case Volume:
//alListenerf(AL_GAIN, listener.getVolume());
break;
}
}
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:28,代码来源:AndroidAudioRenderer.java
示例7: setListener
import com.jme3.audio.Listener; //导入依赖的package包/类
public void setListener(Listener listener) {
if (audioDisabled) {
return;
}
if (this.listener != null) {
// previous listener no longer associated with current
// renderer
this.listener.setRenderer(null);
}
this.listener = listener;
this.listener.setRenderer(this);
}
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:16,代码来源:AndroidAudioRenderer.java
示例8: initAudio
import com.jme3.audio.Listener; //导入依赖的package包/类
private void initAudio(){
if (settings.getAudioRenderer() != null && context.getType() != Type.Headless){
audioRenderer = JmeSystem.newAudioRenderer(settings);
audioRenderer.initialize();
AudioContext.setAudioRenderer(audioRenderer);
listener = new Listener();
audioRenderer.setListener(listener);
}
}
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:11,代码来源:Application.java
示例9: getListener
import com.jme3.audio.Listener; //导入依赖的package包/类
/**
* @return The {@link Listener listener} object for audio
*/
public Listener getListener() {
return listener;
}
开发者ID:mleoking,项目名称:PhET,代码行数:7,代码来源:Application.java
示例10: getListener
import com.jme3.audio.Listener; //导入依赖的package包/类
@Override
public Listener getListener() {
defaultFakeError();
return null;
}
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:6,代码来源:FakeApplication.java
示例11: attachToGame
import com.jme3.audio.Listener; //导入依赖的package包/类
/**
* Adds this World from the core JMonkey SimpleApplication state, and initialises core components of the World.
*
* @param appManager
* @param assetManager
* @param cam
* @param type
* @param viewPort
*/
@SuppressWarnings("deprecation")
public void attachToGame(AppStateManager appManager, AssetManager assetManager, Listener audioListener, Camera cam, WorldType type, ViewPort viewPort){
this.assetManager = assetManager;
this.camera = cam;
this.worldType = type;
appManager.attach(bulletAppState);
physics = bulletAppState.getPhysicsSpace();
physics.setGravity(new Vector3f(0, -100, 0));
if(PHYSICS_DEBUG)
physics.enableDebug(assetManager);
physics.addCollisionListener(new ActorCollisionManager());
physics.addCollisionListener(new TriggerCollisionListener());
assetManager.registerLocator("assets/Models/WorldObjects.zip", ZipLocator.class);
assetManager.registerLocator("assets/Models/NewAsses.zip", ZipLocator.class);
assetManager.registerLocator("assets/Scenes/terrain.zip", ZipLocator.class);
if(otherPlayers == null)
otherPlayers = new ArrayList<Player>();
if(loadedEntities != null){
addEntities(loadedEntities);
loadedEntities = null;
} else{
if(type != WorldType.CLIENT){
initializeWorldObjectsFromFile(MAPFILE);
initializePathGraph();
}
if(type == WorldType.SP){
player = new Player();
otherPlayers.add(player);
addEntity(player, spawnPoint);
player.setCamera(camera);
player.setAudioListener(audioListener);
}
}
vem = new VisualEffectsManager(assetManager, root, viewPort);
timeManager = new TimeManager(this, vem);
vem.removeLightScattering(); //Uncomment this if you have a powerful computer mr markers
if(SHADOWS){
root.setShadowMode(ShadowMode.CastAndReceive);
} else{
vem.removeShadows();
}
if(USE_SUPERFAST_RENDERING){
vem.removeFog();
vem.removeLightScattering();
vem.removeShadows();
vem.removeWater();
}
setupAudio();
}
开发者ID:GSam,项目名称:Game-Project,代码行数:66,代码来源:World.java
示例12: setAudioListener
import com.jme3.audio.Listener; //导入依赖的package包/类
/**
* Sets this Player's AudioListener to the passed value
* @param audioListener the listener to set
*/
public void setAudioListener(Listener audioListener){
this.audioListener = audioListener;
}
开发者ID:GSam,项目名称:Game-Project,代码行数:8,代码来源:Player.java
注:本文中的com.jme3.audio.Listener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论