Beispiel #1
0
        public static void AttachTracker(Entity entity, Property <Vector3> property)
        {
            AkGameObjectTracker tracker = entity.Get <AkGameObjectTracker>();

            if (tracker == null)
            {
                tracker = new AkGameObjectTracker();
                entity.Add(tracker);
                tracker.Add(new Binding <Matrix, Vector3>(tracker.Matrix, x => Microsoft.Xna.Framework.Matrix.CreateTranslation(x), property));
                AkAuxSendArray aux = new AkAuxSendArray(Zone.MaxAuxSend);
                tracker.Add(new NotifyBinding(delegate() { tracker.AuxSend(aux, Zone.AuxSend(property, aux)); }, property));
            }
        }
Beispiel #2
0
        public static void AttachTracker(Entity entity, Property <Matrix> property = null)
        {
            AkGameObjectTracker tracker = entity.Get <AkGameObjectTracker>();

            if (tracker == null)
            {
                tracker = new AkGameObjectTracker();
                entity.Add(tracker);
                if (property == null)
                {
                    property = entity.Get <Transform>().Matrix;
                }
                tracker.Add(new Binding <Matrix>(tracker.Matrix, property));
                AkAuxSendArray aux = new AkAuxSendArray(Zone.MaxAuxSend);
                tracker.Add(new NotifyBinding(delegate() { tracker.AuxSend(aux, Zone.AuxSend(property.Value.Translation, aux)); }, property));
            }
        }