Пример #1
0
        public void CalcZoneFrames(personDetectModeE personDetectMode)
        {
            if (!frameZones.Get())
            {
                return;
            }
            var vz        = Vector3.zero;
            int icnt      = 0;
            var zoneslots = sman.znman.GetZoneSlots();

            foreach (ZoneSlot slot in zoneslots)
            {
                if (slot.slotformgo != null)
                {
                    if (slot.persgo != null)
                    {
                        //if (showOnlyFlaggedPeople && !slot.person.flagged) continue;
                        var rendgo = GetBodyPart(slot.person, personDetectMode);
                        if (rendgo == null)
                        {
                            continue;
                        }

                        //var rendgo = slot.persgo;
                        if (!GraphAlgos.GraphUtil.ClipToCameraBox(rendgo, clipdist: maxFrameDist))
                        {
                            continue;
                        }

                        var obrect        = GraphAlgos.GraphUtil.GUIRectWithObject(rendgo);
                        var obrectvisible = GraphAlgos.GraphUtil.ClipToScreen(obrect);
                        if (obrectvisible)
                        {
                            var person  = slot.person;
                            var cmt     = person.personName + " (" + person.empStatus + ") occupying " + slot.fullname;
                            var clr     = GetPersColor(person, Color.yellow);
                            var pt      = rendgo.transform.position;
                            var rot     = rendgo.transform.localEulerAngles;
                            var empstat = person.empStatus.ToString();
                            //var debstr = person.placeBld + "/" + person.placeNode + "/" + person.placeRoom;
                            //AddFoundLabel(LableClassE.person, slot.avatarname, person.personName, empstat, debstr, obrect, pt,rot,vz, slot.fullname, cmt, clr, 2);
                            AddFoundLabel(person, obrect, pt, rot, vz, slot.fullname, cmt, clr, 2);
                            icnt++;
                        }
                    }
                }
            }
            //Debug.Log("CalcZoneFrames Added " + icnt + " Label/Frames");
        }
Пример #2
0
        GameObject GetBodyPart(Person person, personDetectModeE personDetectMode)
        {
            GameObject bpgo = null;

            switch (personDetectMode)
            {
            case personDetectModeE.head:
                bpgo = person.GetBodyPart(Person.BodyPart.head);
                break;

            default:
            case personDetectModeE.person:
                bpgo = person.GetBodyPart(Person.BodyPart.body);
                break;
            }
            return(bpgo);
        }
Пример #3
0
        public void CalcBldFrames(personDetectModeE personDetectMode)
        {
            if (!frameBuildings.Get())
            {
                return;
            }
            var brooms = sman.bdman.GetBrooms();

            foreach (BldRoom broom in brooms)
            {
                if (!broom.enableFrames)
                {
                    continue;
                }
                CalcBldRoomFrames(broom, personDetectMode);
            }
            //Debug.Log("CalcGarageFrames Added " + icnt + " label/frames");
        }
Пример #4
0
        public void CalcBldRoomFrames(BldRoom broom, personDetectModeE personDetectMode)
        {
            int icnt    = 0;
            var persons = broom.GetPersons();
            var vz      = Vector3.zero;

            foreach (var person in persons)
            {
                //var rendgo = pers.roomPogo;
                //if (showOnlyFlaggedPeople && !person.flagged) continue;

                var rendgo = GetBodyPart(person, personDetectMode);
                if (rendgo == null)
                {
                    continue;
                }

                if (!GraphAlgos.GraphUtil.ClipToCameraBox(rendgo, clipdist: maxFrameDist))
                {
                    continue;
                }
                var obrect        = GraphAlgos.GraphUtil.GUIRectWithObject(rendgo);
                var obrectvisible = GraphAlgos.GraphUtil.ClipToScreen(obrect);
                if (obrectvisible)
                {
                    var cmt = person.personName + " (" + person.empStatus + ") in room " + broom.roomFullName;
                    var clr = GetPersColor(person, Color.magenta);
                    var pt  = rendgo.transform.position;
                    var rot = rendgo.transform.localEulerAngles;
                    //var debstr = person.placeBld+"/"+person.placeNode +"/"+person.placeRoom;
                    //AddFoundLabel(LableClassE.person, person.avatarName, person.personName, person.empStatus.ToString(),debstr, obrect,pt,rot,vz, broom.roomFullName, cmt, clr, 2);
                    AddFoundLabel(person, obrect, pt, rot, vz, broom.roomFullName, cmt, clr, 2);
                    icnt++;
                }
            }
        }
Пример #5
0
        public void CalcJourneyFrames(BirdFormE formfilter, personDetectModeE personDetectMode)
        {
            if (!frameJourneys.Get())
            {
                return;
            }
            var vz       = Vector3.zero;
            int icnt     = 0;
            var journeys = sman.jnman.GetJourneys();

            foreach (Journey jny in journeys)
            {
                if (jny.status == JourneyStatE.WaitingToStart)
                {
                    continue;
                }

                var visible   = false;
                var birdThing = jny.birdctrl.birdform;
                if (birdThing == formfilter)
                {
                    var rendgo = jny.birdctrl.birdformgo;
                    if (formfilter == BirdFormE.person)
                    {
                        //if (showOnlyFlaggedPeople && !jny.person.flagged) continue;
                        rendgo = GetBodyPart(jny.person, personDetectMode);
                        if (rendgo == null)
                        {
                            continue;
                        }
                    }

                    if (!GraphAlgos.GraphUtil.ClipToCameraBox(rendgo, clipdist: maxFrameDist))
                    {
                        continue;
                    }

                    jny.birdrect        = GraphAlgos.GraphUtil.GUIRectWithObject(rendgo);
                    visible             = GraphAlgos.GraphUtil.ClipToScreen(jny.birdrect);
                    visible             = visible && GraphAlgos.GraphUtil.IsInFrontOfMainCamera(rendgo);
                    jny.birdrectvisible = visible;
                    if (visible)
                    {
                        var id    = jny.person.personName;
                        var id2   = jny.person.empStatus.ToString();
                        var model = jny.person.avatarName;
                        if (birdThing == BirdFormE.car)
                        {
                            id  = jny.vehicle.vehicleId;
                            id2 = jny.vehicle.formName;
                        }
                        else
                        {
                            var person = jny.person;
                        }
                        var cmt = jny.birdctrl.birdresourcename + "  journeying";
                        //cmt += " Sc w,h:" + Screen.width + "," + Screen.height;
                        var clr = Color.cyan;
                        if (formfilter == BirdFormE.person)
                        {
                            clr = GetPersColor(jny.person, clr);
                        }
                        var pt      = rendgo.transform.position;
                        var rot     = rendgo.transform.localEulerAngles;
                        var vel     = jny.birdctrl.birdVelVek;
                        var locname = jny.birdctrl.pathweg.link.name;
                        //var thing = (birdThing == BirdFormE.car ? LableClassE.vehicle : LableClassE.person);
                        //AddFoundLabel(thing, model, id, id2, debstr, jny.birdrect, pt, rot, vel, locname, cmt, clr, 2);
                        if (birdThing == BirdFormE.person)
                        {
                            AddFoundLabel(jny.person, jny.birdrect, pt, rot, vel, locname, cmt, clr, 2);
                        }
                        else
                        {
                            AddFoundLabel(jny.vehicle, jny.birdrect, pt, rot, vel, locname, cmt, clr, 2);
                        }
                        icnt++;
                    }
                }
            }
            //Debug.Log("CalcJourneyFrames added " + icnt + " label/frames");
        }