Added velocity parameter w to particle update.