Beispiel #1
0
    void Transform::update() {
      // When we update, CLEAR THE MATRIX!
      matrix = glm::mat4( 1.0f );

      glm::mat4 mixin( 1.0f );

      if( parent ) {
        mixin = parent->matrix;
      }

      // Mixin the parent matrix
      matrix = matrix * mixin;

      // There's always going to be a translation
      matrix *= glm::translate( position );

      // Then rotate
      matrix *= glm::toMat4( rotation );

      // Then scale
      matrix *= glm::scale( scale );

      // This is now updated.
      dirty = false;
    }
Beispiel #2
0
 v8::Persistent<v8::FunctionTemplate>& JSFunctionTemplateHelper() {
     return mixin().jsFunc_;
 }