listener-browser.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Copyright 2016 The G3N Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build wasm
  5. package audio
  6. import (
  7. "github.com/g3n/engine/core"
  8. "github.com/g3n/engine/gls"
  9. "github.com/g3n/engine/math32"
  10. )
  11. // Listener is an audio listener positioned in space.
  12. type Listener struct {
  13. core.Node
  14. }
  15. // NewListener creates a Listener object.
  16. func NewListener() *Listener {
  17. l := new(Listener)
  18. l.Node.Init(l)
  19. return l
  20. }
  21. // SetVelocity sets the velocity of the listener with x, y, z components.
  22. func (l *Listener) SetVelocity(vx, vy, vz float32) {
  23. // TODO
  24. }
  25. // SetVelocityVec sets the velocity of the listener with a vector.
  26. func (l *Listener) SetVelocityVec(v *math32.Vector3) {
  27. // TODO
  28. }
  29. // Velocity returns the velocity of the listener as x, y, z components.
  30. func (l *Listener) Velocity() (float32, float32, float32) {
  31. // TODO
  32. }
  33. // VelocityVec returns the velocity of the listener as a vector.
  34. func (l *Listener) VelocityVec() math32.Vector3 {
  35. // TODO
  36. }
  37. // SetGain sets the gain of the listener.
  38. func (l *Listener) SetGain(gain float32) {
  39. // TODO
  40. }
  41. // Gain returns the gain of the listener.
  42. func (l *Listener) Gain() float32 {
  43. // TODO
  44. }
  45. // Render is called by the renderer at each frame.
  46. // Updates the position and orientation of the listener.
  47. func (l *Listener) Render(gl *gls.GLS) {
  48. // TODO
  49. }