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

Method setEditOrbitPoint

Engine/source/T3D/camera.cpp:1723–1747  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1721//-----------------------------------------------------------------------------
1722
1723void Camera::setEditOrbitPoint( const Point3F& pnt )
1724{
1725 // Change the point that we orbit in EditOrbitMode.
1726 // We'll also change the facing and distance of the
1727 // camera so that it doesn't jump around.
1728 Point3F currentPos;
1729 mObjToWorld.getColumn(3,&currentPos);
1730
1731 Point3F dir = pnt - currentPos;
1732 mCurrentEditOrbitDist = dir.len();
1733
1734 if(mMode == EditOrbitMode)
1735 {
1736 dir.normalize();
1737
1738 F32 yaw, pitch;
1739 MathUtils::getAnglesFromVector(dir, yaw, pitch);
1740 mRot.x = -pitch;
1741 mRot.z = yaw;
1742 }
1743
1744 mEditOrbitPoint = pnt;
1745
1746 setMaskBits(EditOrbitMask);
1747}
1748
1749//----------------------------------------------------------------------------
1750

Callers 1

camera.cppFile · 0.80

Calls 4

getAnglesFromVectorFunction · 0.85
getColumnMethod · 0.80
lenMethod · 0.45
normalizeMethod · 0.45

Tested by

no test coverage detected