example/physics.js
function getModelMatrix (rb) {
  var ms = rb.getMotionState()

  if (ms) {
    ms.getWorldTransform(transformTemp)
    var p = transformTemp.getOrigin()
    var q = transformTemp.getRotation()

    return mat4.fromRotationTranslation(
      [], [q.x(), q.y(), q.z(), q.w()], [p.x(), p.y(), p.z()])
  }
}
function getModelMatrix (rb) {
  var ms = rb.getMotionState()

  if (ms) {
    ms.getWorldTransform(transformTemp)
    var p = transformTemp.getOrigin()
    var q = transformTemp.getRotation()

    return mat4.fromRotationTranslation(
      [], [q.x(), q.y(), q.z(), q.w()], [p.x(), p.y(), p.z()])
  }
}
function getModelMatrix ( rb ) { var ms = rb . getMotionState ( ) if ( ms ) { ms . getWorldTransform ( transformTemp ) var p = transformTemp . getOrigin ( ) var q = transformTemp . getRotation ( ) return mat4 . fromRotationTranslation ( [ ] , [ q . x ( ) , q . y ( ) , q . z ( ) , q . w ( ) ] , [ p . x ( ) , p . y ( ) , p . z ( ) ] ) } }
extracts the model matrix from a rigid body.
extracts the model matrix from a rigid body .