natiny_entity_look_at

C
void natiny_entity_look_at(NatinyEntity node, float tx, float ty, float tz, float upx, float upy, float upz);

Orients a node to face a target point.

Parameters

Name Type Description
node NatinyEntity Entity handle
tx float Target position X
ty float Target position Y
tz float Target position Z
upx float Up vector X
upy float Up vector Y
upz float Up vector Z

Example

C
natiny_entity_look_at(node, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);

Notes

  • If the node is already at the target, or the up vector is parallel to the viewing direction, the call leaves its rotation unchanged.