Beispiel #1
0
        // :TODO: Think about moving these out to some kind of controller type that also consumes the repository
        internal void SetTranslation(string objectID, Vector3 translation)
        {
            GameObjectRecord record = m_gameObjectRepository.GetObjectRecord(objectID);

            if (record != null)
            {
                record.TranslationOffsetECEF = translation;
                record.RootGameObject.transform.localPosition = translation;
            }
        }
Beispiel #2
0
        internal void SetOrientation(string objectID, Quaternion orientationECEF)
        {
            GameObjectRecord record = m_gameObjectRepository.GetObjectRecord(objectID);

            if (record != null)
            {
                record.OrientationECEF = orientationECEF;
                record.RootGameObject.transform.localRotation = orientationECEF;
            }
        }
Beispiel #3
0
        public void Add(string id, DoubleVector3 originECEF, Vector3 translationOffsetECEF, Quaternion orientationECEF, GameObject rootGameObject)
        {
            if (Contains(id))
            {
                return; // :TODO: fix
            }

            var record = new GameObjectRecord {
                OriginECEF = originECEF, TranslationOffsetECEF = translationOffsetECEF, OrientationECEF = orientationECEF, RootGameObject = rootGameObject
            };

            m_gameObjectsById.Add(id, record);
        }
        public void Add(string id, DoubleVector3 originEcef, GameObject[] gameObjects)
        {
            if (Contains(id))
            {
                return; // :TODO: fix
            }

            var record = new GameObjectRecord {
                OriginECEF = originEcef, GameObjects = gameObjects
            };

            m_gameObjectsById.Add(id, record);
        }
Beispiel #5
0
        public bool TryGetGameObject(string objectID, out GameObject gameObject)
        {
            GameObjectRecord record = GetObjectRecord(objectID);

            if (record != null)
            {
                gameObject = record.RootGameObject;
                return(true);
            }
            else
            {
                Debug.LogFormat("Failed to get objects with id {0}", objectID);
                gameObject = null;
            }

            return(false);
        }