コード例 #1
0
        // 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());
        }