MCPcopy
hub / github.com/g3n/engine / Render

Method Render

audio/player.go:298–309  ·  view source on GitHub ↗

Render satisfies the INode interface. It is called by renderer at every frame and is used to update the audio source position and direction

(gl *gls.GLS)

Source from the content-addressed store, hash-verified

296// It is called by renderer at every frame and is used to
297// update the audio source position and direction
298func (p *Player) Render(gl *gls.GLS) {
299
300 // Sets the player source world position
301 var wpos math32.Vector3
302 p.WorldPosition(&wpos)
303 al.Source3f(p.source, al.Position, wpos.X, wpos.Y, wpos.Z)
304
305 // Sets the player source world direction
306 var wdir math32.Vector3
307 p.WorldDirection(&wdir)
308 al.Source3f(p.source, al.Direction, wdir.X, wdir.Y, wdir.Z)
309}
310
311// Goroutine to fill PCM buffers with decoded data for OpenAL
312func (p *Player) run() {

Callers

nothing calls this directly

Calls 3

Source3fFunction · 0.92
WorldPositionMethod · 0.80
WorldDirectionMethod · 0.80

Tested by

no test coverage detected