/// <summary> /// Clone this component. /// </summary> /// <returns>Cloned copy of this component.</returns> override public BaseComponent Clone() { // create cloned component to return KinematicBody ret = (KinematicBody)CopyBasics(new KinematicBody(_shape.Clone())); // return the cloned object return(ret); }
/// <summary> /// Clone this component. /// </summary> /// <returns>Cloned copy of this component.</returns> override public BaseComponent Clone() { // create cloned component to return RigidBody ret = (RigidBody)CopyBasics(new RigidBody(_shape.Clone(), Mass, Inertia, _body.Friction)); // copy current state ret._body.CopyConditionFrom(_body); ret.Gravity = Gravity; ret.ConstForce = ConstForce; ret.ConstVelocity = ConstVelocity; ret.ConstTorqueForce = ConstTorqueForce; ret.ConstAngularVelocity = ConstAngularVelocity; // return the cloned body return(ret); }