azul3d / engine

Azul3D - A 3D game engine written in Go!
https://azul3d.org
Other
606 stars 54 forks source link

transform.SetQuat can panic #141

Closed azul3d-bot closed 8 years ago

azul3d-bot commented 8 years ago

Issue by jteeuwen Tuesday Jan 13, 2015 at 12:04 GMT Originally opened as https://github.com/azul3d/gfx/issues/90


Transform.SeQuatis missing a nil check before the pointer dereference and can panic as a result:

https://github.com/azul3d/gfx/blob/v2-dev/transform.go#L231:

func (t *Transform) SetQuat(q lmath.Quat) {
    t.access.Lock()
    if (*t.quat) != q {
        t.built = nil
        t.quat = &q
    }
    t.access.Unlock()
}
azul3d-bot commented 8 years ago

Comment by slimsag Wednesday Jan 14, 2015 at 07:12 GMT


Thank you for the detailed issue report.

I've fixed the issue at hand and added a test to ensure this method works.

azul3d-bot commented 8 years ago

Fixed/merged as part of https://github.com/azul3d/engine/issues/1