added camera and removed old sound dident work whit the sound system. There is one problem whit the sound system its to quiet

This commit is contained in:
Ziver Koc 2007-03-27 22:51:23 +00:00
parent 28c3cd0529
commit 448fca2fdf
19 changed files with 833 additions and 36 deletions

View file

@ -75,10 +75,15 @@ public class Sound extends Entity{
update();
}
/**
* Updates the sound
*/
public void update() {
//AL10.alSource(source.get(0), AL10.AL_POSITION, sourcePos);
SoundManager.getInstnace().setSoundLocation(
this, getLocation().getX(),getLocation().getY(),getLocation().getZ());
SoundManager.getInstnace().setSoundLocation(this,
getLocation().getX(),
getLocation().getY(),
getLocation().getZ());
}

View file

@ -1,5 +1,6 @@
package ei.engine.sound;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.util.ArrayList;
@ -119,6 +120,7 @@ public class SoundManager {
/**
* Looks for a availablee source. Creates a source if
* necessary
*
* @return The source id
*/
private int getAvailableSource(){
@ -155,6 +157,7 @@ public class SoundManager {
/**
* Stops playing a sound
*
* @param sourceId The id of the source
*/
public void stopSound(Sound sound){
@ -166,6 +169,7 @@ public class SoundManager {
/**
* Stops playing a sound
*
* @param sourceId The id of the source
*/
private void stopSound(int sourceId){
@ -177,6 +181,7 @@ public class SoundManager {
/**
* Specify the location of the sound
*
* @param sourceId The id of the source
* @param x The x axes
* @param y The y axes
@ -214,12 +219,19 @@ public class SoundManager {
/**
* Set the orientation of the listener
*
* @param rx The x rotation
* @param ry The y rotation
* @param rz The z rotation
* @param x The x coordinate
* @param y The y coordinate
* @param z The z coordinate
*/
public void setListenerOrientation(float x, float y, float z){
AL10.alListener3f(AL10.AL_ORIENTATION, x, y, z);
public void setListenerOrientation(float rx, float ry, float rz,float x, float y, float z){
float[] data = new float[] { rx, ry, rz , x, y, z };
FloatBuffer listenerOrientation = BufferUtils.createFloatBuffer(data.length).put(data);
listenerOrientation.flip();
AL10.alListener(AL10.AL_ORIENTATION,listenerOrientation);
}
/**