Use local listener orientation buffers

This commit is contained in:
Brandon McGinty (chatgpt)
2026-08-09 15:13:29 -04:00
committed by Brandon McGinty
parent cbc6369071
commit a03800fbbc
2 changed files with 6 additions and 16 deletions
+6 -14
View File
@@ -127,22 +127,14 @@ func (self Listener) GetVelocity(result *Vector) {
// Convenience method, see Listener.Setfv().
func (self Listener) SetOrientation(at *Vector, up *Vector) {
tempSlice[0] = at[x]
tempSlice[1] = at[y]
tempSlice[2] = at[z]
tempSlice[3] = up[x]
tempSlice[4] = up[y]
tempSlice[5] = up[z]
self.Setfv(AlOrientation, tempSlice)
values := [6]float32{at[x], at[y], at[z], up[x], up[y], up[z]}
self.Setfv(AlOrientation, values[:])
}
// Convenience method, see Listener.Getfv().
func (self Listener) GetOrientation(resultAt, resultUp *Vector) {
self.Getfv(AlOrientation, tempSlice)
resultAt[x] = tempSlice[0]
resultAt[y] = tempSlice[1]
resultAt[z] = tempSlice[2]
resultUp[x] = tempSlice[3]
resultUp[y] = tempSlice[4]
resultUp[z] = tempSlice[5]
var values [6]float32
self.Getfv(AlOrientation, values[:])
resultAt[x], resultAt[y], resultAt[z] = values[0], values[1], values[2]
resultUp[x], resultUp[y], resultUp[z] = values[3], values[4], values[5]
}
-2
View File
@@ -17,8 +17,6 @@ import "strings"
// Convenience Interface.
type Vector [3]float32
var tempSlice = make([]float32, 6)
const (
x = iota
y