// Utility methods - used for outside interaction // Spawning bodies public void CreateBody(RigidbodyProperties properties) { Rigidbody newBody = bodyManager.CreateBody(properties); if (_particleTrails) { newBody.HasTrail = true; newBody.TrailLength = TrailLength; } // Add electromagnetic force newBody.ExternalForces.Add(new ElectroMagnetic(newBody) { MagneticState = ElectroMagneticState }); BodySpawned(newBody, new EventArgs()); }
/// <summary> /// Gets the default properties to be used by a Rigidbody that the user is dragging. /// </summary> public static RigidbodyProperties GetDraggingProperties() { RigidbodyProperties result = new RigidbodyProperties(); result.drag = 10.0f; result.angularDrag = 10.0f; result.isKinematic = false; result.useGravity = false; result.solverIterationCount = 12; result.interpolation = RigidbodyInterpolation.Interpolate; return result; }