public void Set3DPosition(UnityEngine.Vector3 speakerPos, UnityEngine.Vector3 listenerPos, UnityEngine.Vector3 listenerAtOrient, UnityEngine.Vector3 listenerUpOrient) { if (Channel.Type != ChannelType.Positional) { throw new InvalidOperationException($"{GetType().Name}: Set3DPosition() failed for InvalidState: Channel must be Positional."); } if (!(VxClient.Instance.Started)) { throw new InvalidOperationException($"{GetType().Name}: Set3DPosition() failed for InvalidClient: The Client must be Started"); } if (!((AudioState == ConnectionState.Connected && (TextState == ConnectionState.Connected || TextState == ConnectionState.Disconnected)) || (TextState == ConnectionState.Connected && AudioState == ConnectionState.Disconnected))) { throw new InvalidOperationException($"{GetType().Name}: Set3DPosition() failed for InvalidState: The channel's AudioState must be connected"); } var request = new vx_req_session_set_3d_position_t(); request.session_handle = _sessionHandle; request.Set3DPosition( new float[3] { speakerPos.x, speakerPos.y, speakerPos.z }, new float[3] { listenerPos.x, listenerPos.y, listenerPos.z }, new float[3] { listenerAtOrient.x, listenerAtOrient.y, listenerAtOrient.z }, new float[3] { listenerUpOrient.x, listenerUpOrient.y, listenerUpOrient.z } ); VxClient.Instance.BeginIssueRequest(request, result => { try { VxClient.Instance.EndIssueRequest(result); } catch (Exception e) { VivoxDebug.Instance.VxExceptionMessage($"{request.GetType().Name} failed: {e}"); if (VivoxDebug.Instance.throwInternalExcepetions) { throw; } } }); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(vx_req_session_set_3d_position_t obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }