Jump to content

[SOLVED] The movement of an object


photo

Recommended Posts

tu.xiaomi,

Sample with simplest implementation attached.

 

In update() func.

if(engine.app.getKeyState('w')) {
        Vec3 pos = node_ref.getWorldPosition();
        Vec3 direction = node_ref.getWorldRotation() * vec3(0.0f,-1.0f,0.0f);
        node_ref.setWorldPosition(pos + direction / 100.0f);
}
...

etc.

 

 

You can find more in sdk samples.

Please check for example samples/physics/car_* (implementation through physics) or samples/players/actor_*

 

Otherwise, please specify your question.

wasd.rar

Link to comment
×
×
  • Create New...