fCraft.TNTTask.CreateParticles C# (CSharp) Method

CreateParticles() private method

private CreateParticles ( ) : void
return void
        private void CreateParticles()
        {
            int n = _r.Next( 1, 4 );
            for ( int i = 0; i < n; ++i ) {
                double phi = _r.NextDouble() * 2 * Math.PI;
                double ksi = _r.NextDouble() * Math.PI - Math.PI / 2.0;

                Vector3F direction = ( new Vector3F( ( float )( Math.Cos( phi ) * Math.Cos( ksi ) ), ( float )( Math.Sin( phi ) * Math.Cos( ksi ) ), ( float )Math.Sin( ksi ) ) ).Normalize();
                if ( _owner.CanPlace( _map, ( _pos + 2 * direction ).Round(), Block.Obsidian, BlockChangeContext.Manual ) == CanPlaceResult.Allowed ) {
                    if ( _map.GetBlock( ( _pos + 2 * direction ).Round() ) != Block.Obsidian ) {
                        _world.AddPhysicsTask( new Particle( _world, ( _pos + 2 * direction ).Round(), direction, _owner, Block.Obsidian, _particleBehavior ), 0 );
                    }
                }
            }
        }