Пример #1
0
        public bool GetButtonBits(Motive.Tag tag, out int bits)
        {
            LiveObjectStorage storage;

            lock (lockObject) {
                if (!liveObjects.TryGetValue(Motive.GetName(tag), out storage))
                {
                    bits = 0;
                    return(false);
                }
                else
                {
                    bits = storage.bits;
                    return(true);
                }
            }
        }
Пример #2
0
        public bool GetPosition(Motive.Tag tag, out Vector3 position)
        {
            LiveObjectStorage storage;

            lock (lockObject) {
                if (!liveObjects.TryGetValue(Motive.GetName(tag), out storage))
                {
                    position = LiveObjectStorage.DEFAULT_VECTOR_POSITION;
                    return(false);
                }
                else
                {
                    position = storage.position;
                    if (position.Equals(LiveObjectStorage.DEFAULT_VECTOR_POSITION))
                    {
                        return(false);
                    }
                    else
                    {
                        return(true);
                    }
                }
            }
        }
Пример #3
0
        public bool GetRotation(Motive.Tag tag, out Quaternion rotation)
        {
            LiveObjectStorage storage;

            lock (lockObject) {
                if (!liveObjects.TryGetValue(Motive.GetName(tag), out storage))
                {
                    rotation = LiveObjectStorage.DEFAULT_QUATERNION_ROTATION;
                    return(false);
                }
                else
                {
                    rotation = storage.rotation;
                    if (rotation.Equals(LiveObjectStorage.DEFAULT_QUATERNION_ROTATION))
                    {
                        return(false);
                    }
                    else
                    {
                        return(true);
                    }
                }
            }
        }
Пример #4
0
        ///////////////////////////////////////////////////////////////////////////
        //
        // API functions
        //

        public bool IsLiveObject(Motive.Tag tag)
        {
            return(liveObjects.ContainsKey(Motive.GetName(tag)));
        }