Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding input option to connect to IPhone FaceID Tracking via Unreal Engine's LiveLink App #1423

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Dazbii
Copy link

@Dazbii Dazbii commented Feb 7, 2022

The iPhone Face ID sensors can accurately capture all sorts of facial expression data, including head rotation data. Unreal Engine has an app called Live Link Face that sends that is meant to send that data in real-time over to Unreal Engine. This data is just sent over UDP so it is easy to read and extract the head rotation data from.

I just added a new input, mostly copying the existing UDP input, but made it extract and format the data sent by the Live Link app.

One note is that Live Link only sends head rotation data, nothing on position.

Another thing to note is that the Face ID sensors are present on the iPhone X/XR/XS and newer, as well as the iPad Pro 3rd gen and newer.

do
{
const qint64 sz = sock.pendingDatagramSize();
datagram.resize(sz);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use malloc in the main loop.

// There is static data with length depending on IPhone name at the left of the datagram.
// Our three head rotation values are located 9th from the right of the datagram.
// Discard the rest of the face data
datagram = datagram.right(sizeof(float[9])).left(sizeof(float[3]));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

malloc

// Discard the rest of the face data
datagram = datagram.right(sizeof(float[9])).left(sizeof(float[3]));
ok = true;
QDataStream dataStream(&datagram, QIODevice::ReadOnly);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

malloc in QIODevice

}

if (ok)
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move QMutexLocker usage here.

datagram = datagram.right(sizeof(float[9])).left(sizeof(float[3]));
ok = true;
QDataStream dataStream(&datagram, QIODevice::ReadOnly);
dataStream.setByteOrder(QDataStream::BigEndian);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Floats are always little endian. You can read into a union just fine.

@luzpaz
Copy link

luzpaz commented Nov 13, 2023

Any reason why this PR is stalled ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants