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

Method lookAt

Engine/source/T3D/camera.cpp:1748–1759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

camera.cppFile · 0.45

Calls 3

getAnglesFromVectorFunction · 0.85
getColumnMethod · 0.80
normalizeSafeMethod · 0.45

Tested by

no test coverage detected