Removing Listener

parent 75c64e1a
......@@ -613,10 +613,10 @@ void get_tracker_connected( int nlhs, mxArray *plhs[], int nrhs, const mxArray *
return;
}
// Tracked listener
// Tracked sound receiver
REGISTER_PRIVATE_FUNCTION( set_tracked_sound_receiver );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_sound_receiver, soundreceiverID, "scalar number", "Tracked listener ID" );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_sound_receiver, soundreceiverID, "scalar number", "Tracked sound receiver ID" );
void set_tracked_sound_receiver( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
......@@ -629,7 +629,7 @@ void set_tracked_sound_receiver( int nlhs, mxArray *plhs[], int nrhs, const mxAr
}
REGISTER_PRIVATE_FUNCTION( set_tracked_sound_receiver_rigid_body_index );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_sound_receiver_rigid_body_index, index, "scalar number", "Tracked listener rigid body index (default is 1)" );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_sound_receiver_rigid_body_index, index, "scalar number", "Tracked sound receiver rigid body index (default is 1)" );
void set_tracked_sound_receiver_rigid_body_index( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
......@@ -639,11 +639,11 @@ void set_tracked_sound_receiver_rigid_body_index( int nlhs, mxArray *plhs[], int
int iTrackedRigidBodyIndex = matlabGetIntegerScalar( prhs[ 1 ], "index" );
pConnection->pVAMatlabTracker->iTrackedListenerRigidBodyIndex = iTrackedRigidBodyIndex;
pConnection->pVAMatlabTracker->iTrackedSoundReceiverRigidBodyIndex = iTrackedRigidBodyIndex;
}
REGISTER_PRIVATE_FUNCTION( set_tracked_sound_receiver_rigid_body_translation );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_sound_receiver_rigid_body_translation, offset, "real 1x3", "Tracked listener rigid body position offset" );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_sound_receiver_rigid_body_translation, offset, "real 1x3", "Tracked sound receiver rigid body position offset" );
void set_tracked_sound_receiver_rigid_body_translation( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
......@@ -658,7 +658,7 @@ void set_tracked_sound_receiver_rigid_body_translation( int nlhs, mxArray *plhs[
}
REGISTER_PRIVATE_FUNCTION( set_tracked_sound_receiver_rigid_body_rotation );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_sound_receiver_rigid_body_rotation, rotation, "real 1x4", "Tracked listener rigid body rotation (quaternion values with w (real), i, j, k)" );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_sound_receiver_rigid_body_rotation, rotation, "real 1x4", "Tracked sound receiver rigid body rotation (quaternion values with w (real), i, j, k)" );
void set_tracked_sound_receiver_rigid_body_rotation( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
......@@ -669,10 +669,10 @@ void set_tracked_sound_receiver_rigid_body_rotation( int nlhs, mxArray *plhs[],
VAQuat qOrient;
matlabGetQuaternion( prhs[ 1 ], "rotation", qOrient );
pConnection->pVAMatlabTracker->qTrackedListenerRotation = VistaQuaternion( qOrient.x, qOrient.y, qOrient.z, qOrient.w );
pConnection->pVAMatlabTracker->qTrackedSoundReceiverRotation = VistaQuaternion( qOrient.x, qOrient.y, qOrient.z, qOrient.w );
}
// Tracked real-world listener
// Tracked real-world sound receiver
REGISTER_PRIVATE_FUNCTION( set_tracked_real_world_sound_receiver );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_real_world_sound_receiver, realworldsoundreceiverID, "scalar number", "Tracked real-world sound receiver ID" );
......@@ -688,9 +688,9 @@ void set_tracked_real_world_sound_receiver( int nlhs, mxArray *plhs[], int nrhs,
pConnection->pVAMatlabTracker->iTrackedRealWorldSoundReceiverID = iRealWorldsoundreceiverID;
}
REGISTER_PRIVATE_FUNCTION( set_tracked_real_world_listener_rigid_body_index );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_real_world_listener_rigid_body_index, index, "scalar number", "Tracked real-world sound receiver rigid body index (default is 1)" );
void set_tracked_real_world_listener_rigid_body_index( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
REGISTER_PRIVATE_FUNCTION( set_tracked_real_world_sound_receiver_rigid_body_index );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_real_world_sound_receiver_rigid_body_index, index, "scalar number", "Tracked real-world sound receiver rigid body index (default is 1)" );
void set_tracked_real_world_sound_receiver_rigid_body_index( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
......@@ -699,12 +699,12 @@ void set_tracked_real_world_listener_rigid_body_index( int nlhs, mxArray *plhs[]
int iTrackedRigidBodyIndex = matlabGetIntegerScalar( prhs[ 1 ], "index" );
pConnection->pVAMatlabTracker->iTrackedRealWorldListenerRigidBodyIndex = iTrackedRigidBodyIndex;
pConnection->pVAMatlabTracker->iTrackedRealWorldSoundReceiverRigidBodyIndex = iTrackedRigidBodyIndex;
}
REGISTER_PRIVATE_FUNCTION( set_tracked_real_world_listener_rigid_body_translation );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_real_world_listener_rigid_body_translation, offset, "real 1x3", "Tracked real-world listener rigid body position offset" );
void set_tracked_real_world_listener_rigid_body_translation( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
REGISTER_PRIVATE_FUNCTION( set_tracked_real_world_sound_receiver_rigid_body_translation );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_real_world_sound_receiver_rigid_body_translation, offset, "real 1x3", "Tracked real-world sound receiver rigid body position offset" );
void set_tracked_real_world_sound_receiver_rigid_body_translation( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
......@@ -714,12 +714,12 @@ void set_tracked_real_world_listener_rigid_body_translation( int nlhs, mxArray *
VAVec3 v3Pos;
matlabGetRealVector3( prhs[ 1 ], "offset", v3Pos );
pConnection->pVAMatlabTracker->vTrackedRealWorldListenerTranslation = VistaVector3D( v3Pos.x, v3Pos.y, v3Pos.z );
pConnection->pVAMatlabTracker->vTrackedRealWorldSoundReceiverTranslation = VistaVector3D( v3Pos.x, v3Pos.y, v3Pos.z );
}
REGISTER_PRIVATE_FUNCTION( set_tracked_real_world_listener_rigid_body_rotation );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_real_world_listener_rigid_body_rotation, rotation, "real 1x4", "Tracked real-world sound receiver rigid body rotation (quaternion values with w (real), i, j, k)" );
void set_tracked_real_world_listener_rigid_body_rotation( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
REGISTER_PRIVATE_FUNCTION( set_tracked_real_world_sound_receiver_rigid_body_rotation );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_real_world_sound_receiver_rigid_body_rotation, rotation, "real 1x4", "Tracked real-world sound receiver rigid body rotation (quaternion values with w (real), i, j, k)" );
void set_tracked_real_world_sound_receiver_rigid_body_rotation( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
......@@ -729,7 +729,7 @@ void set_tracked_real_world_listener_rigid_body_rotation( int nlhs, mxArray *plh
VAQuat qOrient;
matlabGetQuaternion( prhs[ 1 ], "rotation", qOrient );
pConnection->pVAMatlabTracker->qTrackedRealWorldListenerRotation = VistaQuaternion( qOrient.x, qOrient.y, qOrient.z, qOrient.w );
pConnection->pVAMatlabTracker->qTrackedRealWorldSoundReceiverRotation = VistaQuaternion( qOrient.x, qOrient.y, qOrient.z, qOrient.w );
}
// Tracked source
......@@ -1469,11 +1469,11 @@ void get_sound_source_name( int nlhs, mxArray *plhs[], int nrhs, const mxArray *
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( get_sound_source_name, "Name", "" );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_source_name, soundSourceID, "integer-1x1", "Sound source ID" );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_source_name, name, "string", "Displayed name" );
REGISTER_PUBLIC_FUNCTION( set_sound_source_name, "Name", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_source_name, soundSourceID, "integer-1x1", "Sound source ID" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_source_name, name, "string", "Displayed name" );
void get_sound_source_name( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
void set_sound_source_name( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
REQUIRE_INPUT_ARGS( 3 );
......@@ -1940,7 +1940,7 @@ void create_sound_receiver( int nlhs, mxArray *plhs[], int nrhs, const mxArray *
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( delete_sound_receiver, "Deletes a listener from the scene", "Note: The active listener cannot be deleted!" );
REGISTER_PUBLIC_FUNCTION( delete_sound_receiver, "Deletes a sound receiver from the scene", "Note: The active sound receiver cannot be deleted!" );
DECLARE_FUNCTION_REQUIRED_INARG( delete_sound_receiver, soundreceiverID, "integer-1x1", "Sound receiver ID" );
void delete_sound_receiver( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
......@@ -1956,7 +1956,7 @@ void delete_sound_receiver( int nlhs, mxArray *plhs[], int nrhs, const mxArray *
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_name, "Returns name of a listener", "" );
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_name, "Returns name of a sound receiver", "" );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_receiver_name, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_OUTARG( get_sound_receiver_name, name, "string", "Displayed name" );
......@@ -1975,7 +1975,7 @@ void get_sound_receiver_name( int nlhs, mxArray *plhs[], int nrhs, const mxArray
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_name, "Sets the name of a listener", "" );
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_name, "Sets the name of a sound receiver", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_name, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_name, name, "string", "Displayed name" );
......@@ -1994,7 +1994,7 @@ void set_sound_receiver_name( int nlhs, mxArray *plhs[], int nrhs, const mxArray
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_auralization_mode, "Returns the auralization mode of a listener", "" );
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_auralization_mode, "Returns the auralization mode of a sound receiver", "" );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_receiver_auralization_mode, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_OUTARG( get_sound_receiver_auralization_mode, auralizationMode, "string", "Auralization mode" );
......@@ -2015,7 +2015,7 @@ void get_sound_receiver_auralization_mode( int nlhs, mxArray *plhs[], int nrhs,
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_auralization_mode, "Sets the auralization mode of a listener", "" );
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_auralization_mode, "Sets the auralization mode of a sound receiver", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_auralization_mode, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_auralization_mode, auralizationMode, "string", "Auralization mode" );
......@@ -2038,8 +2038,8 @@ void set_sound_receiver_auralization_mode( int nlhs, mxArray *plhs[], int nrhs,
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_parameters, "Returns the current listener parameters", "" );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_receiver_parameters, ID, "integer-1x1", "Listener identifier" );
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_parameters, "Returns the current sound receiver parameters", "" );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_receiver_parameters, ID, "integer-1x1", "Sound receiver identifier" );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_receiver_parameters, args, "mstruct", "Requested parameters" );
DECLARE_FUNCTION_OUTARG( get_sound_receiver_parameters, params, "mstruct", "Parameters" );
void get_sound_receiver_parameters( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
......@@ -2057,8 +2057,8 @@ void get_sound_receiver_parameters( int nlhs, mxArray *plhs[], int nrhs, const m
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_parameters, "Sets listener parameters", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_parameters, ID, "integer-1x1", "Listener identifier" );
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_parameters, "Sets sound receiver parameters", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_parameters, ID, "integer-1x1", "Sound receiver identifier" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_parameters, params, "mstruct", "Parameters" );
void set_sound_receiver_parameters( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
......@@ -2075,7 +2075,7 @@ void set_sound_receiver_parameters( int nlhs, mxArray *plhs[], int nrhs, const m
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_directivity, "Returns for a listener the assigned directivity", "" );
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_directivity, "Returns for a sound receiver the assigned directivity", "" );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_receiver_directivity, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_OUTARG( get_sound_receiver_directivity, directivityID, "integer-1x1", "Directivity ID" );
......@@ -2093,7 +2093,7 @@ void get_sound_receiver_directivity( int nlhs, mxArray *plhs[], int nrhs, const
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_directivity, "Set the directivity of a listener", "Note: In order to set no HRIR dataset, you can pass -1 to the method. In this case the listener will be silent." );
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_directivity, "Set the directivity of a sound receiver", "Note: In order to set no HRIR dataset, you can pass -1 to the method. In this case the sound receiver will be silent." );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_directivity, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_directivity, directivityID, "integer-1x1", "HRIR dataset ID" );
......@@ -2112,7 +2112,7 @@ void set_sound_receiver_directivity( int nlhs, mxArray *plhs[], int nrhs, const
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_position, "Returns the position of a listener", "" );
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_position, "Returns the position of a sound receiver", "" );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_receiver_position, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_OUTARG( get_sound_receiver_position, pos, "double-3", "Position vector [x,y,z] (unit: meters)" );
......@@ -2131,7 +2131,7 @@ void get_sound_receiver_position( int nlhs, mxArray *plhs[], int nrhs, const mxA
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_orientation, "Returns the orientation of a listener", "" );
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_orientation, "Returns the orientation of a sound receiver", "" );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_receiver_orientation, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_OUTARG( get_sound_receiver_orientation, orient, "double-4", "Rotation angles [w,x,y,z]" );
......@@ -2150,7 +2150,7 @@ void get_sound_receiver_orientation( int nlhs, mxArray *plhs[], int nrhs, const
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_orientation_view_up, "Returns the orientation of a listener (as view- and up-vector)", "Note: The view and up vector must be an orthonormal pair of vectors." );
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_orientation_view_up, "Returns the orientation of a sound receiver (as view- and up-vector)", "Note: The view and up vector must be an orthonormal pair of vectors." );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_receiver_orientation_view_up, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_OUTARG( get_sound_receiver_orientation_view_up, view, "double-3", "View vector" );
DECLARE_FUNCTION_OUTARG( get_sound_receiver_orientation_view_up, up, "double-3", "Up vector" );
......@@ -2172,7 +2172,7 @@ void get_sound_receiver_orientation_view_up( int nlhs, mxArray *plhs[], int nrhs
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_pose, "Returns the position and orientation of a listener", "" );
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_pose, "Returns the position and orientation of a sound receiver", "" );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_receiver_pose, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_OUTARG( get_sound_receiver_pose, pos, "double-3", "Position vector [x,y,z] (unit: meters)" );
DECLARE_FUNCTION_OUTARG( get_sound_receiver_pose, ypr, "double-4", "Rotation quaternion [w,x,y,z]" );
......@@ -2196,11 +2196,10 @@ void get_sound_receiver_pose( int nlhs, mxArray *plhs[], int nrhs, const mxArray
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_position, "Sets the position of a listener", "" );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_receiver_position, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_receiver_position, pos, "double-3", "Position vector [x,y,z] (unit: meters)" );
void get_sound_receiver_position( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_position, "Sets the position of a sound receiver", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_position, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_position, pos, "double-3", "Position vector [x,y,z] (unit: meters)" );
void set_sound_receiver_position( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
REQUIRE_INPUT_ARGS( 3 );
......@@ -2216,7 +2215,7 @@ void get_sound_receiver_position( int nlhs, mxArray *plhs[], int nrhs, const mxA
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_orientation, "Sets the orientation of a listener", "" );
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_orientation, "Sets the orientation of a sound receiver", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_orientation, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_orientation, orient, "double-4", "Rotation quaternion [w,x,y,z]" );
......@@ -2236,7 +2235,7 @@ void set_sound_receiver_orientation( int nlhs, mxArray *plhs[], int nrhs, const
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_orientation_view_up, "Sets the orientation of a listener (as view- and up-vector)", "Note: The view and up vector must be an orthonormal pair of vectors." );
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_orientation_view_up, "Sets the orientation of a sound receiver (as view- and up-vector)", "Note: The view and up vector must be an orthonormal pair of vectors." );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_orientation_view_up, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_orientation_view_up, view, "double-3", "View vector" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_orientation_view_up, up, "double-3", "Up vector" );
......@@ -2258,7 +2257,7 @@ void set_sound_receiver_orientation_view_up( int nlhs, mxArray *plhs[], int nrhs
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_pose, "Sets the position and orientation (in yaw-pitch-roll angles) of a listener", "" );
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_pose, "Sets the position and orientation (in yaw-pitch-roll angles) of a sound receiver", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_pose, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_pose, pos, "double-3", "Position vector [x, y, z] (unit: meters)" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_pose, ypr, "double-4", "Rotation angles [w,x,y,z]" );
......@@ -2280,7 +2279,7 @@ void set_sound_receiver_pose( int nlhs, mxArray *plhs[], int nrhs, const mxArray
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_real_world_head_position_orientation_view_up, "Returns the real-world position and orientation (as view- and up vector) of the listener's head", "Note: The view and up vector must be an orthonormal pair of vectors. The parameter isoundreceiverID has been added for future versions and is currently unsupported. You can set it any value you like." );
REGISTER_PUBLIC_FUNCTION( get_sound_receiver_real_world_head_position_orientation_view_up, "Returns the real-world position and orientation (as view- and up vector) of the sound receiver's head", "Note: The view and up vector must be an orthonormal pair of vectors. The parameter isoundreceiverID has been added for future versions and is currently unsupported. You can set it any value you like." );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_receiver_real_world_head_position_orientation_view_up, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_OUTARG( get_sound_receiver_real_world_head_position_orientation_view_up, pos, "double-3", "Position vector [x,y,z] (unit: meters)" );
DECLARE_FUNCTION_OUTARG( get_sound_receiver_real_world_head_position_orientation_view_up, view, "double-3", "View vector" );
......@@ -2303,7 +2302,7 @@ void get_sound_receiver_real_world_head_position_orientation_view_up( int nlhs,
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_real_world_position_orientation_view_up, "Updates the real-world position and orientation (as view- and up vector) of the listener's head", "Note: The view and up vector must be an orthonormal pair of vectors." );
REGISTER_PUBLIC_FUNCTION( set_sound_receiver_real_world_position_orientation_view_up, "Updates the real-world position and orientation (as view- and up vector) of the sound receiver's head", "Note: The view and up vector must be an orthonormal pair of vectors." );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_real_world_position_orientation_view_up, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_real_world_position_orientation_view_up, pos, "double-3", "Position vector [x, y, z] (unit: meters)" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_real_world_position_orientation_view_up, view, "double-3", "View vector" );
......@@ -2555,26 +2554,25 @@ void set_global_auralization_mode( int nlhs, mxArray *plhs[], int nrhs, const mx
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( get_active_listener, "Returns the active listener", "" );
DECLARE_FUNCTION_OUTARG( get_active_listener, soundreceiverID, "integer-1x1", "Sound receiver ID" );
void get_active_listener( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
REGISTER_PUBLIC_FUNCTION( get_active_sound_receiver, "Returns the active sound receiver", "" );
DECLARE_FUNCTION_OUTARG( get_active_sound_receiver, soundreceiverID, "integer-1x1", "Sound receiver ID" );
void get_active_sound_receiver( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
REQUIRE_INPUT_ARGS( 1 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
int isoundreceiverID = pConnection->pCoreInterface->GetActiveListener();
int isoundreceiverID = pConnection->pCoreInterface->GetActiveSoundReceiver();
plhs[ 0 ] = matlabCreateID( isoundreceiverID );
}
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( set_active_listener, "Sets the active listener", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_active_listener, soundreceiverID, "integer-1x1", "Sound receiver ID" );
REGISTER_PUBLIC_FUNCTION( set_active_sound_receiver, "Sets the active sound receiver", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_active_sound_receiver, soundreceiverID, "integer-1x1", "Sound receiver ID" );
void set_active_listener( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
void set_active_sound_receiver( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
REQUIRE_INPUT_ARGS( 2 );
......@@ -2583,7 +2581,7 @@ void set_active_listener( int nlhs, mxArray *plhs[], int nrhs, const mxArray *pr
int isoundreceiverID = matlabGetIntegerScalar( prhs[ 1 ], "soundreceiverID" );
pConnection->pCoreInterface->SetActiveListener( isoundreceiverID );
pConnection->pCoreInterface->SetActiveSoundReceiver( isoundreceiverID );
}
// ------------------------------------------------------------
......
......@@ -32,16 +32,16 @@ void TrackerDataHandler( sFrameOfMocapData* sFrame, void* pUserData )
if( !pVACore )
return;
// Listener
// SoundReceiver
int iTrackedReceiverID = pVAMatlabTracker->iTrackedSoundReceiverID;
int iTrackedReceiverRigidBodyIndex = pVAMatlabTracker->iTrackedListenerRigidBodyIndex;
int iTrackedReceiverRigidBodyIndex = pVAMatlabTracker->iTrackedSoundReceiverRigidBodyIndex;
if( ( iTrackedReceiverID != -1 ) && ( iTrackedReceiverRigidBodyIndex <= sFrame->nRigidBodies ) && ( iTrackedReceiverRigidBodyIndex > 0 ) )
{
try
{
VistaVector3D vPosOffsetLocalCoordinateSystem = pVAMatlabTracker->vTrackedSoundReceiverTranslation;
VistaQuaternion qOrientRotation = pVAMatlabTracker->qTrackedListenerRotation;
VistaQuaternion qOrientRotation = pVAMatlabTracker->qTrackedSoundReceiverRotation;
const sRigidBodyData& oBodyData( sFrame->RigidBodies[ iTrackedReceiverRigidBodyIndex - 1 ] );
VistaVector3D vPosPivotPoint( oBodyData.x, oBodyData.y, oBodyData.z );
......@@ -64,16 +64,16 @@ void TrackerDataHandler( sFrameOfMocapData* sFrame, void* pUserData )
// Real-world listener
int iTrackedRealWorldSoundReceiverID = pVAMatlabTracker->iTrackedRealWorldSoundReceiverID;
int iTrackedRealWorldListenerRigidBodyIndex = pVAMatlabTracker->iTrackedRealWorldListenerRigidBodyIndex;
int iTrackedRealWorldSoundReceiverRigidBodyIndex = pVAMatlabTracker->iTrackedRealWorldSoundReceiverRigidBodyIndex;
if( ( iTrackedRealWorldSoundReceiverID != -1 ) && ( iTrackedRealWorldListenerRigidBodyIndex <= sFrame->nRigidBodies ) && ( iTrackedRealWorldListenerRigidBodyIndex > 0 ) )
if( ( iTrackedRealWorldSoundReceiverID != -1 ) && ( iTrackedRealWorldSoundReceiverRigidBodyIndex <= sFrame->nRigidBodies ) && ( iTrackedRealWorldSoundReceiverRigidBodyIndex > 0 ) )
{
try
{
VistaVector3D vPosOffsetLocalCoordinateSystem = pVAMatlabTracker->vTrackedRealWorldListenerTranslation;
VistaQuaternion qOrientRotation = pVAMatlabTracker->qTrackedRealWorldListenerRotation;
VistaVector3D vPosOffsetLocalCoordinateSystem = pVAMatlabTracker->vTrackedRealWorldSoundReceiverTranslation;
VistaQuaternion qOrientRotation = pVAMatlabTracker->qTrackedRealWorldSoundReceiverRotation;
const sRigidBodyData& oBodyData( sFrame->RigidBodies[ iTrackedRealWorldListenerRigidBodyIndex - 1 ] );
const sRigidBodyData& oBodyData( sFrame->RigidBodies[ iTrackedRealWorldSoundReceiverRigidBodyIndex - 1 ] );
VistaVector3D vPosPivotPoint( oBodyData.x, oBodyData.y, oBodyData.z );
VistaQuaternion qOrientRaw( oBodyData.qx, oBodyData.qy, oBodyData.qz, oBodyData.qw );
......@@ -136,14 +136,14 @@ CVAMatlabTracker::CVAMatlabTracker()
void CVAMatlabTracker::Reset()
{
iTrackedSoundReceiverID = -1;
iTrackedListenerRigidBodyIndex = 1;
iTrackedSoundReceiverRigidBodyIndex = 1;
vTrackedSoundReceiverTranslation.SetToZeroVector();
qTrackedListenerRotation.SetToNeutralQuaternion();
qTrackedSoundReceiverRotation.SetToNeutralQuaternion();
iTrackedRealWorldSoundReceiverID = -1;
iTrackedRealWorldListenerRigidBodyIndex = 1;
vTrackedRealWorldListenerTranslation.SetToZeroVector();
qTrackedRealWorldListenerRotation.SetToNeutralQuaternion();
iTrackedRealWorldSoundReceiverRigidBodyIndex = 1;
vTrackedRealWorldSoundReceiverTranslation.SetToZeroVector();
qTrackedRealWorldSoundReceiverRotation.SetToNeutralQuaternion();
iTrackedSourceID = -1;
iTrackedSourceRigidBodyIndex = 1;
......
......@@ -38,14 +38,14 @@ public:
IVAInterface* pVACore; //!< Pointer to (networked) core instance
int iTrackedSoundReceiverID; //!< -1 if deactivated, will be preferred over source
int iTrackedListenerRigidBodyIndex; //!< Starts with 1 (default)
int iTrackedSoundReceiverRigidBodyIndex; //!< Starts with 1 (default)
VistaVector3D vTrackedSoundReceiverTranslation; //!< Position offset from pivot point (default NatNet rigid body barycenter)
VistaQuaternion qTrackedListenerRotation; //!< Orientation rotation from default orientation (initial NatNet rigid body orientation)
VistaQuaternion qTrackedSoundReceiverRotation; //!< Orientation rotation from default orientation (initial NatNet rigid body orientation)
int iTrackedRealWorldSoundReceiverID; //!< -1 if deactivated
int iTrackedRealWorldListenerRigidBodyIndex; //!< Starts with 1 (default)
VistaVector3D vTrackedRealWorldListenerTranslation; //!< Position offset from pivot point (default NatNet rigid body barycenter)
VistaQuaternion qTrackedRealWorldListenerRotation; //!< Orientation rotation from default orientation (initial NatNet rigid body orientation)
int iTrackedRealWorldSoundReceiverRigidBodyIndex; //!< Starts with 1 (default)
VistaVector3D vTrackedRealWorldSoundReceiverTranslation; //!< Position offset from pivot point (default NatNet rigid body barycenter)
VistaQuaternion qTrackedRealWorldSoundReceiverRotation; //!< Orientation rotation from default orientation (initial NatNet rigid body orientation)
int iTrackedSourceID; //!< -1 if deactivated
int iTrackedSourceRigidBodyIndex; //!< Starts with 1 (default)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment