コード例 #1
0
        /// <summary>
        /// Raises the NodeSet event and performs custom processing</summary>
        protected override void OnNodeSet()
        {
            base.OnNodeSet();

            Box boxValue = DomNodeUtil.GetBox(DomNode, Schema.meshType.boundingBoxAttribute);

            m_boundingBox = boxValue.IsEmpty ? new Cached <Box>(CalculateBoundingBox) : new Cached <Box>(CalculateBoundingBox, boxValue);
        }
コード例 #2
0
ファイル: Mesh.cs プロジェクト: tkdgur4427/SGDManagedEngine
        /// <summary>
        /// Performs initialization when the adapter's node is set.
        /// This method is called each time the adapter is connected to its underlying node.
        /// Typically overridden by creators of DOM adapters.</summary>
        protected override void OnNodeSet()
        {
            base.OnNodeSet();

            Box boxValue = DomNodeUtil.GetBox(DomNode, Schema.meshType.boundingBoxAttribute);

            if (boxValue.IsEmpty)
            {
                m_boundingBox = new Cached <Box>(CalculateBoundingBox); // don't set value and force to compute
            }
            else
            {
                m_boundingBox = new Cached <Box>(CalculateBoundingBox, boxValue); // non-default value found, use it
            }
        }
コード例 #3
0
        /// <summary>
        /// Performs custom actions on NodeSet events.
        /// Called after successfully attaching to internal DOM object.</summary>
        protected override void OnNodeSet()
        {
            base.OnNodeSet();

            // Initialize scale to (1, 1, 1) if missing
            DomNode.SetAttributeIfDefault(Schema.nodeType.scaleAttribute, new Vec3F(1, 1, 1));

            m_rotation     = DomNode.GetChild(Schema.nodeType.rotEulChild);
            m_rotationAxis = DomNode.GetChild(Schema.nodeType.rotAxisEulChild);
            Transform      = TransformUtils.CalcTransform(this);

            Box boxValue = DomNodeUtil.GetBox(DomNode, Schema.nodeType.boundingBoxAttribute);

            if (boxValue.IsEmpty)
            {
                m_boundingBox = new Cached <Box>(CalculateBoundingBox); // don't set value and force to compute
            }
            else
            {
                m_boundingBox = new Cached <Box>(CalculateBoundingBox, boxValue); // non-default value found, use it
            }
        }