예제 #1
0
Vector3 OpenALDevice::getListenerVelocity() const
{
	ALfloat v[3];

	alGetListenerfv(AL_VELOCITY, v);
	return Vector3(v[0], v[1], v[2]);
}
예제 #2
0
	void OALAudioEngine::GetListenerOri(float3& face, float3& up) const
	{
		float v[6];
		alGetListenerfv(AL_ORIENTATION, v);
		face = ALVecToVec(float3(v));
		up = ALVecToVec(float3(&v[3]));
	}
예제 #3
0
NzVector3f NzAudio::GetListenerVelocity()
{
	NzVector3f velocity;
	alGetListenerfv(AL_VELOCITY, velocity);

	return velocity;
}
예제 #4
0
Vector3 OpenALDevice::getListenerLocation() const
{
	ALfloat p[3];

	alGetListenerfv(AL_POSITION, p);
	return Vector3(p[0], p[1], p[2]);
}
예제 #5
0
NzVector3f NzAudio::GetListenerPosition()
{
	NzVector3f position;
	alGetListenerfv(AL_POSITION, position);

	return position;
}
예제 #6
0
NzVector3f NzAudio::GetListenerDirection()
{
	ALfloat orientation[6];
	alGetListenerfv(AL_ORIENTATION, orientation);

	return NzVector3f(orientation[0], orientation[1], orientation[2]);
}
예제 #7
0
////////////////////////////////////////////////////////////
/// Get the current orientation of the listener (the point
/// he's looking at)
////////////////////////////////////////////////////////////
ofxVec3f Listener::GetTarget()
{
    float Orientation[6];
    ALCheck(alGetListenerfv(AL_ORIENTATION, Orientation));

    return ofxVec3f(Orientation[0], Orientation[1], Orientation[2]);
}
예제 #8
0
void al_getlistenerfv( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {

	if (NULL == alGetListenerfv) mogl_glunsupported("alGetListenerfv");
	alGetListenerfv((ALenum)mxGetScalar(prhs[0]),
		(ALfloat*)mxGetData(prhs[1]));

}
예제 #9
0
Vector3f Listener::getDirection()
{
    float orientation[6];
    alCheck(alGetListenerfv(AL_ORIENTATION, orientation));

    return Vector3f(orientation[0], orientation[1], orientation[2]);
}
예제 #10
0
파일: listener.c 프로젝트: zhangsu/seal
static
seal_err_t
getfv(int key, float* vector)
{
    alGetListenerfv(key, vector);

    return _seal_get_openal_err();
}
예제 #11
0
glm::vec3 AudioSystem::getListenerVelocity() const {
   SHINY_CHECK_AUDIO_SYSTEM_VALID_CURRENT("getting listener velocity");

   glm::vec3 velocity(0.0f);
   alGetListenerfv(AL_VELOCITY, glm::value_ptr(velocity));
   SHINY_CHECK_AL_ERROR("getting listener velocity");

   return velocity;
}
예제 #12
0
glm::vec3 AudioSystem::getListenerPosition() const {
   SHINY_CHECK_AUDIO_SYSTEM_VALID_CURRENT("getting listener position");

   glm::vec3 position(0.0f);
   alGetListenerfv(AL_POSITION, glm::value_ptr(position));
   SHINY_CHECK_AL_ERROR("getting listener position");

   return position;
}
예제 #13
0
NzQuaternionf NzAudio::GetListenerRotation()
{
	float orientation[6];
	alGetListenerfv(AL_ORIENTATION, orientation);

	NzVector3f forward(orientation[0], orientation[1], orientation[2]);

	return NzQuaternionf::RotationBetween(NzVector3f::Forward(), forward);
}
void emu_alGetListener3f(ALenum pname,ALfloat *v0,ALfloat *v1,ALfloat *v2)
{
   ALfloat ptArray[10];
   ptArray[0] = *v0;
   ptArray[1] = *v1;
   ptArray[2] = *v2;
   alGetListenerfv(pname, ptArray);
   *v0 = ptArray[0];
   *v1 = ptArray[1];
   *v2 = ptArray[2];
}
예제 #15
0
//Get listener Speed (3d sound)
void SoundManager::GetListenerSpeed( float& velx, float& vely, float& velz )
{
	ALfloat vel[3];
	alGetListenerfv(AL_VELOCITY, vel);	
	//Check errors
	ALenum error(alGetError());
	if(error != AL_NO_ERROR)
	{
		SingletonLogMgr::Instance()->AddNewLine("SoundManager::GetListenerSpeed","Failure while getting listener values (" + GetALErrorString(error,false) + ")",LOGEXCEPTION);
	}
	velx = vel[0];
	vely = vel[1];
	velz = vel[2];
}
예제 #16
0
glm::quat AudioSystem::getListenerOrientation() const {
   SHINY_CHECK_AUDIO_SYSTEM_VALID_CURRENT("getting listener orientation");

   std::array<float, 6> values = {{
      kForward.x, kForward.y, kForward.z,
      kUp.x, kUp.y, kUp.z
   }};
   alGetListenerfv(AL_ORIENTATION, values.data());
   SHINY_CHECK_AL_ERROR("getting listener orientation");

   glm::vec3 direction(values[0], values[1], values[2]);
   glm::vec3 up(values[3], values[4], values[5]);
   return glm::toQuat(glm::lookAtRH(glm::vec3(0.0f), direction, up));
}
예제 #17
0
//Get listener position (3d sound)
void SoundManager::GetListenerPosition(  float& posx, float& posy, float& posz)
{
	ALfloat pos[3];
	alGetListenerfv(AL_POSITION, pos);
	//Check errors
	ALenum error(alGetError());
	if(error != AL_NO_ERROR)
	{
		SingletonLogMgr::Instance()->AddNewLine("SoundManager::GetListenerPosition","Failure while getting listener values (" + GetALErrorString(error,false) + ")",LOGEXCEPTION);
	}
	posx = pos[0];
	posy = pos[1];
	posz = pos[2];
}
예제 #18
0
int main( void )
{
	ALCdevice *device;
	ALCcontext *context = NULL;
	ALfloat pregain = FLOAT_VAL;
	ALfloat postgain = 0.0;
	ALuint sid;

	device = alcOpenDevice( NULL );
	if( device == NULL ) {
		return EXIT_FAILURE;
	}

	context = alcCreateContext( device, NULL );
	if( context == NULL ) {
		alcCloseDevice( device );

		return EXIT_FAILURE;
	}

	alcMakeContextCurrent( context );

	alListenerf( AL_GAIN, pregain );
	alGetListenerfv( AL_GAIN, &postgain );

	if( postgain != pregain ) {
		fprintf( stderr, "Listener GAIN f***ed up: %f vs %f\n",
			 pregain, postgain );
	}

	alGenSources( 1, &sid );

	alSourcef( sid, AL_GAIN, pregain );
	alGetSourcefv( sid, AL_GAIN, &postgain );

	if( postgain != pregain ) {
		fprintf( stderr, "Source GAIN f***ed up: %f vs %f\n",
			 pregain, postgain );
	}

	fprintf( stderr, "All tests okay\n" );

	fflush( stderr );

	alcMakeContextCurrent( NULL );

	alcCloseDevice( device );

	return EXIT_SUCCESS;
}
예제 #19
0
	value lime_al_get_listenerfv (int param, int count) {
		
		ALfloat* values = new ALfloat[count];
		alGetListenerfv (param, values);
		
		value result = alloc_array (count);
		
		for (int i = 0; i < count; i++) {
			
			val_array_set_i (result, i, alloc_float (values[i]));
			
		}
		
		delete [] values;
		return result;
		
	}
예제 #20
0
value lime_al_get_listenerfv (value param, value count) {

    int length = val_int (count);
    ALfloat* values = new ALfloat[length];

    alGetListenerfv (val_int (param), values);

    value result = alloc_array (length);

    for (int i = 0; i < length; ++i) {

        val_array_set_i (result, i, alloc_float (values[i]));

    }

    return result;

}
예제 #21
0
//Get listener orientation (3d sound
void SoundManager::GetListenerOrientation(	float& lookatx, float& lookaty, float& lookatz,
											float& upx, float& upy, float& upz )
{
	ALfloat ori[6];
	alGetListenerfv(AL_ORIENTATION, ori);	
	//Check errors
	ALenum error(alGetError());
	if(error != AL_NO_ERROR)
	{
		SingletonLogMgr::Instance()->AddNewLine("SoundManager::GetListenerOrientation","Failure while setting listener values (" + GetALErrorString(error,false) + ")",LOGEXCEPTION);
	}
	lookatx = ori[0];
	lookaty = ori[1];
	lookatz	= ori[2];
	upx	= ori[3];
	upy	= ori[4];
	upz	= ori[5];
}
예제 #22
0
 std::pair<Vector3f, Vector3f> Sound_Renderer_AL::get_listener_forward_and_up() const {
   ALfloat lfau[6] = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
   alGetListenerfv()(AL_ORIENTATION, lfau);
   return std::make_pair(Vector3f(lfau[0], lfau[1], lfau[2]), Vector3f(lfau[3], lfau[4], lfau[5]));
 }
예제 #23
0
	void Audio::getVelocity(float * v) const
	{
		alGetListenerfv(AL_VELOCITY, v);
	}
예제 #24
0
	void Audio::getOrientation(float * v) const
	{
		alGetListenerfv(AL_ORIENTATION, v);
	}
예제 #25
0
	void Audio::getPosition(float * v) const
	{
		alGetListenerfv(AL_POSITION, v);
	}
예제 #26
0
파일: openal.c 프로젝트: AmesianX/RosWine
ALvoid CDECL wine_alGetListenerfv(ALenum param, ALfloat* values)
{
    alGetListenerfv(param, values);
}
예제 #27
0
	const Math::CVector3D	COALDevice::GetOrientationUp() const {
		float32 pfData[6];
		alGetListenerfv(AL_ORIENTATION, pfData);
		return Math::CVector3D(pfData[3], pfData[4], pfData[5]);
	}
예제 #28
0
	const Math::CVector3D	COALDevice::GetOrientationForward() const {
		float32 pfData[6];
		alGetListenerfv(AL_ORIENTATION, pfData);
		return Math::CVector3D(pfData[0], pfData[1], pfData[2]);
	}
예제 #29
0
	const Math::CVector3D	COALDevice::GetVelocity() const {
		Math::CVector3D	vResult;
		alGetListenerfv(AL_VELOCITY, vResult.GetPointer());
		return vResult;
	}
예제 #30
0
	const Math::CVector3D	COALDevice::GetPosition() const {
		Math::CVector3D	vResult;
		alGetListenerfv(AL_POSITION, vResult.GetPointer());
		return vResult;
	}