listener-browser.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. //go:build wasm
  5. // +build wasm
  6. package audio
  7. import (
  8. "github.com/g3n/engine/core"
  9. "github.com/g3n/engine/gls"
  10. "github.com/g3n/engine/math32"
  11. )
  12. // Listener is an audio listener positioned in space.
  13. type Listener struct {
  14. core.Node
  15. }
  16. // NewListener creates a Listener object.
  17. func NewListener() *Listener {
  18. l := new(Listener)
  19. l.Node.Init(l)
  20. return l
  21. }
  22. // SetVelocity sets the velocity of the listener with x, y, z components.
  23. func (l *Listener) SetVelocity(vx, vy, vz float32) {
  24. // TODO
  25. }
  26. // SetVelocityVec sets the velocity of the listener with a vector.
  27. func (l *Listener) SetVelocityVec(v *math32.Vector3) {
  28. // TODO
  29. }
  30. // Velocity returns the velocity of the listener as x, y, z components.
  31. func (l *Listener) Velocity() (float32, float32, float32) {
  32. // TODO
  33. }
  34. // VelocityVec returns the velocity of the listener as a vector.
  35. func (l *Listener) VelocityVec() math32.Vector3 {
  36. // TODO
  37. }
  38. // SetGain sets the gain of the listener.
  39. func (l *Listener) SetGain(gain float32) {
  40. // TODO
  41. }
  42. // Gain returns the gain of the listener.
  43. func (l *Listener) Gain() float32 {
  44. // TODO
  45. }
  46. // Render is called by the renderer at each frame.
  47. // Updates the position and orientation of the listener.
  48. func (l *Listener) Render(gl *gls.GLS) {
  49. // TODO
  50. }