Jump to content

node.setRotation method doesn't work


photo

Recommended Posts

Posted

Метод node.setRotation работает некорректно, результат эквивалентен работе метода node.setWorldRotation

Если он работает, пожалуйста дайте пример его использования.

 

Translate:

Node.setRotation method doesn't work properly, the result is equivalent to the work method node.setWorldRotation.

If it works, please give an example of its use.

 

Example (BUG):

 



Node parent = engine.world.load...
Node child = engine.world.load...
child.setParent( parent );
parent.addChild( child );

parent.setPosition( vec3( 100.0f, 0.0f, 0.0f  ) );
child.setPosition( vec3( 100.0f, 0.0f, 0.0f ) );
child.setRotation( quat( 90.0f, 90.0f, 90.0f ) );

log.message( "US: DEBUG: child.getWorldPosition() = (%s)\n", string( child.getWorldPosition() ) );

child.setWorldRotation( quat( 90.0f, 90.0f, 90.0f ) );

log.message( "US: DEBUG: child.getWorldPosition() = (%s)\n", string( child.getWorldPosition() ) );

Posted

setRotation() and setWorldRotation() functions just rotate node and don't change node position.

Your parent node has identity rotation so setRotation() and setWorldRotation() functions are equivalent this this case.

×
×
  • Create New...