SetListenerPosition() public static method

public static SetListenerPosition ( float FrontX, float FrontY, float FrontZ, float TopX, float TopY, float TopZ, float PosX, float PosY, float PosZ, uint in_ulListenerIndex ) : AKRESULT
FrontX float
FrontY float
FrontZ float
TopX float
TopY float
TopZ float
PosX float
PosY float
PosZ float
in_ulListenerIndex uint
return AKRESULT
Beispiel #1
0
    public void Update(float dt)
    {
        Vector3 forward = -this.Forward.Value;
        Vector3 up      = this.Up;
        Vector3 pos     = this.Position;

        if (forward.Equals(this.lastForward) && up.Equals(this.lastUp) && pos.Equals(this.lastPosition))
        {
            return;             // Position didn't change, no need to update.
        }
        // Update position
        AkSoundEngine.SetListenerPosition(
            forward.X,
            forward.Y,
            forward.Z,
            up.X,
            up.Y,
            up.Z,
            pos.X,
            pos.Y,
            pos.Z,
#if UNITY_PS3 && !UNITY_EDITOR
            (ulong)this.ListenerID.Value);
#else
            (uint)this.ListenerID.Value);
#endif // #if UNITY_PS3

        this.lastPosition = pos;
        this.lastUp       = up;
        this.lastForward  = forward;
    }
    void Update()
    {
        if (m_Position == transform.position && m_Front == transform.forward && m_Top == transform.up)
        {
            return;     //Position didn't change, no need to update.
        }
        m_Position = transform.position;
        m_Front    = transform.forward;
        m_Top      = transform.up;

        //Update position
        AkSoundEngine.SetListenerPosition(
            transform.forward.x,
            transform.forward.y,
            transform.forward.z,
            transform.up.x,
            transform.up.y,
            transform.up.z,
            transform.position.x,
            transform.position.y,
            transform.position.z,
#if UNITY_PS3 && !UNITY_EDITOR
            (ulong)listenerId);
#else
            (uint)listenerId);
#endif // #if UNITY_PS3
    }
Beispiel #3
0
 private void Update()
 {
     this.UpdateCache();
     if (((this.m_Position != this.m_PositionCache) || (this.m_Front != this.m_FrontCache)) || (this.m_Top != this.m_TopCache))
     {
         this.m_Position = this.m_PositionCache;
         this.m_Front    = this.m_FrontCache;
         this.m_Top      = this.m_TopCache;
         AkSoundEngine.SetListenerPosition(this.m_FrontCache.x, this.m_FrontCache.y, this.m_FrontCache.z, this.m_TopCache.x, this.m_TopCache.y, this.m_TopCache.z, this.m_PositionCache.x + this.m_StaticOffset.x, this.m_PositionCache.y + this.m_StaticOffset.y, this.m_PositionCache.z + this.m_StaticOffset.z, (uint)this.listenerId);
     }
 }
 private void Update()
 {
     if (this.m_Position == base.transform.position && this.m_Front == base.transform.forward && this.m_Top == base.transform.up)
     {
         return;
     }
     this.m_Position = base.transform.position;
     this.m_Front    = base.transform.forward;
     this.m_Top      = base.transform.up;
     AkSoundEngine.SetListenerPosition(0f, 0f, 0f, 0f, 0f, 0f, base.transform.position.x, base.transform.position.y, base.transform.position.z, (uint)this.listenerId);
 }
	private void Update()
	{
		this.UpdateCache();
		if (this.m_Position == this.m_PositionCache && this.m_Front == this.m_FrontCache && this.m_Top == this.m_TopCache)
		{
			return;
		}
		this.m_Position = this.m_PositionCache;
		this.m_Front = this.m_FrontCache;
		this.m_Top = this.m_TopCache;
		AkSoundEngine.SetListenerPosition(this.m_FrontCache.x, this.m_FrontCache.y, this.m_FrontCache.z, this.m_TopCache.x, this.m_TopCache.y, this.m_TopCache.z, this.m_PositionCache.x + this.m_StaticOffset.x, this.m_PositionCache.y + this.m_StaticOffset.y, this.m_PositionCache.z + this.m_StaticOffset.z, (uint)this.listenerId);
	}
    void Update()
    {
        if (m_Position == transform.position && m_Front == transform.forward && m_Top == transform.up)
        {
            return;     //Position didn't change, no need to update.
        }
        m_Position = transform.position;
        m_Front    = transform.forward;
        m_Top      = transform.up;

        //Update position
        AkSoundEngine.SetListenerPosition(
            transform.forward.x,
            transform.forward.y,
            transform.forward.z,
            transform.up.x,
            transform.up.y,
            transform.up.z,
            transform.position.x,
            transform.position.y,
            transform.position.z,
            (ulong)listenerId);
    }
Beispiel #7
0
 public static void SetLisenerPos(Transform tr, Vector3 offset, int idx)
 {
     AudioMgr.outerlistenidx = idx;
     AkSoundEngine.SetListenerPosition(tr.forward.x, tr.forward.y, tr.forward.z, tr.up.x, tr.up.y, tr.up.z, tr.position.x + offset.x, tr.position.y + offset.y, tr.position.z + offset.z, (uint)idx);
 }
Beispiel #8
0
 public static void SetLisenerPos_NoDir(Transform tr, Vector3 offset, int idx)
 {
     AkSoundEngine.SetListenerPosition(0f, 0f, 0f, 0f, 0f, 0f, tr.position.x + offset.x, tr.position.y + offset.y, tr.position.z + offset.z, (uint)idx);
 }