Exemplo n.º 1
0
        /// <summary>
        /// Removes all event reference during disposal.
        /// </summary>
        protected override void OnDispose(bool disposing)
        {
            if (disposing)
            {
                Moved             = delegate { };
                m_onParentChanged = null;
            }

            base.OnDispose(disposing);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="entity">The entity to attach this component to.</param>
        /// <param name="onParentChanged">Callback activated when </param>
        public Transform(Entity entity, ParentChangedHandler onParentChanged) : base(entity)
        {
            m_children = new List <Transform>();

            m_localPosition = Vector3.Zero;
            m_localRotation = Quaternion.Identity;
            m_localScale    = Vector3.One;

            m_forward = -Vector3.UnitY;
            m_up      = Vector3.UnitZ;
            m_right   = -Vector3.UnitX;

            m_localToParentMatrix = Matrix4.Identity;
            m_localToWorldMatrix  = Matrix4.Identity;
            m_worldToLocalMatrix  = Matrix4.Identity;

            m_dirtyFlags = DirtyFlag.None;

            m_onParentChanged = onParentChanged;
        }