Пример #1
0
    public DistanceMap GetDistanceMap(Frame frame, bool mirrored)
    {
        DistanceMap sensor = new DistanceMap(Resolution);
        RootModule  module = Data.GetModule <RootModule>();

        if (module != null)
        {
            Vector3    position = module.GetRootPosition(frame.Timestamp, mirrored);
            Quaternion rotation = module.GetRootRotation(frame.Timestamp, mirrored);
            sensor.Sense(Matrix4x4.TRS(position + new Vector3(0f, 0.5f * Size.y, 0f), rotation, Vector3.one), Mask, Size);
        }
        else
        {
            sensor.Sense(frame.GetBoneTransformation(0, mirrored), Mask, Size);
        }
        return(sensor);
    }
Пример #2
0
    public CuboidMap GetCuboidMap(Frame frame, bool mirrored)
    {
        CuboidMap  sensor = new CuboidMap(Resolution);
        RootModule module = (RootModule)Data.GetModule(ID.Root);

        if (module != null)
        {
            Vector3    position = module.GetRootPosition(frame, mirrored);
            Quaternion rotation = module.GetRootRotation(frame, mirrored);
            sensor.Sense(Matrix4x4.TRS(position + new Vector3(0f, 0.5f * Size.y, 0f), rotation, Vector3.one), Mask, Size);
        }
        else
        {
            sensor.Sense(frame.GetBoneTransformation(0, mirrored), Mask, Size);
        }
        return(sensor);
    }
Пример #3
0
    public CylinderMap GetCylinderMap(Frame frame, bool mirrored)
    {
        CylinderMap sensor = new CylinderMap(Size, Resolution, Layers, Overlap);
        RootModule  module = (RootModule)Data.GetModule(ID.Root);

        if (module != null)
        {
            Vector3    position = module.GetRootPosition(frame, mirrored);
            Quaternion rotation = module.GetRootRotation(frame, mirrored);
            sensor.Sense(Matrix4x4.TRS(position + new Vector3(0f, 0f, 0f), rotation, Vector3.one), Mask);
        }
        else
        {
            sensor.Sense(frame.GetBoneTransformation(0, mirrored), Mask);
        }
        Samples = sensor.Points.Length;
        return(sensor);
    }