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

Method setEditOrbitMode

Engine/source/T3D/camera.cpp:1646–1673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1644//-----------------------------------------------------------------------------
1645
1646void Camera::setEditOrbitMode()
1647{
1648 mMode = EditOrbitMode;
1649
1650 if (bool(mOrbitObject))
1651 {
1652 clearProcessAfter();
1653 clearNotify(mOrbitObject);
1654 }
1655 mOrbitObject = NULL;
1656
1657 // If there is a valid orbit point, then point to it
1658 // rather than move the camera.
1659 if(mValidEditOrbitPoint)
1660 {
1661 Point3F currentPos;
1662 mObjToWorld.getColumn(3,&currentPos);
1663
1664 Point3F dir = mEditOrbitPoint - currentPos;
1665 mCurrentEditOrbitDist = dir.len();
1666 dir.normalize();
1667
1668 F32 yaw, pitch;
1669 MathUtils::getAnglesFromVector(dir, yaw, pitch);
1670 mRot.x = -pitch;
1671 mRot.z = yaw;
1672 }
1673}
1674
1675//-----------------------------------------------------------------------------
1676

Callers 2

_setModeFieldMethod · 0.80
camera.cppFile · 0.80

Calls 4

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

Tested by

no test coverage detected