/// <summary> /// Creates a new type properties object for the currently configured constraint type, /// and sets the type properties object in the shape. /// </summary> void UpdateTypePropertyClass() { switch (_constraintChainType) { case HavokConstraintChainType_e.BallAndSocket: _typeProperties = new BallAndSocketConstraintChainState(); break; case HavokConstraintChainType_e.StiffSpring: _typeProperties = new StiffSpringConstraintChainState(); break; } if (_typeProperties == null) { return; } if (_typeProperties.SupportsRotation()) { this.RemoveHint(HintFlags_e.NoRotation); } else { this.AddHint(HintFlags_e.NoRotation); } }
/// <summary> /// Called when deserializing /// </summary> /// <param name="info"></param> /// <param name="context"></param> protected HavokConstraintChainShape(SerializationInfo info, StreamingContext context) : base(info, context) { AddHint(HintFlags_e.NoScale); // Write dynamic constraint properties _constraintChainType = (HavokConstraintChainType_e)info.GetValue("_constraintChainType", typeof(HavokConstraintChainType_e)); _typeProperties = (ConstraintChainStateBase)info.GetValue("_typeProperties", typeof(ConstraintChainStateBase)); if (SerializationHelper.HasElement(info, "_objectKey")) { _objectKey = info.GetString("_objectKey"); } }
/// <summary> /// Creates a new type properties object for the currently configured constraint type, /// and sets the type properties object in the shape. /// </summary> void UpdateTypePropertyClass() { switch (_constraintChainType) { case HavokConstraintChainType_e.BallAndSocket: _typeProperties = new BallAndSocketConstraintChainState(); break; case HavokConstraintChainType_e.StiffSpring: _typeProperties = new StiffSpringConstraintChainState(); break; } if (_typeProperties == null) return; if (_typeProperties.SupportsRotation()) this.RemoveHint(HintFlags_e.NoRotation); else this.AddHint(HintFlags_e.NoRotation); }
/// <summary> /// Called when deserializing /// </summary> /// <param name="info"></param> /// <param name="context"></param> protected HavokConstraintChainShape(SerializationInfo info, StreamingContext context) : base(info, context) { AddHint(HintFlags_e.NoScale); // Write dynamic constraint properties _constraintChainType = (HavokConstraintChainType_e)info.GetValue("_constraintChainType", typeof(HavokConstraintChainType_e)); _typeProperties = (ConstraintChainStateBase)info.GetValue("_typeProperties", typeof(ConstraintChainStateBase)); if (SerializationHelper.HasElement(info, "_objectKey")) _objectKey = info.GetString("_objectKey"); }