FS#109 - Fix sf::Listener's target being actually a relative direction

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1176 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2009-07-12 19:33:56 +00:00
parent 374af05d5f
commit ac773e8161
8 changed files with 54 additions and 63 deletions

View file

@ -4,8 +4,8 @@ EXPORTS
sfListener_GetGlobalVolume
sfListener_SetPosition
sfListener_GetPosition
sfListener_SetTarget
sfListener_GetTarget
sfListener_SetDirection
sfListener_GetDirection
sfMusic_CreateFromFile
sfMusic_CreateFromMemory
sfMusic_Destroy

View file

@ -4,8 +4,8 @@ EXPORTS
sfListener_GetGlobalVolume
sfListener_SetPosition
sfListener_GetPosition
sfListener_SetTarget
sfListener_GetTarget
sfListener_SetDirection
sfListener_GetDirection
sfMusic_CreateFromFile
sfMusic_CreateFromMemory
sfMusic_Destroy

View file

@ -68,26 +68,24 @@ CSFML_API void sfListener_SetPosition(float x, float y, float z);
CSFML_API void sfListener_GetPosition(float* x, float* y, float* z);
////////////////////////////////////////////////////////////
/// Change the orientation of the listener (the point
/// he must look at)
/// Change the orientation of the listener
///
/// \param x : X position of the point the listener must look at
/// \param y : X position of the point the listener must look at
/// \param z : X position of the point the listener must look at
/// \param x : X component of the listener's direction
/// \param y : Y component of the listener's direction
/// \param z : Z component of the listener's direction
///
////////////////////////////////////////////////////////////
CSFML_API void sfListener_SetTarget(float x, float y, float z);
CSFML_API void sfListener_SetDirection(float x, float y, float z);
////////////////////////////////////////////////////////////
/// Get the current orientation of the listener (the point
/// he's looking at)
/// Get the current orientation of the listener
///
/// \param x : X position of the point the listener is looking at
/// \param y : X position of the point the listener is looking at
/// \param z : X position of the point the listener is looking at
/// \param x : X component of the listener's direction
/// \param y : Y component of the listener's direction
/// \param z : Z component of the listener's direction
///
////////////////////////////////////////////////////////////
CSFML_API void sfListener_GetTarget(float* x, float* y, float* z);
CSFML_API void sfListener_GetDirection(float* x, float* y, float* z);
#endif // SFML_LISTENER_H

View file

@ -51,9 +51,9 @@ float sfListener_GetGlobalVolume()
////////////////////////////////////////////////////////////
/// Change the position of the listener
////////////////////////////////////////////////////////////
void sfListener_SetPosition(float x, float y, float PosZ)
void sfListener_SetPosition(float x, float y, float z)
{
sf::Listener::SetPosition(sf::Vector3f(x, y, PosZ));
sf::Listener::SetPosition(x, y, z);
}
@ -73,26 +73,24 @@ void sfListener_GetPosition(float* x, float* y, float* z)
////////////////////////////////////////////////////////////
/// Change the orientation of the listener (the point
/// he must look at)
/// Change the orientation of the listener
////////////////////////////////////////////////////////////
void sfListener_SetTarget(float x, float y, float z)
void sfListener_SetDirection(float x, float y, float z)
{
sf::Listener::SetTarget(sf::Vector3f(x, y, z));
sf::Listener::SetDirection(x, y, z);
}
////////////////////////////////////////////////////////////
/// Get the current orientation of the listener (the point
/// he's looking at)
/// Get the current orientation of the listener
////////////////////////////////////////////////////////////
void sfListener_GetTarget(float* x, float* y, float* z)
void sfListener_GetDirection(float* x, float* y, float* z)
{
if (x && y && z)
{
sf::Vector3f target = sf::Listener::GetTarget();
*x = target.x;
*y = target.y;
*z = target.z;
sf::Vector3f direction = sf::Listener::GetDirection();
*x = direction.x;
*y = direction.y;
*z = direction.z;
}
}