mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-27 05:26:13 +01:00
Updated CSFML to match the changes related to the up vector changes
This commit is contained in:
1 parent
42c2fb1f5c
commit
6abeaed4aa
2 files changed
+50
-9
No files matched your search
@@ -71,25 +71,50 @@ CSFML_AUDIO_API void sfListener_setPosition(sfVector3f position);
|
|||||||
CSFML_AUDIO_API sfVector3f sfListener_getPosition();
|
CSFML_AUDIO_API sfVector3f sfListener_getPosition();
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the orientation of the listener in the scene
|
/// \brief Set the orientation of the forward vector in the scene
|
||||||
///
|
///
|
||||||
/// The orientation defines the 3D axes of the listener
|
/// The direction (also called "at vector") is the vector
|
||||||
/// (left, up, front) in the scene. The orientation vector
|
/// pointing forward from the listener's perspective. Together
|
||||||
/// doesn't have to be normalized.
|
/// with the up vector, it defines the 3D orientation of the
|
||||||
/// The default listener's orientation is (0, 0, -1).
|
/// listener in the scene. The direction vector doesn't
|
||||||
|
/// have to be normalized.
|
||||||
|
/// The default listener's direction is (0, 0, -1).
|
||||||
///
|
///
|
||||||
/// \param position New direction of the listener
|
/// \param direction New listener's direction
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API void sfListener_setDirection(sfVector3f orientation);
|
CSFML_AUDIO_API void sfListener_setDirection(sfVector3f direction);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the current orientation of the listener in the scene
|
/// \brief Get the current forward vector of the listener in the scene
|
||||||
///
|
///
|
||||||
/// \return The listener's direction
|
/// \return Listener's forward vector (not normalized)
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API sfVector3f sfListener_getDirection();
|
CSFML_AUDIO_API sfVector3f sfListener_getDirection();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Set the upward vector of the listener in the scene
|
||||||
|
///
|
||||||
|
/// The up vector is the vector that points upward from the
|
||||||
|
/// listener's perspective. Together with the direction, it
|
||||||
|
/// defines the 3D orientation of the listener in the scene.
|
||||||
|
/// The up vector doesn't have to be normalized.
|
||||||
|
/// The default listener's up vector is (0, 1, 0). It is usually
|
||||||
|
/// not necessary to change it, especially in 2D scenarios.
|
||||||
|
///
|
||||||
|
/// \param upVector New listener's up vector
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_AUDIO_API void sfListener_setUpVector(sfVector3f upVector);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the current upward vector of the listener in the scene
|
||||||
|
///
|
||||||
|
/// \return Listener's upward vector (not normalized)
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_AUDIO_API sfVector3f sfListener_getUpVector();
|
||||||
|
|
||||||
|
|
||||||
#endif // SFML_LISTENER_H
|
#endif // SFML_LISTENER_H
|
||||||
@@ -74,3 +74,19 @@ sfVector3f sfListener_getDirection()
|
|||||||
sfVector3f direction = {sfmlDirection.x, sfmlDirection.y, sfmlDirection.z};
|
sfVector3f direction = {sfmlDirection.x, sfmlDirection.y, sfmlDirection.z};
|
||||||
return direction;
|
return direction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
void sfListener_setUpVector(sfVector3f upVector)
|
||||||
|
{
|
||||||
|
sf::Listener::setUpVector(upVector.x, upVector.y, upVector.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
sfVector3f sfListener_getUpVector()
|
||||||
|
{
|
||||||
|
sf::Vector3f sfmlUpVector = sf::Listener::getUpVector();
|
||||||
|
sfVector3f upVector = {sfmlUpVector.x, sfmlUpVector.y, sfmlUpVector.z};
|
||||||
|
return upVector;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user