コード例 #1
0
        /// <summary>
        /// Called when deserializing
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected HavokConstraintShape(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            AddHint(HintFlags_e.NoScale);

            // Read dynamic constraint properties
            _constraintType = (HavokConstraintType_e)info.GetValue("_constraintType", typeof(HavokConstraintType_e));
            _typeProperties = (ConstraintStateBase)info.GetValue("_typeProperties", typeof(ConstraintStateBase));

            if ((_typeProperties != null) && _typeProperties.SupportsRotation())
            {
                this.RemoveHint(HintFlags_e.NoRotation);
            }
            else
            {
                this.AddHint(HintFlags_e.NoRotation);
            }

            if (SerializationHelper.HasElement(info, "_objectKey"))
            {
                _objectKey = info.GetString("_objectKey");
            }
        }
コード例 #2
0
        /// <summary>
        /// Called when deserializing
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected HavokConstraintShape(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            AddHint(HintFlags_e.NoScale);

              // Read dynamic constraint properties
              _constraintType = (HavokConstraintType_e)info.GetValue("_constraintType", typeof(HavokConstraintType_e));
              _typeProperties = (ConstraintStateBase)info.GetValue("_typeProperties", typeof(ConstraintStateBase));

              if ((_typeProperties != null) && _typeProperties.SupportsRotation())
            this.RemoveHint(HintFlags_e.NoRotation);
              else
            this.AddHint(HintFlags_e.NoRotation);

              if (SerializationHelper.HasElement(info, "_objectKey"))
            _objectKey = info.GetString("_objectKey");
        }