MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / lookAt

Method lookAt

Engine/source/T3D/camera.cpp:1751–1762  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1749//----------------------------------------------------------------------------
1750
1751void Camera::lookAt( const Point3F& pos )
1752{
1753 Point3F vec;
1754 mObjToWorld.getColumn(3, &mPosition);
1755 vec = pos - mPosition;
1756 vec.normalizeSafe();
1757 F32 pitch, yaw;
1758 MathUtils::getAnglesFromVector(vec, yaw, pitch);
1759 mRot.x = -pitch;
1760 mRot.z = yaw;
1761 _setPosition(mPosition, mRot);
1762}
1763
1764//----------------------------------------------------------------------------
1765

Callers 1

camera.cppFile · 0.45

Calls 3

getAnglesFromVectorFunction · 0.85
getColumnMethod · 0.80
normalizeSafeMethod · 0.45

Tested by

no test coverage detected