Пример #1
0
    Quaternion GetRotation(Astra.Joint jo)
    {
        Vector3 jointUp = new Vector3(jo.Orientation.M01,
                                      jo.Orientation.M11,
                                      jo.Orientation.M21);
        Vector3 jointForward = new Vector3(jo.Orientation.M02,
                                           jo.Orientation.M12,
                                           jo.Orientation.M22);

        return(Quaternion.LookRotation(jointForward, jointUp));
    }
Пример #2
0
    void PrintBody(Astra.BodyFrame bodyFrame)
    {
        if (bodyFrame != null)
        {
            Body[] bodies = { };
            bodyFrame.CopyBodyData(ref bodies);
            foreach (Body body in bodies)
            {
                Astra.Joint headJoint = body.Joints[(int)JointType.Head];

                Debug.Log("Body " + body.Id + " COM " + body.CenterOfMass +
                          " Head Depth: " + headJoint.DepthPosition.X + "," + headJoint.DepthPosition.Y +
                          " World: " + headJoint.WorldPosition.X + "," + headJoint.WorldPosition.Y + "," + headJoint.WorldPosition.Z +
                          " Status: " + headJoint.Status.ToString());
            }
        }
    }