Changeset View
Changeset View
Standalone View
Standalone View
extern/audaspace/include/devices/I3DHandle.h
- This file was moved from intern/audaspace/intern/AUD_I3DHandle.h.
| /* | /******************************************************************************* | ||||
| * ***** BEGIN GPL LICENSE BLOCK ***** | * Copyright 2009-2016 Jörg Müller | ||||
| * | * | ||||
| * Copyright 2009-2011 Jörg Hermann Müller | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| * you may not use this file except in compliance with the License. | |||||
| * You may obtain a copy of the License at | |||||
| * | * | ||||
| * This file is part of AudaSpace. | * http://www.apache.org/licenses/LICENSE-2.0 | ||||
| * | * | ||||
| * Audaspace is free software; you can redistribute it and/or modify | * Unless required by applicable law or agreed to in writing, software | ||||
| * it under the terms of the GNU General Public License as published by | * distributed under the License is distributed on an "AS IS" BASIS, | ||||
| * the Free Software Foundation; either version 2 of the License, or | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| * (at your option) any later version. | * See the License for the specific language governing permissions and | ||||
| * | * limitations under the License. | ||||
| * AudaSpace is distributed in the hope that it will be useful, | ******************************************************************************/ | ||||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| * GNU General Public License for more details. | |||||
| * | |||||
| * You should have received a copy of the GNU General Public License | |||||
| * along with Audaspace; if not, write to the Free Software Foundation, | |||||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||||
| * | |||||
| * ***** END GPL LICENSE BLOCK ***** | |||||
| */ | |||||
| /** \file audaspace/intern/AUD_I3DHandle.h | #pragma once | ||||
| * \ingroup audaspaceintern | |||||
| */ | |||||
| /** | |||||
| * @file I3DHandle.h | |||||
| * @ingroup devices | |||||
| * The I3DHandle interface. | |||||
| */ | |||||
| #ifndef __AUD_I3DHANDLE_H__ | #include "util/Math3D.h" | ||||
| #define __AUD_I3DHANDLE_H__ | |||||
| #include "AUD_Space.h" | AUD_NAMESPACE_BEGIN | ||||
| #include "AUD_3DMath.h" | |||||
| /** | /** | ||||
| * This class represents a playback handle for 3D sources. | * @interface I3DHandle | ||||
| * The I3DHandle interface represents a playback handle for 3D sources. | |||||
| * If the playback IDevice class also implements the I3DDevice interface | |||||
| * then all playback IHandle instances also implement this interface. | |||||
| * | |||||
| * The interface has been modelled after the OpenAL 1.1 API, | |||||
| * see the [OpenAL Specification](http://openal.org/) for lots of details. | |||||
| */ | */ | ||||
| class AUD_I3DHandle | class AUD_API I3DHandle | ||||
| { | { | ||||
| public: | public: | ||||
| /** | /** | ||||
| * Destroys the handle. | * Destroys the handle. | ||||
| */ | */ | ||||
| virtual ~AUD_I3DHandle() {} | virtual ~I3DHandle() {} | ||||
| /** | /** | ||||
| * Retrieves the location of a source. | * Retrieves the location of the source. | ||||
| * \return The location. | * \return The location. | ||||
| */ | */ | ||||
| virtual AUD_Vector3 getSourceLocation()=0; | virtual Vector3 getLocation()=0; | ||||
| /** | /** | ||||
| * Sets the location of a source. | * Sets the location of the source. | ||||
| * \param location The new location. | * \param location The new location. | ||||
| * \return Whether the action succeeded. | * \return Whether the action succeeded. | ||||
| * \note The location is not updated with the velocity and | |||||
| * remains constant until the next call of this method. | |||||
| */ | */ | ||||
| virtual bool setSourceLocation(const AUD_Vector3& location)=0; | virtual bool setLocation(const Vector3& location)=0; | ||||
| /** | /** | ||||
| * Retrieves the velocity of a source. | * Retrieves the velocity of the source. | ||||
| * \return The velocity. | * \return The velocity. | ||||
| */ | */ | ||||
| virtual AUD_Vector3 getSourceVelocity()=0; | virtual Vector3 getVelocity()=0; | ||||
| /** | /** | ||||
| * Sets the velocity of a source. | * Sets the velocity of the source. | ||||
| * \param velocity The new velocity. | * \param velocity The new velocity. | ||||
| * \return Whether the action succeeded. | * \return Whether the action succeeded. | ||||
| * \note This velocity does not change the position of the listener | |||||
| * over time, it is simply used for the calculation of the doppler effect. | |||||
| */ | */ | ||||
| virtual bool setSourceVelocity(const AUD_Vector3& velocity)=0; | virtual bool setVelocity(const Vector3& velocity)=0; | ||||
| /** | /** | ||||
| * Retrieves the orientation of a source. | * Retrieves the orientation of the source. | ||||
| * \return The orientation as quaternion. | * \return The orientation as quaternion. | ||||
| */ | */ | ||||
| virtual AUD_Quaternion getSourceOrientation()=0; | virtual Quaternion getOrientation()=0; | ||||
| /** | /** | ||||
| * Sets the orientation of a source. | * Sets the orientation of the source. | ||||
| * \param orientation The new orientation as quaternion. | * \param orientation The new orientation as quaternion. | ||||
| * \return Whether the action succeeded. | * \return Whether the action succeeded. | ||||
| * \note The coordinate system used is right handed and the source | |||||
| * by default is oriented looking in the negative z direction with the | |||||
| * positive y axis as up direction. | |||||
| * \note This setting currently only affects sounds with non-default cone settings. | |||||
| */ | */ | ||||
| virtual bool setSourceOrientation(const AUD_Quaternion& orientation)=0; | virtual bool setOrientation(const Quaternion& orientation)=0; | ||||
| /** | /** | ||||
| Context not available. | |||||
| * to the listener. | * to the listener. | ||||
| * \param relative Whether the source is relative. | * \param relative Whether the source is relative. | ||||
| * \return Whether the action succeeded. | * \return Whether the action succeeded. | ||||
| * \note The default value is true as this setting is used to play sounds ordinarily without 3D. | |||||
| */ | */ | ||||
| virtual bool setRelative(bool relative)=0; | virtual bool setRelative(bool relative)=0; | ||||
| Context not available. | |||||
| virtual bool setAttenuation(float factor)=0; | virtual bool setAttenuation(float factor)=0; | ||||
| /** | /** | ||||
| * Retrieves the outer angle of the cone of a source. | * Retrieves the outer opening angle of the cone of a source. | ||||
| * \return The outer angle of the cone. | * \return The outer angle of the cone. | ||||
| * \note This angle is defined in degrees. | |||||
| */ | */ | ||||
| virtual float getConeAngleOuter()=0; | virtual float getConeAngleOuter()=0; | ||||
| /** | /** | ||||
| * Sets the outer angle of the cone of a source. | * Sets the outer opening angle of the cone of a source. | ||||
| * \param angle The new outer angle of the cone. | * \param angle The new outer angle of the cone. | ||||
| * \return Whether the action succeeded. | * \return Whether the action succeeded. | ||||
| * \note This angle is defined in degrees. | |||||
| */ | */ | ||||
| virtual bool setConeAngleOuter(float angle)=0; | virtual bool setConeAngleOuter(float angle)=0; | ||||
| /** | /** | ||||
| * Retrieves the inner angle of the cone of a source. | * Retrieves the inner opening angle of the cone of a source. | ||||
| * The volume inside this cone is unaltered. | |||||
| * \return The inner angle of the cone. | * \return The inner angle of the cone. | ||||
| * \note This angle is defined in degrees. | |||||
| */ | */ | ||||
| virtual float getConeAngleInner()=0; | virtual float getConeAngleInner()=0; | ||||
| /** | /** | ||||
| * Sets the inner angle of the cone of a source. | * Sets the inner opening angle of the cone of a source. | ||||
| * The volume inside this cone is unaltered. | |||||
| * \param angle The new inner angle of the cone. | * \param angle The new inner angle of the cone. | ||||
| * \return Whether the action succeeded. | * \return Whether the action succeeded. | ||||
| * \note This angle is defined in degrees. | |||||
| */ | */ | ||||
| virtual bool setConeAngleInner(float angle)=0; | virtual bool setConeAngleInner(float angle)=0; | ||||
| Context not available. | |||||
| * The volume between inner and outer angle is interpolated between inner | * The volume between inner and outer angle is interpolated between inner | ||||
| * volume and this value. | * volume and this value. | ||||
| * \return The outer volume of the cone. | * \return The outer volume of the cone. | ||||
| * \note The general volume of the handle still applies on top of this. | |||||
| */ | */ | ||||
| virtual float getConeVolumeOuter()=0; | virtual float getConeVolumeOuter()=0; | ||||
| Context not available. | |||||
| * volume and this value. | * volume and this value. | ||||
| * \param volume The new outer volume of the cone. | * \param volume The new outer volume of the cone. | ||||
| * \return Whether the action succeeded. | * \return Whether the action succeeded. | ||||
| * \note The general volume of the handle still applies on top of this. | |||||
| */ | */ | ||||
| virtual bool setConeVolumeOuter(float volume)=0; | virtual bool setConeVolumeOuter(float volume)=0; | ||||
| }; | }; | ||||
| #endif //__AUD_I3DHANDLE_H__ | AUD_NAMESPACE_END | ||||
| Context not available. | |||||